diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-03-19 10:33:25 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-04-01 17:32:53 -0400 |
commit | 655eacf345a108247ba6ea506721395571108912 (patch) | |
tree | 01c5658eb2d221a49ecd9d47c2d7e7b6094a69af /spec | |
parent | 4e97804fc1b8b47667ec1d8b8f3c473d31c8bb29 (diff) | |
download | luarocks-655eacf345a108247ba6ea506721395571108912.tar.gz luarocks-655eacf345a108247ba6ea506721395571108912.tar.bz2 luarocks-655eacf345a108247ba6ea506721395571108912.zip |
Add --sign option to `luarocks pack`
* Introduce a new module, `luarocks.signing`
* Add `--sign` option to `luarocks pack`, which produces a
detached GPG signature
* Includes a basic test, along with some fixtures with
a password-less GPG key
Diffstat (limited to 'spec')
-rw-r--r-- | spec/fixtures/gpg/private-keys-v1.d/5D2D3F97B88B18604D819EA9DF5B730C75D71B60.key | bin | 0 -> 977 bytes | |||
-rw-r--r-- | spec/fixtures/gpg/private-keys-v1.d/B71C36B4EDEB72A047FED1C01BCFF4D08837E3B1.key | bin | 0 -> 978 bytes | |||
-rw-r--r-- | spec/fixtures/gpg/pubring.kbx | bin | 0 -> 1494 bytes | |||
-rw-r--r-- | spec/fixtures/gpg/trustdb.gpg | bin | 0 -> 1240 bytes | |||
-rw-r--r-- | spec/pack_spec.lua | 10 | ||||
-rw-r--r-- | spec/util/test_env.lua | 2 |
6 files changed, 12 insertions, 0 deletions
diff --git a/spec/fixtures/gpg/private-keys-v1.d/5D2D3F97B88B18604D819EA9DF5B730C75D71B60.key b/spec/fixtures/gpg/private-keys-v1.d/5D2D3F97B88B18604D819EA9DF5B730C75D71B60.key new file mode 100644 index 00000000..26240f5a --- /dev/null +++ b/spec/fixtures/gpg/private-keys-v1.d/5D2D3F97B88B18604D819EA9DF5B730C75D71B60.key | |||
Binary files differ | |||
diff --git a/spec/fixtures/gpg/private-keys-v1.d/B71C36B4EDEB72A047FED1C01BCFF4D08837E3B1.key b/spec/fixtures/gpg/private-keys-v1.d/B71C36B4EDEB72A047FED1C01BCFF4D08837E3B1.key new file mode 100644 index 00000000..e75a2eb4 --- /dev/null +++ b/spec/fixtures/gpg/private-keys-v1.d/B71C36B4EDEB72A047FED1C01BCFF4D08837E3B1.key | |||
Binary files differ | |||
diff --git a/spec/fixtures/gpg/pubring.kbx b/spec/fixtures/gpg/pubring.kbx new file mode 100644 index 00000000..fc63cbc6 --- /dev/null +++ b/spec/fixtures/gpg/pubring.kbx | |||
Binary files differ | |||
diff --git a/spec/fixtures/gpg/trustdb.gpg b/spec/fixtures/gpg/trustdb.gpg new file mode 100644 index 00000000..cabca669 --- /dev/null +++ b/spec/fixtures/gpg/trustdb.gpg | |||
Binary files differ | |||
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index 08647cfb..8b3612db 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua | |||
@@ -50,6 +50,16 @@ describe("LuaRocks pack #integration", function() | |||
50 | assert(test_env.remove_files(lfs.currentdir(), "say%-")) | 50 | assert(test_env.remove_files(lfs.currentdir(), "say%-")) |
51 | end) | 51 | end) |
52 | 52 | ||
53 | pending("#gpg --sign", function() | ||
54 | assert(run.luarocks_bool("install say 1.2")) | ||
55 | assert(run.luarocks_bool("install luassert")) | ||
56 | assert(run.luarocks_bool("install say 1.0")) | ||
57 | assert(run.luarocks_bool("pack say --sign")) | ||
58 | assert.is_truthy(lfs.attributes("say-1.2-1.all.rock")) | ||
59 | assert.is_truthy(lfs.attributes("say-1.2-1.all.rock.asc")) | ||
60 | assert(test_env.remove_files(lfs.currentdir(), "say%-")) | ||
61 | end) | ||
62 | |||
53 | describe("#mock", function() | 63 | describe("#mock", function() |
54 | 64 | ||
55 | setup(function() | 65 | setup(function() |
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 6850214f..9337c396 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -436,6 +436,7 @@ local function create_env(testing_paths) | |||
436 | end | 436 | end |
437 | 437 | ||
438 | local env_variables = {} | 438 | local env_variables = {} |
439 | env_variables.GNUPGHOME = testing_paths.gpg_dir | ||
439 | env_variables.LUA_VERSION = luaversion_short | 440 | env_variables.LUA_VERSION = luaversion_short |
440 | env_variables.LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/testing_config.lua" | 441 | env_variables.LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/testing_config.lua" |
441 | if test_env.TEST_TARGET_OS == "windows" then | 442 | if test_env.TEST_TARGET_OS == "windows" then |
@@ -593,6 +594,7 @@ local function create_paths(luaversion_full) | |||
593 | end | 594 | end |
594 | 595 | ||
595 | testing_paths.fixtures_dir = base_dir .. "/spec/fixtures" | 596 | testing_paths.fixtures_dir = base_dir .. "/spec/fixtures" |
597 | testing_paths.gpg_dir = testing_paths.fixtures_dir .. "/gpg" | ||
596 | testing_paths.fixtures_repo_dir = base_dir .. "/spec/fixtures/a_repo" | 598 | testing_paths.fixtures_repo_dir = base_dir .. "/spec/fixtures/a_repo" |
597 | testing_paths.util_dir = base_dir .. "/spec/util" | 599 | testing_paths.util_dir = base_dir .. "/spec/util" |
598 | testing_paths.testrun_dir = base_dir .. "/testrun" | 600 | testing_paths.testrun_dir = base_dir .. "/testrun" |