From ef8b52c657848af5b4abba24995837382af295db Mon Sep 17 00:00:00 2001 From: Elisei Roca Date: Wed, 29 Jul 2020 22:03:58 +0200 Subject: [PATCH] test: adapt TEST-21-SYSUSERS for SUSE --- test/TEST-21-SYSUSERS/test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.47.3