summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/fixtures/0215-usergroups-length.installfile7
-rw-r--r--tests/spec/validator_spec.rb5
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/fixtures/0215-usergroups-length.installfile b/tests/fixtures/0215-usergroups-length.installfile
new file mode 100644
index 0000000..433b83d
--- /dev/null
+++ b/tests/fixtures/0215-usergroups-length.installfile
@@ -0,0 +1,7 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+username awilfox
+usergroups awilfox rootbindaemonsysadmttydisklpmemkmem,wheel,floppy,mail,news,uucp,man,cron
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 37a2542..121ee22 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -1224,6 +1224,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*usergroups.*required/)
end
+ it "doesn't allow a group name longer than maximum" do
+ use_fixture '0215-usergroups-length.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*usergroups.*exceeds maximum length/)
+ end
it "correctly errors when only a , is given" do
use_fixture '0106-usergroups-comma.installfile'
run_validate