summaryrefslogtreecommitdiff
path: root/tests/spec/validator.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 19:55:53 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 19:55:53 -0500
commit5b0d0916b27f271fc12a8c0c6b595e11673d306d (patch)
treed8d2f3413caac49c1410c539b43be4630924666b /tests/spec/validator.rb
parent57307442c5d707591dfc4d5e7671364fa564fa5c (diff)
downloadhorizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.gz
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.bz2
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.tar.xz
horizon-5b0d0916b27f271fc12a8c0c6b595e11673d306d.zip
hscript: Implement 'hostname' parsing; add rest of existing manual tests
Diffstat (limited to 'tests/spec/validator.rb')
-rw-r--r--tests/spec/validator.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index bd53853..e54d40e 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -50,6 +50,16 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
run_validate
expect(last_command_started).to have_output(SUCCESS_OUTPUT)
end
+ it "requires keys to have values" do
+ use_fixture '0015-keys-without-values.installfile'
+ run_validate ' --keep-going'
+ expect(last_command_started).to have_output(/5 error(s)/)
+ end
+ it "fails on lines over maximum line length" do
+ use_fixture '0017-line-too-long.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*length/)
+ end
context "required keys" do
it "fails without a 'network' key" do
use_fixture '0006-no-network.installfile'
@@ -77,6 +87,28 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
expect(last_command_started).to have_output(/error: .*mount.*/)
end
end
+ context "values" do
+ it "fails with an invalid 'network' value" do
+ use_fixture '0011-invalid-network.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*network.*/)
+ end
+ it "fails with an invalid 'hostname' value" do
+ use_fixture '0012-invalid-hostname.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*hostname.*/)
+ end
+ it "fails with an invalid 'rootpw' value" do
+ use_fixture '0013-invalid-rootpw.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*rootpw.*/)
+ end
+ it "fails with an invalid 'mount' value" do
+ use_fixture '0014-invalid-mount.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*/)
+ end
+ end
context "unique keys" do
it "fails with a duplicate 'network' key" do
use_fixture '0018-duplicate-network.installfile'