diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0204-keymap-duplicate.installfile | 7 | ||||
-rw-r--r-- | tests/fixtures/0205-timezone-duplicate.installfile | 7 | ||||
-rw-r--r-- | tests/fixtures/0206-fs-duplicate.installfile | 10 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb | 15 |
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 |