summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-19 19:01:04 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-19 19:26:54 +0000
commit2425a623a2437d21bbc176e9f72cd1523bc47486 (patch)
tree2b46f0f9b5082d0055bf99611e5fd3ba1f767021 /tests
parent9a6aa242d38e5c35ba258b371ce287f40e86572d (diff)
downloadalpine-conf-2425a623a2437d21bbc176e9f72cd1523bc47486.zip
setup-user: add -g option to specify groups
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_user_test23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/setup_user_test b/tests/setup_user_test
index c67f495..d8e6d77 100755
--- a/tests/setup_user_test
+++ b/tests/setup_user_test
@@ -5,7 +5,9 @@ init_tests \
setup_user_usage \
setup_user_fullname \
setup_user_interactive \
- setup_user_interactive_fullname
+ setup_user_interactive_fullname \
+ setup_user_groups_commas \
+ setup_user_groups_spaces
setup_user_usage_body() {
test_usage setup-user
@@ -56,3 +58,22 @@ setup_user_interactive_fullname_body() {
setup-user -f "Joe User" -k none
}
+setup_user_groups_commas_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o match:"addgroup testuser wheel" \
+ -o match:"addgroup testuser audio" \
+ -o match:"addgroup testuser video" \
+ -e empty \
+ setup-user -g wheel,audio,video testuser
+}
+
+setup_user_groups_spaces_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o match:"addgroup testuser wheel" \
+ -o match:"addgroup testuser audio" \
+ -o match:"addgroup testuser video" \
+ -e empty \
+ setup-user -g "wheel audio video" testuser
+}