naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ac3a84
From 1d41d2789bb67f5909d6974d2fd916e462a0a5cf Mon Sep 17 00:00:00 2001
ac3a84
From: Franck Bui <fbui@suse.com>
ac3a84
Date: Fri, 4 Nov 2022 12:24:10 +0100
ac3a84
Subject: [PATCH] tests: make test-execute pass on openSUSE
ac3a84
ac3a84
In my understanding user group "3" (aka "sys") is kept for historical reasons
ac3a84
but not really useful these days. That's probably explained why this group
ac3a84
isn't defined on openSUSE.
ac3a84
ac3a84
Hence let's drop reference to this user group, this shouldn't lessen the
ac3a84
revelance of the test since SupplementaryGroups= is still tested with 2 other
ac3a84
groups.
ac3a84
ac3a84
(cherry picked from commit d723b0467d7b8c5c772086d5352442f3fca4368d)
ac3a84
ac3a84
Related #2138081
ac3a84
---
ac3a84
 test/test-execute/exec-dynamicuser-supplementarygroups.service | 3 +--
ac3a84
 ...plementarygroups-multiple-groups-default-group-user.service | 3 +--
ac3a84
 .../exec-supplementarygroups-multiple-groups-withgid.service   | 3 +--
ac3a84
 .../exec-supplementarygroups-multiple-groups-withuid.service   | 3 +--
ac3a84
 4 files changed, 4 insertions(+), 8 deletions(-)
ac3a84
ac3a84
diff --git a/test/test-execute/exec-dynamicuser-supplementarygroups.service b/test/test-execute/exec-dynamicuser-supplementarygroups.service
ac3a84
index fb0b57bc00..53ba0ec7cb 100644
ac3a84
--- a/test/test-execute/exec-dynamicuser-supplementarygroups.service
ac3a84
+++ b/test/test-execute/exec-dynamicuser-supplementarygroups.service
ac3a84
@@ -5,7 +5,6 @@ Description=Test DynamicUser with SupplementaryGroups=
ac3a84
 [Service]
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "1" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "2" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
-ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "3" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 Type=oneshot
ac3a84
 DynamicUser=yes
ac3a84
-SupplementaryGroups=1 2 3
ac3a84
+SupplementaryGroups=1 2
ac3a84
diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service b/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
ac3a84
index 362e539287..4cb0326320 100644
ac3a84
--- a/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
ac3a84
+++ b/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
ac3a84
@@ -6,7 +6,6 @@ Description=Test for Supplementary Group with multiple groups without Group and
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "%G" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "1" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "2" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
-ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "3" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "%G" && test "$$(id -u)" = "%U"'
ac3a84
 Type=oneshot
ac3a84
-SupplementaryGroups=1 2 3
ac3a84
+SupplementaryGroups=1 2
ac3a84
diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service b/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service
ac3a84
index ff3fdc8142..e11743d754 100644
ac3a84
--- a/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service
ac3a84
+++ b/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service
ac3a84
@@ -5,8 +5,7 @@ Description=Test for Supplementary Group with multiple groups and Group=1
ac3a84
 [Service]
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "1" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "2" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
-ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "3" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "%U"'
ac3a84
 Type=oneshot
ac3a84
 Group=1
ac3a84
-SupplementaryGroups=1 2 3
ac3a84
+SupplementaryGroups=1 2
ac3a84
diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service b/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service
ac3a84
index f35ff84765..3efbbfb0f9 100644
ac3a84
--- a/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service
ac3a84
+++ b/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service
ac3a84
@@ -5,7 +5,6 @@ Description=Test for Supplementary Group with multiple groups and Uid=1
ac3a84
 [Service]
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "1" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "2" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
-ExecStart=/bin/sh -x -c 'HAVE=0; for g in $$(id -G); do test "$$g" = "3" && HAVE=1; done; test "$$HAVE" -eq 1'
ac3a84
 Type=oneshot
ac3a84
 User=1
ac3a84
-SupplementaryGroups=1 2 3
ac3a84
+SupplementaryGroups=1 2