Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | #!/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 |
| 5 | rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock |
| 6 | |
| 7 | COREUTILSLIB=@libdir@/coreutils |
| 8 | LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log" |
| 9 | USERNAME="tester" |
| 10 | groupadd ugroup1 |
| 11 | groupadd ugroup2 |
| 12 | useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already exists" |
| 13 | |
| 14 | su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG} |
| 15 | userdel $USERNAME |
| 16 | groupdel ugroup1 |
| 17 | groupdel ugroup2 |