summaryrefslogtreecommitdiff
path: root/tests/spec
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-19 01:43:15 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-19 01:43:15 -0500
commitd3489c52d4ad1e5b17ce88e8b0e5142b30bb324e (patch)
treef724d77518fc09b0707311b31857e784abda6daa /tests/spec
parent2374778a55f9380ee5b821eb9563e20aad1bc3de (diff)
downloadhorizon-d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e.tar.gz
horizon-d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e.tar.bz2
horizon-d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e.tar.xz
horizon-d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e.zip
hscript: Implement UserPassphrase, add tests
Diffstat (limited to 'tests/spec')
-rw-r--r--tests/spec/validator.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index 7fd8356..76f1c6f 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -568,6 +568,50 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*duplicate.*useralias/)
end
end
+ context "'userpw'" do
+ # Runner.Validate.userpw.
+ it "succeeds with username/passphrase combinations" do
+ use_fixture '0091-userpw-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.userpw.Validity.
+ it "requires a passphrase to be provided" do
+ use_fixture '0092-userpw-without-pw.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*userpw.*required/)
+ end
+ # Runner.Validate.userpw.Name.
+ it "fails with a username that wasn't given" do
+ use_fixture '0093-userpw-unknown-name.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*userpw.*name/)
+ end
+ # Runner.Validate.userpw.Unique.
+ it "fails with more than one passphrase for an account" do
+ use_fixture '0094-userpw-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*duplicate.*userpw/)
+ end
+ # Runner.Validate.userpw.Crypt.
+ it "fails with a plain-text password" do
+ use_fixture '0095-userpw-plaintext.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*userpw.*crypt/)
+ end
+ it "fails with an invalid encryption algorithm" do
+ use_fixture '0096-userpw-md5.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*userpw.*crypt/)
+ end
+ # Runner.Validate.userpw.None.
+ it "warns when an account doesn't have a passphrase" do
+ use_fixture '0097-userpw-missing.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/warning: .*passphrase/)
+ end
+ end
end
context "package specifications" do
# no requirements for these, but I think obvious.