From 610c731b8451870623adec66ea0a8f055f896f35 Mon Sep 17 00:00:00 2001 From: Jan Kurik Date: Wed, 7 Jul 2021 08:39:19 +0200 Subject: [PATCH] Improved cleanup of Sanity/sanity-test Ensure no process is left running as BUILD_USER --- tests/Sanity/sanity-test/runtest.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Sanity/sanity-test/runtest.sh b/tests/Sanity/sanity-test/runtest.sh index 4ec24a3..106f432 100755 --- a/tests/Sanity/sanity-test/runtest.sh +++ b/tests/Sanity/sanity-test/runtest.sh @@ -81,7 +81,13 @@ rlJournalStart rlPhaseEnd rlPhaseStartCleanup - [[ "${del}" == "yes" ]] && rlRun "userdel -r ${BUILD_USER}" + if [[ "${del}" == "yes" ]]; then + rlRun "pkill --signal SIGTERM -u ${BUILD_USER}" 0-255 + sleep 3 + rlRun "pkill --signal SIGKILL -u ${BUILD_USER}" 0-255 + sleep 1 + rlRun "userdel -rf ${BUILD_USER}" 0-255 + fi rlRun "popd" rlRun "rm -r ${TmpDir}" 0 "Removing tmp directory" rlPhaseEnd