From bbe669b761db4cb03fca2dbf9a7890d5a7e120af Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 17 Mar 2020 00:52:38 -0500 Subject: hscript: Add new netconfigtype key and associated tests Not wired up to netaddress et al, but does parse properly. --- tests/spec/validator_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/spec/validator_spec.rb') diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 971b91d..963eecf 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -221,6 +221,25 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*arch.*expected/) end end + context "for 'netconfigtype' key" do + it "succeeds with netifrc specified" do + use_fixture '0226-netconfigtype-netifrc.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 /etc/network/interfaces specified" do + use_fixture '0227-netconfigtype-eni.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 value" do + use_fixture '0228-netconfigtype-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netconfigtype.*valid/) + end + end context "for 'nameserver' key" do it "succeeds with IPv4 and IPv6 addresses" do use_fixture '0183-nameserver-basic.installfile' -- cgit v1.2.3-60-g2f50