File 0001-TEST-21-SYSUSERS-adapt-for-openQA.patch of Package systemd-v245-testsuite

From c6b0bbd38c2b5e414c3627c87ca57b73250a226f Mon Sep 17 00:00:00 2001
From: Elisei Roca <eroca@suse.de>
Date: Fri, 24 Apr 2020 11:39:23 +0200
Subject: [PATCH] TEST-21-SYSUSERS: adapt for openQA

---
 test/TEST-21-SYSUSERS/test.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/TEST-21-SYSUSERS/test.sh b/test/TEST-21-SYSUSERS/test.sh
index c4b221af8a..f559866439 100755
--- a/test/TEST-21-SYSUSERS/test.sh
+++ b/test/TEST-21-SYSUSERS/test.sh
@@ -2,6 +2,7 @@
 set -e
 TEST_DESCRIPTION="Sysuser-related tests"
 
+export TEST_BASE_DIR=/var/opt/systemd-tests/test
 . $TEST_BASE_DIR/test-functions
 
 test_setup() {
@@ -22,8 +23,8 @@ preprocess() {
     # see meson.build how to extract this. gcc -E was used before to
     # get this value from config.h, however the autopkgtest fails with
     # it
-    SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs)
-    SYSTEM_GID_MAX=$(awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs)
+    SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /usr/etc/login.defs)
+    SYSTEM_GID_MAX=$(awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /usr/etc/login.defs)
 
     # we can't rely on config.h to get the nologin path, as autopkgtest
     # uses pre-compiled binaries, so extract it from the systemd-sysusers
@@ -124,6 +125,16 @@ test_run() {
             exit 1
         fi
     done
+
+    systemctl --state=failed --no-legend --no-pager > /failed
+    echo SUSEtest OK > /testok
+}
+
+test_cleanup() {
+    _test_cleanup
+    [[ -e /testok ]] && rm /testok
+    [[ -e /failed ]] && rm /failed
+    return 0
 }
 
 do_test "$@"
-- 
2.26.2

openSUSE Build Service is sponsored by