summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-17 00:52:38 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-03-17 00:52:38 -0500
commitbbe669b761db4cb03fca2dbf9a7890d5a7e120af (patch)
tree580b71e39783a72c0416b65ef6714f454696e221 /tests/spec/validator_spec.rb
parent28c81a32aa59a9b2d39ddd7f86fb1d2677da32cc (diff)
downloadhorizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.gz
horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.bz2
horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.xz
horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.zip
hscript: Add new netconfigtype key and associated tests
Not wired up to netaddress et al, but does parse properly.
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb19
1 files changed, 19 insertions, 0 deletions
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'