summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2016-11-02 23:02:28 +0100
committerDjalal Harouni <tixxdz@opendz.org>2016-11-03 08:38:28 +0100
commit5c67067f0e521aba061904c7bb3aa092281ef9c4 (patch)
tree06c31a1f0806304cf51f67c65745fdb6958563c8
parent2b9ac11ed96f2823972a77fc7cb0c32981218429 (diff)
test: test DynamicUser= with SupplementaryGroups=
-rw-r--r--Makefile.am1
-rw-r--r--src/test/test-execute.c1
-rw-r--r--test/test-execute/exec-dynamicuser-supplementarygroups.service8
3 files changed, 10 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 3226ea4549..f7652c2346 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 \
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index aa5a9f1695..6029853e3e 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -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) {
diff --git a/test/test-execute/exec-dynamicuser-supplementarygroups.service b/test/test-execute/exec-dynamicuser-supplementarygroups.service
new file mode 100644
index 0000000000..a47b7fab78
--- /dev/null
+++ b/test/test-execute/exec-dynamicuser-supplementarygroups.service
@@ -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