From 7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 29 Oct 2019 10:51:41 -0500 Subject: hscript: Implement lvm_vg, add tests --- tests/spec/validator_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/spec/validator_spec.rb') diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 976f0f6..0443140 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -806,6 +806,34 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*lvm_pv.*exists/) end end + context "for 'lvm_vg' key" do + it "succeeds with a normal value" do + use_fixture '0166-lvmvg-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 an invalid PV path" do + use_fixture '0167-lvmvg-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*lvm_vg.*path/) + end + it "fails with a duplicate volume group name" do + use_fixture '0168-lvmvg-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*lvm_vg.*exists/) + end + it "fails with a dash as the first character of the VG name" do + use_fixture '0169-lvmvg-dash.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*lvm_vg.*name/) + end + it "requires a volume group name" do + use_fixture '0170-lvmvg-without-vg.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*lvm_vg.*expected/) + end + end end context "unique keys" do # Runner.Validate.network. -- cgit v1.2.3-60-g2f50