diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-06 18:37:42 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-06 18:37:42 -0600 |
commit | 1bb0933fbca5ea5e07d0466b6a599b2d517402d3 (patch) | |
tree | 5781b85864f3affa197183a51c9fa8653d88d088 /tests | |
parent | 93ab3c76ca8d7ae1f8f1863768f93fde950c28b1 (diff) | |
download | horizon-1bb0933fbca5ea5e07d0466b6a599b2d517402d3.tar.gz horizon-1bb0933fbca5ea5e07d0466b6a599b2d517402d3.tar.bz2 horizon-1bb0933fbca5ea5e07d0466b6a599b2d517402d3.tar.xz horizon-1bb0933fbca5ea5e07d0466b6a599b2d517402d3.zip |
tests: Add pkginstall duplicate package tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0216-pkginstall-dup-single.installfile | 5 | ||||
-rw-r--r-- | tests/fixtures/0217-pkginstall-dup-multi.installfile | 6 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb | 12 |
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/fixtures/0216-pkginstall-dup-single.installfile b/tests/fixtures/0216-pkginstall-dup-single.installfile new file mode 100644 index 0000000..e7d505e --- /dev/null +++ b/tests/fixtures/0216-pkginstall-dup-single.installfile @@ -0,0 +1,5 @@ +network false +hostname test.machine +pkginstall adelie-base openrc openrc +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0217-pkginstall-dup-multi.installfile b/tests/fixtures/0217-pkginstall-dup-multi.installfile new file mode 100644 index 0000000..16867d0 --- /dev/null +++ b/tests/fixtures/0217-pkginstall-dup-multi.installfile @@ -0,0 +1,6 @@ +network false +hostname test.machine +pkginstall adelie-base openrc +pkginstall netifrc openrc +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 121ee22..45bb949 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -601,6 +601,18 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*signingkey/) end end + context "for 'pkginstall' key" do + it "warns when a package is listed twice in the same line" do + use_fixture '0216-pkginstall-dup-single.installfile' + run_validate + expect(last_command_started).to have_output(/warning: .*pkginstall.*already/) + end + it "warns when a package is listed twice in the same script" do + use_fixture '0217-pkginstall-dup-multi.installfile' + run_validate ' -s' + expect(last_command_started).to have_output(/warning: .*pkginstall.*already/) + end + end context "for 'diskid' key" do it "succeeds with basic disk identification" do use_fixture '0076-diskid-basic.installfile' |