X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fsnapshots%2Fust_test;h=9dd95bf2bb257569e95da06d084bbeabc736ac56;hb=d4607bc6a5dcc2dff11756ff25c9e67eacd104bc;hp=0a9e244d814b45c2130bbd2e81172d88269290dd;hpb=0154fa5b32aeaa4d2e5c6ae9958e0b0d1e2d38c4;p=lttng-tools.git diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index 0a9e244d8..9dd95bf2b 100755 --- a/tests/regression/tools/snapshots/ust_test +++ b/tests/regression/tools/snapshots/ust_test @@ -27,6 +27,7 @@ TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" NR_ITER=2000000 NR_USEC_WAIT=100 +APPS_PID= NUM_TESTS=76 @@ -52,7 +53,9 @@ function start_test_app() # Start application with a temporary file. $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file & - ok $? "Start application to trace" + ret=$? + APPS_PID="${APPS_PID} ${!}" + ok $ret "Start application to trace" # Wait for the application file to appear indicating that at least one # tracepoint has been fired. @@ -63,13 +66,13 @@ function start_test_app() rm -f $tmp_file } -function stop_test_app() +function stop_test_apps() { - diag "Killing $TESTAPP_NAME" - PID_APP=`pidof $TESTAPP_NAME` - kill $PID_APP >/dev/null 2>&1 - diag "Waiting on $TESTAPP_NAME" - wait + diag "Stopping $TESTAPP_NAME" + for p in ${APPS_PID}; do + kill ${p} + wait ${p} 2>&1 + done } function snapshot_add_output () @@ -172,7 +175,7 @@ function test_ust_local_snapshot () rm -rf $TRACE_PATH fi - stop_test_app + stop_test_apps } function test_ust_local_snapshot_max_size () @@ -220,7 +223,7 @@ function test_ust_local_snapshot_max_size () rm -rf $TRACE_PATH fi - stop_test_app + stop_test_apps } function test_ust_local_snapshot_large_metadata () @@ -282,7 +285,7 @@ function test_ust_per_uid_local_snapshot () rm -rf $TRACE_PATH fi - stop_test_app + stop_test_apps } function test_ust_per_uid_local_snapshot_post_mortem () @@ -296,7 +299,7 @@ function test_ust_per_uid_local_snapshot_post_mortem () # Returns once the application has at least fired ONE tracepoint. start_test_app - stop_test_app + stop_test_apps lttng_snapshot_record $SESSION_NAME stop_lttng_tracing $SESSION_NAME @@ -336,7 +339,7 @@ function test_ust_local_snapshots () stop_lttng_tracing $SESSION_NAME destroy_lttng_session $SESSION_NAME - stop_test_app + stop_test_apps } plan_tests $NUM_TESTS