From 93ab3c76ca8d7ae1f8f1863768f93fde950c28b1 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 6 Nov 2019 17:52:30 -0600 Subject: tests: Add usergroup group length test --- tests/fixtures/0215-usergroups-length.installfile | 7 +++++++ tests/spec/validator_spec.rb | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 tests/fixtures/0215-usergroups-length.installfile (limited to 'tests') 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 -- cgit v1.2.3-60-g2f50