From 18cc44ca7d014cc358c739d347b715cd0999e81b Mon Sep 17 00:00:00 2001 From: Nils Carlson Date: Fri, 4 Mar 2011 16:08:39 +0100 Subject: [PATCH] test: fix the valgrind test-case to not hang if valgrind crashes In previous version of the test-case the test-case would hang forever if valgrind crashes (which it does on my debian squeeze PPC). Fix this by checking that valgrind is alive. Also cleanup leftover fifos in /tmp Signed-off-by: Nils Carlson --- tests/valgrind_ust-consumerd.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/valgrind_ust-consumerd.sh b/tests/valgrind_ust-consumerd.sh index 5b348d7..856808b 100755 --- a/tests/valgrind_ust-consumerd.sh +++ b/tests/valgrind_ust-consumerd.sh @@ -45,6 +45,14 @@ VALG_OUT=/tmp/ust-testsuite-$USER-valg.txt export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TESTDIR/../libustconsumer/.libs/" valgrind --suppressions=$TESTDIR/valgrind_suppress.txt -q $UST_CONSUMERD --pidfile "$pidfilepath" -o "$TRACE_DIR" >/dev/null 2>"$VALG_OUT" & VALG_PID=$! + +# Paranoid check that valgrind is alive or we will hang forever on the fifo +if ! ps $VALG_PID > /dev/null; then + echo "Valgrind appears to have died, giving up" + rm $pidfilepath + exit +fi + UST_CONSUMERD_PID="$(<$pidfilepath)" okx $USTTRACE -L -s $TESTDIR/basic/.libs/basic @@ -61,3 +69,5 @@ else diag "$REPLY" done fi + +rm $pidfilepath -- 2.34.1