summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 21:30:06 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 21:30:06 -0500
commit011f7069677c77ee3039d94aef7bc25030ab3309 (patch)
tree0ac1ae8a99d8f8d58ebb47efb6481289aa570f79 /tests/spec/validator_spec.rb
parent1342fe0f855d72642c250c7c4be3509fb2257d7b (diff)
downloadhorizon-011f7069677c77ee3039d94aef7bc25030ab3309.tar.gz
horizon-011f7069677c77ee3039d94aef7bc25030ab3309.tar.bz2
horizon-011f7069677c77ee3039d94aef7bc25030ab3309.tar.xz
horizon-011f7069677c77ee3039d94aef7bc25030ab3309.zip
hscript: Implement Encrypt, add tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 5c78f36..a9c5fd9 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -910,6 +910,30 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*lvm_lv.*volume group/)
end
end
+ context "for 'encrypt' key" do
+ it "succeeds with a simple value" do
+ use_fixture '0189-encrypt-basic.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "fails with a duplicate block device" do
+ use_fixture '0190-encrypt-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*encrypt.*already/)
+ end
+ it "fails with an invalid block device" do
+ use_fixture '0191-encrypt-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*encrypt.*expected/)
+ end
+ it "succeeds with a passphrase" do
+ use_fixture '0192-encrypt-pw.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ end
context "for 'fs' key" do
it "succeeds with a simple value" do
use_fixture '0179-fs-basic.installfile'