summaryrefslogtreecommitdiff
path: root/tests/spec/validator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-19 17:14:27 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-19 17:14:27 -0600
commit2495654ac0b1d9a4002f8d385d10d2afec784dda (patch)
treeda8b25a9bbaa3ab3bc2901398db4a0a3ec74481c /tests/spec/validator_spec.rb
parent3744e909df78cefebb083e401f6f6378f27d1b1a (diff)
downloadhorizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.gz
horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.bz2
horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.xz
horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.zip
hscript: Add 'arch' key implementation and related tests
Diffstat (limited to 'tests/spec/validator_spec.rb')
-rw-r--r--tests/spec/validator_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index eea3f2a..ba38563 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -203,6 +203,24 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*language.*invalid/)
end
end
+ context "for 'arch' key" do
+ it "succeeds with valid architecture" do
+ use_fixture '0223-arch-basic.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "warns on unrecognised architecture" do
+ use_fixture '0224-arch-unknown.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/warning: .*arch.*unknown CPU/)
+ end
+ it "fails on malformed architecture name" do
+ use_fixture '0225-arch-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*arch.*expected/)
+ end
+ end
context "for 'nameserver' key" do
it "succeeds with IPv4 and IPv6 addresses" do
use_fixture '0183-nameserver-basic.installfile'