diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 20:01:14 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 20:01:14 -0500 |
commit | f1ef45bd84b57b40b701e094a9b49daac3761f9f (patch) | |
tree | a52df6f8dbd231b5ba07c28aa0cc7c8fda919480 /tests/spec | |
parent | 55325a6e780b121f93d35076e4226521ca13ef12 (diff) | |
download | horizon-f1ef45bd84b57b40b701e094a9b49daac3761f9f.tar.gz horizon-f1ef45bd84b57b40b701e094a9b49daac3761f9f.tar.bz2 horizon-f1ef45bd84b57b40b701e094a9b49daac3761f9f.tar.xz horizon-f1ef45bd84b57b40b701e094a9b49daac3761f9f.zip |
hscript: Implement UserGroups, add tests
Diffstat (limited to 'tests/spec')
-rw-r--r-- | tests/spec/validator.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index e43e5ed..023d49e 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -651,6 +651,50 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*usericon.*URL/) end end + context "'usergroups'" do + # Runner.Validate.usergroups. + it "succeeds with a valid account/group set" do + use_fixture '0104-usergroups-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.usergroups.Validity. + it "requires at least one group to be provided" do + use_fixture '0105-usergroups-without-groups.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*required/) + end + it "correctly errors when only a , is given" do + use_fixture '0106-usergroups-comma.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*invalid/) + end + # Runner.Validate.usergroups.Name. + it "fails with a username that wasn't given" do + use_fixture '0107-usergroups-unknown-name.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*name/) + end + # Runner.Validate.usergroups.Count. + it "fails with more than 16 groups for a single name" do + use_fixture '0108-jumbo-usergroups.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*16/) + end + # Runner.Validate.usergroups.Group. + it "fails with an unknown group name" do + use_fixture '0109-usergroups-unknown.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*group/) + end + # Runner.Validate.usergroups.Unique. + it "fails with the same group specified twice" do + use_fixture '0110-usergroups-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usergroups.*duplicate/) + end + end end context "package specifications" do # no requirements for these, but I think obvious. |