summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 13:05:47 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 13:05:47 -0500
commit0d626d668ba6c14022ca88611aff2365cbe4f30c (patch)
treef3312bbf41165733b8edc111618bf82b38cd3cec /tests/spec/validator_spec.rb
parentbd078146c3b2ab4fb8011e67d9d5c9016bb9d09b (diff)
downloadhorizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.gz
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.bz2
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.tar.xz
horizon-0d626d668ba6c14022ca88611aff2365cbe4f30c.zip
hscript: Implement lvm_lv, add tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 0443140..21def58 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -834,6 +834,45 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*lvm_vg.*expected/)
end
end
+ context "for 'lvm_lv' key" do
+ it "succeeds with a simple value" do
+ use_fixture '0171-lvmlv-basic.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "requires a valid volume group name" do
+ use_fixture '0172-lvmlv-badvg.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*name/)
+ end
+ it "requires a valid logical volume name" do
+ use_fixture '0173-lvmlv-badlv.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*name/)
+ end
+ it "requires a valid size" do
+ use_fixture '0174-lvmlv-bad-size.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*size/)
+ end
+ it "requires a size to be specified" do
+ use_fixture '0175-lvmlv-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*expected/)
+ end
+ it "requires a unique VG/LV name pair" do
+ use_fixture '0176-lvmlv-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*already/)
+ end
+ it "requires the volume group to be present" do
+ use_fixture '0177-lvmlv-no-vg.installfile'
+ run_validate ' -i'
+ skip "This build does not support this test" if last_command_started.stdout =~ /runtime environment only/
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*volume group/)
+ end
+ end
end
context "unique keys" do
# Runner.Validate.network.