test: add more tests for SupplementaryGroups=

This commit is contained in:
Djalal Harouni 2016-10-17 10:06:18 +02:00
parent 86b838eaa3
commit bf9ace96fc
4 changed files with 21 additions and 0 deletions

View file

@ -1628,6 +1628,8 @@ EXTRA_DIST += \
test/test-execute/exec-group.service \
test/test-execute/exec-group-nfsnobody.service \
test/test-execute/exec-supplementarygroups.service \
test/test-execute/exec-supplementarygroups-single-group.service \
test/test-execute/exec-supplementarygroups-single-group-user.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

@ -220,6 +220,8 @@ static void test_exec_group(Manager *m) {
static void test_exec_supplementary_groups(Manager *m) {
test(m, "exec-supplementarygroups.service", 0, CLD_EXITED);
test(m, "exec-supplementarygroups-single-group.service", 0, CLD_EXITED);
test(m, "exec-supplementarygroups-single-group-user.service", 0, CLD_EXITED);
}
static void test_exec_environment(Manager *m) {

View file

@ -0,0 +1,9 @@
[Unit]
Description=Test for Supplementary Group with only one group and uid 1
[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -G)" = "1" && test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
Type=oneshot
User=1
Group=1
SupplementaryGroups=1

View file

@ -0,0 +1,8 @@
[Unit]
Description=Test for Supplementary Group with only one group
[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -G)" = "1" && test "$$(id -g)" = "1" && test "$$(id -u)" = "0"'
Type=oneshot
Group=1
SupplementaryGroups=1