diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-21 01:36:47 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-21 01:36:47 -0500 |
commit | 07a2de27b57848789171dee2559e4bd78d0e921c (patch) | |
tree | 67f4a95dc146a09207f293feccb6555063c6f955 /tests/spec/validator_spec.rb | |
parent | 790217353e94a4a9ee14d51b8a9e6c2dafc6377d (diff) | |
download | horizon-07a2de27b57848789171dee2559e4bd78d0e921c.tar.gz horizon-07a2de27b57848789171dee2559e4bd78d0e921c.tar.bz2 horizon-07a2de27b57848789171dee2559e4bd78d0e921c.tar.xz horizon-07a2de27b57848789171dee2559e4bd78d0e921c.zip |
hscript: Implement DiskLabel, add tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r-- | tests/spec/validator_spec.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 3ed43ea..624eaa2 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -548,6 +548,54 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*diskid.*already/) end end + context "for 'disklabel' key" do + it "requires a label type" do + use_fixture '0129-disklabel-without-label.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*disklabel.*expected/) + end + it "succeeds with a APM disk label" do + use_fixture '0122-disklabel-apm.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "succeeds with a MBR disk label" do + use_fixture '0123-disklabel-mbr.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "succeeds with a GPT disk label" do + use_fixture '0124-disklabel-gpt.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 disk" do + use_fixture '0125-disklabel-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*disklabel.*already/) + end + it "succeeds with present disk" do + use_fixture '0126-disklabel-loop0.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(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "fails with non-present disk" do + use_fixture '0127-disklabel-enoent.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: .*disklabel.*block/) + end + it "requires a valid label type" do + use_fixture '0128-disklabel-invalid-type.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*disklabel.*type/) + end + end end context "unique keys" do # Runner.Validate.network. |