From 383ed329bffdec853bdb4c9c03e56ed3b86455da Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 17 Oct 2019 23:08:43 -0500 Subject: hscript: Implement diskid key (except execution) --- tests/spec/validator.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/spec') diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index cdcd38b..d54006d 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -450,6 +450,40 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*repository/) end end + context "for 'diskid' key" do + it "succeeds with basic disk identification" do + use_fixture '0076-diskid-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 an identification string" do + use_fixture '0077-diskid-missing-id.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*diskid.*expected/) + end + it "succeeds with present disk" do + use_fixture '0078-diskid-diskid-loop0.installfile' + run_validate ' -i' + 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 '0079-diskid-enoent.installfile' + run_validate ' -i' + expect(last_command_started).to have_output(/No such file or directory/) + end + it "fails with non-disk file" do + use_fixture '0080-diskid-tmp.installfile' + run_validate ' -i' + expect(last_command_started).to have_output(/error: .*diskid.*block/) + end + it "fails with a duplicate identification device" do + use_fixture '0081-diskid-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*diskid.*already/) + end + end end context "unique keys" do # Runner.Validate.network. -- cgit v1.2.3-70-g09d2