summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--src/test/test-execute.c2
-rw-r--r--test/test-execute/exec-supplementarygroups-single-group-user.service9
-rw-r--r--test/test-execute/exec-supplementarygroups-single-group.service8
4 files changed, 21 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 0debd38964..c49edef7b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 \
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index cda035c6e7..1254ef8a05 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -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) {
diff --git a/test/test-execute/exec-supplementarygroups-single-group-user.service b/test/test-execute/exec-supplementarygroups-single-group-user.service
new file mode 100644
index 0000000000..ed6276d303
--- /dev/null
+++ b/test/test-execute/exec-supplementarygroups-single-group-user.service
@@ -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
diff --git a/test/test-execute/exec-supplementarygroups-single-group.service b/test/test-execute/exec-supplementarygroups-single-group.service
new file mode 100644
index 0000000000..ee502b3d37
--- /dev/null
+++ b/test/test-execute/exec-supplementarygroups-single-group.service
@@ -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