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