hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
 
# remove any stale lock files so that the calls to groupadd/useradd don't stop
# the ptest if re-using the same image
rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock
 
COREUTILSLIB=@libdir@/coreutils
LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log"
USERNAME="tester"
groupadd ugroup1
groupadd ugroup2
useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already exists"
 
su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG}
userdel $USERNAME 
groupdel ugroup1
groupdel ugroup2