summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-18 20:54:04 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-18 20:54:04 -0500
commit8ce5c61ab1cc093f27b3874965d2052ca35f8a9b (patch)
tree5f24c6f724ebad015ca5e6ee0372a19475ad0437 /tests
parent918125404fdf222caef16f8cf3798e20266ae662 (diff)
downloadhorizon-8ce5c61ab1cc093f27b3874965d2052ca35f8a9b.tar.gz
horizon-8ce5c61ab1cc093f27b3874965d2052ca35f8a9b.tar.bz2
horizon-8ce5c61ab1cc093f27b3874965d2052ca35f8a9b.tar.xz
horizon-8ce5c61ab1cc093f27b3874965d2052ca35f8a9b.zip
tests: Add test for too many usernames
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0085-all-the-username.installfile277
-rw-r--r--tests/spec/validator.rb15
2 files changed, 289 insertions, 3 deletions
diff --git a/tests/fixtures/0085-all-the-username.installfile b/tests/fixtures/0085-all-the-username.installfile
new file mode 100644
index 0000000..a9a9f40
--- /dev/null
+++ b/tests/fixtures/0085-all-the-username.installfile
@@ -0,0 +1,277 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+username chris
+username kayla
+username meg
+username steph
+username amanda
+username sroracle
+username aerdan
+username alyx
+username awilfox
+username crow
+username djt
+username foxserv
+username mc68030
+username raven
+username skarnet
+username sysvinit
+username cadey
+username smaeul
+username thalheim
+username aji
+username calvin
+username chessa
+username cyan
+username dusxmt
+username emily
+username freeyorp
+username gardyloo
+username lucy
+username madeline
+username matt
+username mismagius
+username mixi
+username moon
+username naia
+username netz
+username sam
+username ullbeking
+username appledash
+username artemis
+username devor_hju
+username jollyroger
+username kaniini
+username mai
+username solar
+username systemdlete
+username tecuane
+username bdragon
+username cm
+username danaur
+username dashie
+username josuah
+username neddy
+username panzeroceania
+username q66
+username quarky
+username quater
+username voker57
+username solon
+username ben
+username daddy
+username doppo
+username kitty
+username mosh
+username msiism
+username shentino
+username tillw
+username uberabby
+username veremitz
+username chris_1
+username kayla_1
+username meg_1
+username steph_1
+username amanda_1
+username sroracle_1
+username aerdan_1
+username alyx_1
+username awilfox_1
+username crow_1
+username djt_1
+username foxserv_1
+username mc68030_1
+username raven_1
+username skarnet_1
+username sysvinit_1
+username cadey_1
+username smaeul_1
+username thalheim_1
+username aji_1
+username calvin_1
+username chessa_1
+username cyan_1
+username dusxmt_1
+username emily_1
+username freeyorp_1
+username gardyloo_1
+username lucy_1
+username madeline_1
+username matt_1
+username mismagius_1
+username mixi_1
+username moon_1
+username naia_1
+username netz_1
+username sam_1
+username ullbeking_1
+username appledash_1
+username artemis_1
+username devor_hju_1
+username jollyroger_1
+username kaniini_1
+username mai_1
+username solar_1
+username systemdlete_1
+username tecuane_1
+username bdragon_1
+username cm_1
+username danaur_1
+username dashie_1
+username josuah_1
+username neddy_1
+username panzeroceania_1
+username q66_1
+username quarky_1
+username quater_1
+username voker57_1
+username solon_1
+username ben_1
+username daddy_1
+username doppo_1
+username kitty_1
+username mosh_1
+username msiism_1
+username shentino_1
+username tillw_1
+username uberabby_1
+username veremitz_1
+username chris_2
+username kayla_2
+username meg_2
+username steph_2
+username amanda_2
+username sroracle_2
+username aerdan_2
+username alyx_2
+username awilfox_2
+username crow_2
+username djt_2
+username foxserv_2
+username mc68030_2
+username raven_2
+username skarnet_2
+username sysvinit_2
+username cadey_2
+username smaeul_2
+username thalheim_2
+username aji_2
+username calvin_2
+username chessa_2
+username cyan_2
+username dusxmt_2
+username emily_2
+username freeyorp_2
+username gardyloo_2
+username lucy_2
+username madeline_2
+username matt_2
+username mismagius_2
+username mixi_2
+username moon_2
+username naia_2
+username netz_2
+username sam_2
+username ullbeking_2
+username appledash_2
+username artemis_2
+username devor_hju_2
+username jollyroger_2
+username kaniini_2
+username mai_2
+username solar_2
+username systemdlete_2
+username tecuane_2
+username bdragon_2
+username cm_2
+username danaur_2
+username dashie_2
+username josuah_2
+username neddy_2
+username panzeroceania_2
+username q66_2
+username quarky_2
+username quater_2
+username voker57_2
+username solon_2
+username ben_2
+username daddy_2
+username doppo_2
+username kitty_2
+username mosh_2
+username msiism_2
+username shentino_2
+username tillw_2
+username uberabby_2
+username veremitz_2
+username chris_3
+username kayla_3
+username meg_3
+username steph_3
+username amanda_3
+username sroracle_3
+username aerdan_3
+username alyx_3
+username awilfox_3
+username crow_3
+username djt_3
+username foxserv_3
+username mc68030_3
+username raven_3
+username skarnet_3
+username sysvinit_3
+username cadey_3
+username smaeul_3
+username thalheim_3
+username aji_3
+username calvin_3
+username chessa_3
+username cyan_3
+username dusxmt_3
+username emily_3
+username freeyorp_3
+username gardyloo_3
+username lucy_3
+username madeline_3
+username matt_3
+username mismagius_3
+username mixi_3
+username moon_3
+username naia_3
+username netz_3
+username sam_3
+username ullbeking_3
+username appledash_3
+username artemis_3
+username devor_hju_3
+username jollyroger_3
+username kaniini_3
+username mai_3
+username solar_3
+username systemdlete_3
+username tecuane_3
+username bdragon_3
+username cm_3
+username danaur_3
+username dashie_3
+username josuah_3
+username neddy_3
+username panzeroceania_3
+username q66_3
+username quarky_3
+username quater_3
+username voker57_3
+username solon_3
+username ben_3
+username daddy_3
+username doppo_3
+username kitty_3
+username mosh_3
+username msiism_3
+username shentino_3
+username tillw_3
+username uberabby_3
+username veremitz_3
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index 16f397a..2fa9c89 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -13,8 +13,8 @@ end
PARSER_SUCCESS = /parser: 0 error\(s\), 0 warning\(s\)/
VALIDATOR_SUCCESS = /validator: 0 failure\(s\)/
-RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
- context "argument passing" do
+RSpec.describe 'HorizonScript validation', :type => :aruba do
+ context "Utility argument passing" do
it "requires an installfile to be specified" do
run_command 'hscript-validate'
expect(last_command_started).to have_output(/usage/)
@@ -32,7 +32,7 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
expect(last_command_started).to_not have_output(/\033/)
end
end
- context "on invalid keys" do
+ context "with invalid keys" do
# No requirement - but was noted in the original draft vision doc as
# desireable because it allows future expansion while retaining some
# compatibility.
@@ -510,22 +510,31 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
end
context "user account keys:" do
context "'username'" do
+ # Runner.Validate.username.
it "succeeds with multiple usernames" do
use_fixture '0082-username-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.username.Unique.
it "fails with duplicate usernames" do
use_fixture '0083-username-duplicate.installfile'
run_validate
expect(last_command_started).to have_output(/error: .*duplicate.*username/)
end
+ # Runner.Validate.username.System.
it "fails with a system username" do
use_fixture '0084-username-system.installfile'
run_validate
expect(last_command_started).to have_output(/error: .*username.*system/)
end
+ # Runner.Validate.username.
+ it "fails with more than 255 usernames" do
+ use_fixture '0085-all-the-username.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*username.*too many/)
+ end
end
end
context "package specifications" do