X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fcrash%2Ftest_crash;h=8a7bccae51cb342dab2bd2e484d0141e4fb78df1;hp=13909c1bfc04b7fe1d4c55168559240877a72e1a;hb=6c4a91d639747f260ab46decebc50998ef063712;hpb=c02a94c49b5473b218b93fbd9410129c8f8e903b diff --git a/tests/regression/tools/crash/test_crash b/tests/regression/tools/crash/test_crash index 13909c1bf..8a7bccae5 100755 --- a/tests/regression/tools/crash/test_crash +++ b/tests/regression/tools/crash/test_crash @@ -31,6 +31,8 @@ NR_ITER=-1 # Temp file output OUTPUT_DIR=$(mktemp -d) +LAST_APP_PID= + NUM_TESTS=77 source $TESTDIR/utils/utils.sh @@ -48,8 +50,9 @@ function start_test_app() local tmp_file=$(mktemp -u) # Start application with a temporary file. - $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file & + $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file & ret=$? + LAST_APP_PID="${!}" APPS_PID="${APPS_PID} ${!}" ok $ret "Start application to trace" @@ -81,6 +84,7 @@ function stop_test_app() diag "Stopping $p" kill ${p} 2>/dev/null wait ${p} 2>/dev/null + diag "Stopped $p" done } @@ -118,7 +122,7 @@ function test_shm_path_per_pid() diag "Shm: check folder creation and structure" start_test_app - first_app_pid=$APPS_PID + first_app_pid=$LAST_APP_PID shm_session_path=$(find $shm_path -mindepth 1 -maxdepth 1) file_count=$(echo "$shm_session_path"| wc -l) @@ -141,6 +145,7 @@ function test_shm_path_per_pid() diag "Shm: check basic creation of second ust application" start_test_app + second_app_pid=$LAST_APP_PID second_pid_path=$(find $shm_session_path/ust/pid -mindepth 1 -maxdepth 1) ok $? "Pid path exist found $second_pid_path" @@ -150,6 +155,7 @@ function test_shm_path_per_pid() # Stop first test application and check for cleanup stop_test_app "$first_app_pid" + APPS_PID="$second_app_pid" verify_path_dont_exists "$first_pid_path" ok $? "First pid cleanup" @@ -232,7 +238,7 @@ function test_lttng_crash() start_lttng_tracing_ok $session_name # Generate 10 events - $TESTAPP_BIN 10 0 + $TESTAPP_BIN -i 10 -w 0 stop_lttng_tracing_ok crash_recup_count=$($LTTNG_CRASH $shm_path | wc -l) @@ -270,7 +276,7 @@ function test_lttng_crash_extraction() start_lttng_tracing_ok $session_name # Generate 10 events - $TESTAPP_BIN 10 0 + $TESTAPP_BIN -i 10 -w 0 stop_lttng_tracing_ok $LTTNG_CRASH -x $extraction_path $shm_path @@ -366,7 +372,7 @@ function test_lttng_crash_extraction_sigkill() start_lttng_tracing_ok $session_name # Generate 10 events - $TESTAPP_BIN 10 0 + $TESTAPP_BIN -i 10 -w 0 sigstop_lttng_sessiond sigstop_lttng_consumerd @@ -392,8 +398,7 @@ function interrupt_cleanup() { diag "*** Cleaning-up test ***" stop_test_apps - stop_lttng_sessiond - exit 1 + full_cleanup } TESTS=(