hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
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