summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0216-pkginstall-dup-single.installfile5
-rw-r--r--tests/fixtures/0217-pkginstall-dup-multi.installfile6
-rw-r--r--tests/spec/validator_spec.rb12
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'