X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fsnapshots%2Fust_test;h=552eed2312c0abd91b9bbe008368f850ee7e180c;hb=2d68a944ad031d2c52f932c006ae05fa691dda9a;hp=e727aa6349f5075fcf04531374af08b9092c9571;hpb=1d20c959e3aa1a9a205fd7fff2d912b6bada1d23;p=lttng-tools.git diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index e727aa634..552eed231 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,11 +66,14 @@ function start_test_app() rm -f $tmp_file } -function kill_test_app() +function stop_test_apps() { - diag "Killing $TESTAPP_NAME" - PID_APP=`pidof $TESTAPP_NAME` - kill $PID_APP >/dev/null 2>&1 + diag "Stopping $TESTAPP_NAME" + for p in ${APPS_PID}; do + kill ${p} + wait ${p} 2>/dev/null + done + APPS_PID= } function snapshot_add_output () @@ -168,11 +174,9 @@ function test_ust_local_snapshot () if [ $? -eq 0 ]; then # Only delete if successful rm -rf $TRACE_PATH - else - break fi - kill_test_app + stop_test_apps } function test_ust_local_snapshot_max_size () @@ -220,7 +224,7 @@ function test_ust_local_snapshot_max_size () rm -rf $TRACE_PATH fi - kill_test_app + stop_test_apps } function test_ust_local_snapshot_large_metadata () @@ -247,8 +251,6 @@ function test_ust_local_snapshot_large_metadata () if [ $? -eq 0 ]; then # Only delete if successful rm -rf $TRACE_PATH - else - break fi } @@ -282,11 +284,9 @@ function test_ust_per_uid_local_snapshot () if [ $? -eq 0 ]; then # Only delete if successful rm -rf $TRACE_PATH - else - break fi - kill_test_app + stop_test_apps } function test_ust_per_uid_local_snapshot_post_mortem () @@ -300,7 +300,7 @@ function test_ust_per_uid_local_snapshot_post_mortem () # Returns once the application has at least fired ONE tracepoint. start_test_app - kill_test_app + stop_test_apps lttng_snapshot_record $SESSION_NAME stop_lttng_tracing $SESSION_NAME @@ -311,8 +311,6 @@ function test_ust_per_uid_local_snapshot_post_mortem () if [ $? -eq 0 ]; then # Only delete if successful rm -rf $TRACE_PATH - else - break fi } @@ -337,14 +335,12 @@ function test_ust_local_snapshots () if [ $? -eq 0 ]; then # Only delete if successful rm -rf $TRACE_PATH - else - break fi done stop_lttng_tracing $SESSION_NAME destroy_lttng_session $SESSION_NAME - kill_test_app + stop_test_apps } plan_tests $NUM_TESTS