diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-04 20:09:34 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-04 20:09:34 -0600 |
commit | ed351160f94bfff12fadbceb44a2f85604dfb957 (patch) | |
tree | afd2d3300614a6b215af4d0b42f2496906e72a3a | |
parent | 54b7f93e105f97f35e7cfe0587f04c100cb53f57 (diff) | |
download | horizon-ed351160f94bfff12fadbceb44a2f85604dfb957.tar.gz horizon-ed351160f94bfff12fadbceb44a2f85604dfb957.tar.bz2 horizon-ed351160f94bfff12fadbceb44a2f85604dfb957.tar.xz horizon-ed351160f94bfff12fadbceb44a2f85604dfb957.zip |
tests: More validity tests for keymap and language
-rw-r--r-- | tests/fixtures/0198-keymap-invalid.installfile | 6 | ||||
-rw-r--r-- | tests/fixtures/0199-language-invalid2.installfile | 6 | ||||
-rw-r--r-- | tests/spec/validator_spec.rb | 10 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/fixtures/0198-keymap-invalid.installfile b/tests/fixtures/0198-keymap-invalid.installfile new file mode 100644 index 0000000..2d330aa --- /dev/null +++ b/tests/fixtures/0198-keymap-invalid.installfile @@ -0,0 +1,6 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +keymap klingon diff --git a/tests/fixtures/0199-language-invalid2.installfile b/tests/fixtures/0199-language-invalid2.installfile new file mode 100644 index 0000000..ee83679 --- /dev/null +++ b/tests/fixtures/0199-language-invalid2.installfile @@ -0,0 +1,6 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +language zz diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index a9c5fd9..e950a97 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -197,6 +197,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do run_validate expect(last_command_started).to have_output(/error: .*language.*codeset/) end + it "requires a valid two-char language" do + use_fixture '0199-language-invalid2.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*language.*invalid/) + end end context "for 'nameserver' key" do it "succeeds with IPv4 and IPv6 addresses" do @@ -964,6 +969,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(PARSER_SUCCESS) expect(last_command_started).to have_output(VALIDATOR_SUCCESS) end + it "fails with an invalid value" do + use_fixture '0198-keymap-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*keymap.*invalid/) + end end end context "unique keys" do |