diff options
Diffstat (limited to 'tests/basic/gfapi/libgfapi-fini-hang.t')
-rwxr-xr-x | tests/basic/gfapi/libgfapi-fini-hang.t | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/basic/gfapi/libgfapi-fini-hang.t b/tests/basic/gfapi/libgfapi-fini-hang.t index 8bbeb848122..7c939872574 100755 --- a/tests/basic/gfapi/libgfapi-fini-hang.t +++ b/tests/basic/gfapi/libgfapi-fini-hang.t @@ -3,7 +3,7 @@ . $(dirname $0)/../../include.rc function check_process () { - pgrep libgfapi-fini-hang + ps -p $1 if [ $? -eq 1 ] ; then echo "Y" else @@ -21,16 +21,18 @@ EXPECT 'Created' volinfo_field $V0 'Status'; TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; +logdir=`gluster --print-logdir` + TEST build_tester -lgfapi $(dirname $0)/libgfapi-fini-hang.c -o $M0/libgfapi-fini-hang TEST cd $M0 - ./libgfapi-fini-hang $H0 $V0 & -lpid=$! + ./libgfapi-fini-hang $H0 $V0 $logdir/libgfapi-fini-hang.log & +PID=$! # check if the process "libgfapi-fini-hang" exits with in $PROCESS_UP_TIMEOUT -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Y' check_process +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Y' check_process $PID # Kill the process if present -TEST ! kill -9 $lpid +TEST ! kill -9 $PID TEST rm -f $M0/libgfapi-fini-hang |