From: Elisei Roca Date: Wed, 29 Jul 2020 20:03:58 +0000 (+0200) Subject: test: adapt TEST-21-SYSUSERS for SUSE X-Git-Tag: v247-rc1~454^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef8b52c657848af5b4abba24995837382af295db;p=thirdparty%2Fsystemd.git test: adapt TEST-21-SYSUSERS for SUSE --- diff --git a/test/TEST-21-SYSUSERS/test.sh b/test/TEST-21-SYSUSERS/test.sh index 2992beaa0b8..3b37f7eaa62 100755 --- a/test/TEST-21-SYSUSERS/test.sh +++ b/test/TEST-21-SYSUSERS/test.sh @@ -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