summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 17:48:33 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 17:48:33 -0600
commitd799d56fc8505261cda099f402eafbc4fe858ca0 (patch)
treee39fa61b72b058dd176dd30f89730985a0f0b6f7 /tests/spec/validator_spec.rb
parent8b7d518575604e628e3823f6bf1b7dd1ee36cc1d (diff)
downloadhorizon-d799d56fc8505261cda099f402eafbc4fe858ca0.tar.gz
horizon-d799d56fc8505261cda099f402eafbc4fe858ca0.tar.bz2
horizon-d799d56fc8505261cda099f402eafbc4fe858ca0.tar.xz
horizon-d799d56fc8505261cda099f402eafbc4fe858ca0.zip
tests: Add more LVM behavioural tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index ba5559f..37a2542 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -890,6 +890,22 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*lvm_vg.*expected/)
end
+ it "fails with a dot as the VG name" do
+ use_fixture '0207-lvmvg-dot.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_vg.*name/)
+ end
+ it "succeeds with a dot in the VG name" do
+ use_fixture '0208-lvmvg-valid-dot.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "warns when a PV isn't created" do
+ use_fixture '0214-lvmvg-without-pv.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/warning: .*lvm_vg.*physical volume/)
+ end
end
context "for 'lvm_lv' key" do
it "succeeds with a simple value" do
@@ -929,6 +945,19 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
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
+ it "fails if the logical volume name starts with a dash" do
+ use_fixture '0209-lvmlv-dash.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*name/)
+ end
+ it "fails if the logical volume name is reserved" do
+ use_fixture '0210-lvmlv-snapshot.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*name/)
+ use_fixture '0211-lvmlv-pvmove.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_lv.*name/)
+ end
end
context "for 'encrypt' key" do
it "succeeds with a simple value" do