]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add more tests for SupplementaryGroups=
authorDjalal Harouni <tixxdz@opendz.org>
Mon, 17 Oct 2016 08:06:18 +0000 (10:06 +0200)
committerDjalal Harouni <tixxdz@opendz.org>
Sun, 23 Oct 2016 21:27:16 +0000 (23:27 +0200)
Makefile.am
src/test/test-execute.c
test/test-execute/exec-supplementarygroups-single-group-user.service [new file with mode: 0644]
test/test-execute/exec-supplementarygroups-single-group.service [new file with mode: 0644]

index 0debd3896452b18d22a2da871b7c55263a46a58b..c49edef7b28adab64f22fb1a5adbaac4e36ceaf5 100644 (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 \
index cda035c6e7d8bbc87ce9f778a73ae6f8bc14fe59..1254ef8a05422a29b00d4c8cefb99e802be9a392 100644 (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) {
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 (file)
index 0000000..ed6276d
--- /dev/null
@@ -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 (file)
index 0000000..ee502b3
--- /dev/null
@@ -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