summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 20:38:27 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 20:38:27 -0500
commit7ab44372d81e86df99b3aefa114a5003df98bc61 (patch)
treea376b212f73518f7633925bf77d403fc33792953 /tests
parentbc96edb1c20b0031479cbf23055651c2c92f7afe (diff)
downloadhorizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.gz
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.bz2
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.xz
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.zip
hscript: Implement SigningKey, add tests
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0186-signingkey-basic.installfile8
-rw-r--r--tests/fixtures/0187-signingkey-local.installfile8
-rw-r--r--tests/fixtures/0188-signingkey-insec.installfile8
-rw-r--r--tests/spec/validator_spec.rb19
4 files changed, 43 insertions, 0 deletions
diff --git a/tests/fixtures/0186-signingkey-basic.installfile b/tests/fixtures/0186-signingkey-basic.installfile
new file mode 100644
index 0000000..c81ec32
--- /dev/null
+++ b/tests/fixtures/0186-signingkey-basic.installfile
@@ -0,0 +1,8 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+repository https://distfiles.adelielinux.org/adelie/current/system
+repository https://distfiles.adelielinux.org/adelie/current/user
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
diff --git a/tests/fixtures/0187-signingkey-local.installfile b/tests/fixtures/0187-signingkey-local.installfile
new file mode 100644
index 0000000..1af18b5
--- /dev/null
+++ b/tests/fixtures/0187-signingkey-local.installfile
@@ -0,0 +1,8 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+repository https://distfiles.adelielinux.org/adelie/current/system
+repository https://distfiles.adelielinux.org/adelie/current/user
+signingkey /etc/apk/keys/packages@adelielinux.org.pub
diff --git a/tests/fixtures/0188-signingkey-insec.installfile b/tests/fixtures/0188-signingkey-insec.installfile
new file mode 100644
index 0000000..185894d
--- /dev/null
+++ b/tests/fixtures/0188-signingkey-insec.installfile
@@ -0,0 +1,8 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+repository https://distfiles.adelielinux.org/adelie/current/system
+repository https://distfiles.adelielinux.org/adelie/current/user
+signingkey http://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 96a2caf..5c78f36 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -562,6 +562,25 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*repository/)
end
end
+ context "for 'signingkey' key" do
+ it "succeeds with secure key URL" do
+ use_fixture '0186-signingkey-basic.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "succeeds with local key URL" do
+ use_fixture '0187-signingkey-local.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "fails with insecure key URL" do
+ use_fixture '0188-signingkey-insec.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*signingkey/)
+ end
+ end
context "for 'diskid' key" do
it "succeeds with basic disk identification" do
use_fixture '0076-diskid-basic.installfile'