test: test DynamicUser= with SupplementaryGroups=

This commit is contained in:
Djalal Harouni 2016-11-02 23:02:28 +01:00
parent 2b9ac11ed9
commit 5c67067f0e
3 changed files with 10 additions and 0 deletions

View File

@ -1628,6 +1628,7 @@ EXTRA_DIST += \
test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service \
test/test-execute/exec-dynamicuser-fixeduser.service \
test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service \
test/test-execute/exec-dynamicuser-supplementarygroups.service \
test/test-execute/exec-ignoresigpipe-no.service \
test/test-execute/exec-ignoresigpipe-yes.service \
test/test-execute/exec-personality-x86-64.service \

View File

@ -262,6 +262,7 @@ static void test_exec_supplementary_groups(Manager *m) {
static void test_exec_dynamic_user(Manager *m) {
test(m, "exec-dynamicuser-fixeduser.service", 0, CLD_EXITED);
test(m, "exec-dynamicuser-fixeduser-one-supplementarygroup.service", 0, CLD_EXITED);
test(m, "exec-dynamicuser-supplementarygroups.service", 0, CLD_EXITED);
}
static void test_exec_environment(Manager *m) {

View File

@ -0,0 +1,8 @@
[Unit]
Description=Test DynamicUser with SupplementaryGroups=
[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -G | cut -d " " --complement -f 1)" = "1 2 3"'
Type=oneshot
DynamicUser=yes
SupplementaryGroups=1 2 3