shadow/tests/subids/71_useradd_subids_for_system/useradd.test
Masatake YAMATO 18b8095a8d tests: add a case for testing -F option of useradd
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-08-01 15:45:10 +02:00

33 lines
545 B
Bash
Executable File

#!/bin/sh
set -e
cd $(dirname $0)
. ../../common/config.sh
. ../../common/log.sh
log_start "$0" "useradd adds subids for system user in /etc/sub[ug]id"
save_config
# restore the files on exit
trap 'log_status "$0" "FAILURE"; restore_config' 0
change_config
echo -n "Add system user foo..."
useradd -r -F foo
echo "OK"
echo -n "Check the /etc/subgid file..."
diff -au data/subgid /etc/subgid
echo "OK"
echo -n "Check the /etc/subuid file..."
diff -au data/subuid /etc/subuid
echo "OK"
log_status "$0" "SUCCESS"
restore_config
trap '' 0