tests: Replace kill_quiet after shutdown with wait_process_gone

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2018-09-27 09:59:14 -04:00
parent b1eb3620e2
commit 4dd376c3b4
14 changed files with 18 additions and 64 deletions

View File

@ -246,10 +246,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile

View File

@ -79,10 +79,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -167,10 +167,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -96,10 +96,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -144,10 +144,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -249,10 +249,8 @@ if [ $? -ne 0 ]; then
cat $logfile
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile
@ -320,8 +318,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile
@ -368,8 +365,7 @@ if [ $? -eq 0 ]; then
exit 1
fi
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -ne 0 ]; then
if ! wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM not running anymore after failed INIT."
echo "TPM Logfile:"
cat $logfile
@ -398,8 +394,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile

View File

@ -256,10 +256,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile

View File

@ -310,10 +310,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
echo "TPM Logfile:"
cat $logfile

View File

@ -140,10 +140,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -114,10 +114,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -60,10 +60,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -ne 0 ]; then
if ! wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM not running anymore after INIT."
exit 1
fi
@ -151,10 +148,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -220,10 +220,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -105,10 +105,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
sleep 0.5
kill_quiet -0 ${SWTPM_PID} 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${SWTPM_PID} 1; then
echo "Error: ${SWTPM_INTERFACE} TPM should not be running anymore."
exit 1
fi

View File

@ -109,9 +109,7 @@ if [ "$res" != "$exp" ]; then
exit 1
fi
sleep 0.2
kill_quiet -0 $PID 2>/dev/null
if [ $? -eq 0 ]; then
if wait_process_gone ${PID} 1; then
echo "Error: TPM should not be running anymore."
exit 1
fi