]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: adapt TEST-21-SYSUSERS for SUSE
authorElisei Roca <eroca@suse.de>
Wed, 29 Jul 2020 20:03:58 +0000 (22:03 +0200)
committerElisei Roca <eroca@suse.de>
Mon, 3 Aug 2020 14:32:14 +0000 (16:32 +0200)
test/TEST-21-SYSUSERS/test.sh

index 2992beaa0b88213775bce9618860d3d7be42e132..3b37f7eaa626bb4e4c8bfff1c9934626cb3923f4 100755 (executable)
@@ -22,8 +22,9 @@ 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)
+    [[ -e /etc/login.defs ]] && login_defs_file="/etc/login.defs" || login_defs_file="/usr/etc/login.defs"
+    SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' $login_defs_file)
+    SYSTEM_GID_MAX=$(awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' $login_defs_file)
 
     # 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