summaryrefslogtreecommitdiff
path: root/tests/spec/validator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/validator.rb')
-rw-r--r--tests/spec/validator.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index 023d49e..0a94dbf 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -166,6 +166,32 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*rootpw.*/)
end
+ context "for 'firmware' key" do
+ it "always supports 'false' value" do
+ use_fixture '0112-firmware-false.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "requires 'false' if built without support" do
+ use_fixture '0111-firmware-true.installfile'
+ run_validate
+ skip "This build supports firmware" if last_command_started.stdout =~ /supports non-free/
+ expect(last_command_started).to have_output(/error: .*firmware/)
+ end
+ it "supports 'true' if built with support" do
+ use_fixture '0111-firmware-true.installfile'
+ run_validate
+ skip "This build does not support firmware" if last_command_started.stdout !~ /supports non-free/
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "requires a boolean value" do
+ use_fixture '0113-firmware-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*firmware.*value/)
+ end
+ end
context "for 'mount' key" do
# Runner.Validate.mount.
it "fails with an invalid value" do
@@ -507,6 +533,13 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*duplicate.*rootpw/)
end
+ # Runner.Validate.firmware.
+ it "fails with a duplicate 'firmware' key" do
+ use_fixture '0114-firmware-duplicate.installfile'
+ run_validate
+ skip "This build does not support firmware" if last_command_started.stdout !~ /supports non-free/
+ expect(last_command_started).to have_output(/error: .*duplicate.*firmware/)
+ end
end
context "user account keys:" do
context "'username'" do