summaryrefslogtreecommitdiff
path: root/tests/spec
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 07:36:33 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 07:36:33 -0500
commit37005da8fbecc64c2942ac03f9189b219be69104 (patch)
treef1c6b98c03d00a6ee7a07fc2626c60969281f894 /tests/spec
parent5593f1f14f62e9474a0f14d0b863d1331468c522 (diff)
downloadhorizon-37005da8fbecc64c2942ac03f9189b219be69104.tar.gz
horizon-37005da8fbecc64c2942ac03f9189b219be69104.tar.bz2
horizon-37005da8fbecc64c2942ac03f9189b219be69104.tar.xz
horizon-37005da8fbecc64c2942ac03f9189b219be69104.zip
hscript: Add NetSSID parsing and tests
Diffstat (limited to 'tests/spec')
-rw-r--r--tests/spec/validator.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index 96cf572..fb17fa6 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -365,6 +365,74 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
expect(last_command_started).to have_output(/error: .*netaddress.*addresses/)
end
end
+ context "for 'netssid' key" do
+ it "succeeds with simple SSID, no security" do
+ use_fixture '0062-netssid-simple-none.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 simple SSID, WEP security" do
+ use_fixture '0063-netssid-simple-wep.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 simple SSID, WPA security" do
+ use_fixture '0064-netssid-simple-wpa.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 complex SSID, no security" do
+ use_fixture '0065-netssid-spaces-none.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 complex SSID, WEP security" do
+ use_fixture '0066-netssid-spaces-wep.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 complex SSID, WPA security" do
+ use_fixture '0067-netssid-spaces-wpa.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 invalid interface name" do
+ use_fixture '0068-netssid-invalid-iface.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*interface/)
+ end
+ it "fails with raw / unquoted SSID" do
+ use_fixture '0069-netssid-unquoted.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*quote/)
+ end
+ it "fails with SSID without terminating quote" do
+ use_fixture '0070-netssid-syntax-error.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*unterminated/)
+ end
+ it "fails with missing passphrase" do
+ use_fixture '0071-netssid-missing-pw.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*expected/)
+ end
+ it "fails with missing SSID" do
+ use_fixture '0072-netssid-missing-ssid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*expected/)
+ end
+ it "fails with invalid security type" do
+ use_fixture '0073-netssid-invalid-type.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netssid.*security/)
+ end
+ end
context "for 'repository' key" do
it "succeeds with basic repositories" do
use_fixture '0055-repository-basic.installfile'