summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/fixtures/0218-repository-max.installfile19
-rw-r--r--tests/fixtures/0219-signingkey-max.installfile19
-rw-r--r--tests/fixtures/0220-netssid-missing-type.installfile6
-rw-r--r--tests/spec/validator_spec.rb15
4 files changed, 59 insertions, 0 deletions
diff --git a/tests/fixtures/0218-repository-max.installfile b/tests/fixtures/0218-repository-max.installfile
new file mode 100644
index 0000000..2a59ee1
--- /dev/null
+++ b/tests/fixtures/0218-repository-max.installfile
@@ -0,0 +1,19 @@
+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
+repository https://distfiles.adelielinux.org/adelie/stable/system
+repository https://distfiles.adelielinux.org/adelie/stable/user
+repository https://distfiles.adelielinux.org/adelie/1.0/system
+repository https://distfiles.adelielinux.org/adelie/1.0/user
+repository https://distfiles.adelielinux.org/adelie/1-stable/system
+repository https://distfiles.adelielinux.org/adelie/1-stable/user
+repository https://distfiles.adelielinux.org/adelie/1.0-beta4/system
+repository https://distfiles.adelielinux.org/adelie/1.0-beta4/user
+repository https://distfiles.adelielinux.org/adelie/1.0-beta3/system
+repository https://distfiles.adelielinux.org/adelie/1.0-beta3/user
+repository https://distfiles.adelielinux.org/adelie/1.0-beta2/system
+repository https://distfiles.adelielinux.org/adelie/1.0-beta2/user
diff --git a/tests/fixtures/0219-signingkey-max.installfile b/tests/fixtures/0219-signingkey-max.installfile
new file mode 100644
index 0000000..8d2133a
--- /dev/null
+++ b/tests/fixtures/0219-signingkey-max.installfile
@@ -0,0 +1,19 @@
+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
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
+signingkey https://distfiles.adelielinux.org/adelie/packages@adelielinux.org.pub
diff --git a/tests/fixtures/0220-netssid-missing-type.installfile b/tests/fixtures/0220-netssid-missing-type.installfile
new file mode 100644
index 0000000..3360dd4
--- /dev/null
+++ b/tests/fixtures/0220-netssid-missing-type.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+netssid wlan0 "h"
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 45bb949..eea3f2a 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -568,6 +568,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*netssid.*security/)
end
+ it "fails with missing security type" do
+ use_fixture '0220-netssid-missing-type.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*security type expected/)
+ end
end
context "for 'repository' key" do
it "succeeds with basic repositories" do
@@ -581,6 +586,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*repository/)
end
+ it "fails with too many repositories specified" do
+ use_fixture '0218-repository-max.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*repository.*too many/)
+ end
end
context "for 'signingkey' key" do
it "succeeds with secure key URL" do
@@ -600,6 +610,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*signingkey/)
end
+ it "fails with too many signing keys specified" do
+ use_fixture '0219-signingkey-max.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*signingkey.*too many/)
+ end
end
context "for 'pkginstall' key" do
it "warns when a package is listed twice in the same line" do