Do not add a new user, use nobody

This commit is contained in:
Petr Menšík 2025-02-14 23:38:50 +01:00
commit 2acad4c11b

View file

@ -38,7 +38,8 @@
. /usr/share/beakerlib/beakerlib.sh || exit 1
: ${PACKAGE:=bind}
USER="user$RANDOM"
#USER="user$RANDOM"
USER="nobody"
: ${CORES:=auto}
# Limit maximal number of cores used at the same time.
# May cause more failures.
@ -49,7 +50,7 @@ USER="user$RANDOM"
rlJournalStart
rlPhaseStartSetup
rlRun "useradd $USER"
#rlRun "useradd $USER"
rlLog "Available entropy: $(cat /proc/sys/kernel/random/entropy_avail)"
rpm -q perl-Net-DNS-Nameserver || yum install -y perl-Net-DNS-Nameserver
rlLog "`rpm -q perl-Net-DNS-Nameserver`"
@ -265,8 +266,6 @@ rlJournalStart
# Try to fix tssgsig failures on some machines, do not use system kerberos configuration
export KRB5_CONFIG=/dev/null
chmod a+x "$HOME" #running as a USER
chmod a+rX -R $(rpm -E %_builddir)
RHEL9HACK="sudo -u $USER"
set -o pipefail
rlRun "${RHEL9HACK} make ${MAKE_TEST:-test -j$CORES} |& tee $TMPDIR/test.txt" 0-255 "Perform the test, --init-task=/distribution/install/rhel-buildroot is needed"
@ -281,8 +280,8 @@ rlJournalStart
# 9.18.29+ uses pytest to run some tests and generates failed output to different place
pushd bin/tests/system
for TMPDIR in *_tmp_*/; do
FAILED_TESTS+=" $TMPDIR"
for ONETMPDIR in *_tmp_*/; do
FAILED_TESTS+=" $ONETMPDIR"
done
popd
if [ -n "$FAILED_TESTS" ]; then
@ -351,6 +350,7 @@ rlJournalStart
rlServiceRestore "rngd"
rlRun "rm -r $TMPDIR" 0 "Removing tmp directory"
rlRun "rm -rf $FOUNDERROR"
rlRun "userdel -f -r $USER"
rlLog "Build contents: $BIND_BUILD"
#rlRun "userdel -f -r $USER"
rlPhaseEnd
rlJournalEnd