summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 16:53:03 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 16:53:03 -0600
commit980aa145efd22d51781c59cc3c4245659db0ea47 (patch)
tree79670e2a04b11e8f9fefa3072e5790e5ce8d40e7 /tests
parente4d2dfda526402b1cd4623ea473ab655ea421de5 (diff)
downloadhorizon-980aa145efd22d51781c59cc3c4245659db0ea47.tar.gz
horizon-980aa145efd22d51781c59cc3c4245659db0ea47.tar.bz2
horizon-980aa145efd22d51781c59cc3c4245659db0ea47.tar.xz
horizon-980aa145efd22d51781c59cc3c4245659db0ea47.zip
tests: Add duplicate value tests for keymap, timezone, fs
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0204-keymap-duplicate.installfile7
-rw-r--r--tests/fixtures/0205-timezone-duplicate.installfile7
-rw-r--r--tests/fixtures/0206-fs-duplicate.installfile10
-rw-r--r--tests/spec/validator_spec.rb15
4 files changed, 39 insertions, 0 deletions
diff --git a/tests/fixtures/0204-keymap-duplicate.installfile b/tests/fixtures/0204-keymap-duplicate.installfile
new file mode 100644
index 0000000..c437315
--- /dev/null
+++ b/tests/fixtures/0204-keymap-duplicate.installfile
@@ -0,0 +1,7 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+keymap us
+keymap us
diff --git a/tests/fixtures/0205-timezone-duplicate.installfile b/tests/fixtures/0205-timezone-duplicate.installfile
new file mode 100644
index 0000000..7c4afe6
--- /dev/null
+++ b/tests/fixtures/0205-timezone-duplicate.installfile
@@ -0,0 +1,7 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+timezone Pacific/Galapagos
+timezone Pacific/Galapagos
diff --git a/tests/fixtures/0206-fs-duplicate.installfile b/tests/fixtures/0206-fs-duplicate.installfile
new file mode 100644
index 0000000..9c17b3f
--- /dev/null
+++ b/tests/fixtures/0206-fs-duplicate.installfile
@@ -0,0 +1,10 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb gpt
+partition /dev/sdb 1 fill
+fs /dev/sdb1 ext4
+fs /dev/sdb1 ext4
+mount /dev/sdb1 /
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index a0b67df..ba5559f 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -976,6 +976,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*fs.*type/)
end
+ it "fails with a duplicate block device" do
+ use_fixture '0206-fs-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*fs.*already/)
+ end
end
context "for 'keymap' key" do
it "succeeds with a simple value" do
@@ -1022,6 +1027,16 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*duplicate.*language/)
end
+ it "fails with a duplicate 'keymap' key" do
+ use_fixture '0204-keymap-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*duplicate.*keymap/)
+ end
+ it "fails with a duplicate 'timezone' key" do
+ use_fixture '0205-timezone-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*duplicate.*timezone/)
+ end
end
context "user account keys:" do
context "'username'" do