summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/coreutils/coreutils/run-ptest
blob: 6d4a7b365d4cc7e7f5dd7199052727622448220a (plain)
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