summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 17:52:30 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 17:52:30 -0600
commit93ab3c76ca8d7ae1f8f1863768f93fde950c28b1 (patch)
tree6a906e1eb453b1e9ed3880be330e00c40696449a
parentd799d56fc8505261cda099f402eafbc4fe858ca0 (diff)
downloadhorizon-93ab3c76ca8d7ae1f8f1863768f93fde950c28b1.tar.gz
horizon-93ab3c76ca8d7ae1f8f1863768f93fde950c28b1.tar.bz2
horizon-93ab3c76ca8d7ae1f8f1863768f93fde950c28b1.tar.xz
horizon-93ab3c76ca8d7ae1f8f1863768f93fde950c28b1.zip
tests: Add usergroup group length test
-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