diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-06 20:18:18 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-06 20:18:18 -0600 |
commit | f7c4db70e541ba11017d8261f0901a13badb7c97 (patch) | |
tree | d9f91236542d399d3f89191703cff18e7d048841 | |
parent | 903ea15e00039164413e6382ac5eefeeb25876ad (diff) | |
download | horizon-f7c4db70e541ba11017d8261f0901a13badb7c97.tar.gz horizon-f7c4db70e541ba11017d8261f0901a13badb7c97.tar.bz2 horizon-f7c4db70e541ba11017d8261f0901a13badb7c97.tar.xz horizon-f7c4db70e541ba11017d8261f0901a13badb7c97.zip |
tests: Add more corner case testing
-rw-r--r-- | tests/fixtures/0218-repository-max.installfile | 19 | ||||
-rw-r--r-- | tests/fixtures/0219-signingkey-max.installfile | 19 | ||||
-rw-r--r-- | tests/fixtures/0220-netssid-missing-type.installfile | 6 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb | 15 |
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 |