From: Jonathan Rajotte Date: Fri, 24 Apr 2015 17:50:04 +0000 (-0400) Subject: Refactor: test: wrapper for enable_ust_lttng_event X-Git-Tag: v2.7.0-rc1~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c4926bb5e18ba7916ff2a5d2c70ed6b099643e73;p=lttng-tools.git Refactor: test: wrapper for enable_ust_lttng_event Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh index 6ae8885d0..5010a9136 100644 --- a/tests/regression/tools/health/test_health.sh +++ b/tests/regression/tools/health/test_health.sh @@ -104,7 +104,7 @@ function test_health create_lttng_session_no_output $SESSION_NAME diag "With UST consumer daemons" - enable_ust_lttng_event $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME skip $isroot "Root access is needed. Skipping kernel consumer health check test." "1" || { diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok index add9c0ced..62be3bac3 100755 --- a/tests/regression/tools/health/test_thread_ok +++ b/tests/regression/tools/health/test_thread_ok @@ -79,7 +79,7 @@ function test_thread_ok diag "With UST consumer daemons" create_lttng_session_no_output $SESSION_NAME - enable_ust_lttng_event $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME destroy_lttng_session $SESSION_NAME diff --git a/tests/regression/tools/live/test_lttng_ust b/tests/regression/tools/live/test_lttng_ust index da9bf9e66..177b1f76a 100755 --- a/tests/regression/tools/live/test_lttng_ust +++ b/tests/regression/tools/live/test_lttng_ust @@ -62,7 +62,7 @@ function setup_live_tracing() -U net://localhost >/dev/null 2>&1 ok $? "Create session in live mode with delay $DELAY_USEC" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME } diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index 6ec2760cd..3f5f4b5f5 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -305,13 +305,13 @@ function test_ust_lttng_event () OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE #Test the enable event for ust domain - enable_ust_lttng_event $session_name ${event[0]} $channel_name + enable_ust_lttng_event_ok $session_name ${event[0]} $channel_name $XML_VALIDATE $OUTPUT_DEST ok $? "Mi test: Enable_event for ust domain xsd validation" is_command_success $OUTPUT_DEST false #Try to reenable an enabled event. Should fail - enable_ust_lttng_event $session_name ${event[0]} $channel_name true + enable_ust_lttng_event_fail $session_name ${event[0]} $channel_name $XML_VALIDATE $OUTPUT_DEST ok $? "Mi test: Fail enable_event for ust domain xsd validation" is_command_success $OUTPUT_DEST true @@ -324,7 +324,7 @@ function test_ust_lttng_event () #Event[*] print all the element inside the array with the IFS in between concat_event=$( IFS=$','; echo "${event[*]}" ) - enable_ust_lttng_event $session_name $concat_event $channel_name true + enable_ust_lttng_event_fail $session_name $concat_event $channel_name $XML_VALIDATE $OUTPUT_DEST ok $? "Mi test: Multiple enable ust event with inside fail xsd validation" @@ -377,7 +377,7 @@ function test_list_channel () #Enable ust and jul events concat_event=$( IFS=$','; echo "${event[*]}" ) - enable_ust_lttng_event $session_name $concat_event $channel_name + enable_ust_lttng_event_ok $session_name $concat_event $channel_name #Begin testing OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE @@ -424,7 +424,7 @@ function test_list_domain () #Enable ust and jul events concat_event=$( IFS=$','; echo "${event[*]}" ) - enable_ust_lttng_event $session_name $concat_event $channel_name + enable_ust_lttng_event_ok $session_name $concat_event $channel_name enable_jul_lttng_event $session_name $concat_event $channel_name #Begin testing @@ -472,7 +472,7 @@ function test_list_session () #Enable ust and jul events concat_event=$( IFS=$','; echo "${event[*]}" ) - enable_ust_lttng_event $session_name $concat_event $channel_name + enable_ust_lttng_event_ok $session_name $concat_event $channel_name enable_jul_lttng_event $session_name $concat_event $channel_name #Begin testing diff --git a/tests/regression/tools/save-load/test_save b/tests/regression/tools/save-load/test_save index 2994c9f6c..299776fba 100755 --- a/tests/regression/tools/save-load/test_save +++ b/tests/regression/tools/save-load/test_save @@ -67,7 +67,7 @@ function test_basic_save() create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME lttng_save $SESSION_NAME "-o $TRACE_PATH" @@ -88,9 +88,9 @@ function test_basic_save_all() enable_ust_lttng_channel_ok $SESSION_NAME-2 $CHANNEL_NAME enable_ust_lttng_channel_ok $SESSION_NAME-3 $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME-1 $EVENT_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME-2 $EVENT_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME-3 $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME-1 $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME-2 $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME-3 $EVENT_NAME $CHANNEL_NAME lttng_save "" "-a -o $TRACE_PATH" @@ -109,7 +109,7 @@ function test_overwrite() create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME lttng_save $SESSION_NAME "-o $TRACE_PATH" @@ -120,7 +120,7 @@ function test_overwrite() # Create a new session with same name so we can force the overwrite create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME # This one MUST fail save_lttng_fail $SESSION_NAME "-o $TRACE_PATH" diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming index ef38bd599..3041715ff 100755 --- a/tests/regression/tools/snapshots/test_ust_streaming +++ b/tests/regression/tools/snapshots/test_ust_streaming @@ -91,7 +91,7 @@ function test_ust_default_name_with_del() diag "Test UST snapshot streaming with default name with delete output" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME start_test_app @@ -132,7 +132,7 @@ function test_ust_default_name() diag "Test UST snapshot streaming with default name" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME start_test_app @@ -155,7 +155,7 @@ function test_ust_default_name_custom_uri() diag "Test UST snapshot streaming with default name with custom URL" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME start_test_app @@ -182,7 +182,7 @@ function test_ust_custom_name() diag "Test UST snapshot streaming with custom name" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME start_test_app diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index e839b84bf..61c364f68 100755 --- a/tests/regression/tools/snapshots/ust_test +++ b/tests/regression/tools/snapshots/ust_test @@ -130,7 +130,7 @@ function test_ust_list_output () diag "Test UST snapshot output listing" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME @@ -158,7 +158,7 @@ function test_ust_local_snapshot () diag "Test local UST snapshots" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH @@ -192,7 +192,7 @@ function test_ust_local_snapshot_max_size () enable_mmap_overwrite_subbuf_ust_channel $SESSION_NAME $CHANNEL_NAME $subbuf_size - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME snapshot_add_output $SESSION_NAME "file://$TRACE_PATH" "" $max_size @@ -237,7 +237,7 @@ function test_ust_local_snapshot_large_metadata () diag "Test local UST snapshots with > 4kB metadata" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $LM_EVENT $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $LM_EVENT $CHANNEL_NAME start_lttng_tracing $SESSION_NAME lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH $LM_BIN 1 1 @@ -268,7 +268,7 @@ function test_ust_per_uid_local_snapshot () diag "Test local UST snapshots" create_lttng_session_no_output $SESSION_NAME enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH @@ -294,7 +294,7 @@ function test_ust_per_uid_local_snapshot_post_mortem () diag "Test local UST snapshots post-mortem" create_lttng_session_no_output $SESSION_NAME enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH @@ -319,7 +319,7 @@ function test_ust_local_snapshots () diag "Test $NR_SNAPSHOT local UST snapshots" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME start_lttng_tracing $SESSION_NAME lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits index 9f754713c..f2bf7426c 100755 --- a/tests/regression/tools/streaming/test_high_throughput_limits +++ b/tests/regression/tools/streaming/test_high_throughput_limits @@ -99,7 +99,7 @@ function test_high_throughput { NETWORK_URI="net://localhost" create_lttng_session_with_uri $SESSION_NAME $NETWORK_URI - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME run_apps diag "Waiting for applications to end" diff --git a/tests/regression/tools/streaming/test_ust b/tests/regression/tools/streaming/test_ust index e6a0bb846..51656e4be 100755 --- a/tests/regression/tools/streaming/test_ust +++ b/tests/regression/tools/streaming/test_ust @@ -54,7 +54,7 @@ function test_ust_before_start () diag "Test UST streaming BEFORE tracing starts" lttng_create_session_uri - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME # Run 5 times with a 1 second delay $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} /dev/null 2>&1 & @@ -78,7 +78,7 @@ function test_ust_after_start () diag "Test UST streaming AFTER tracing starts" lttng_create_session_uri - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME # Run 5 times with a 1 second delay diff --git a/tests/regression/ust/before-after/test_before_after b/tests/regression/ust/before-after/test_before_after index 0b2812415..12c5e30bc 100755 --- a/tests/regression/ust/before-after/test_before_after +++ b/tests/regression/ust/before-after/test_before_after @@ -39,7 +39,7 @@ function test_before_apps() { # BEFORE application is spawned create_lttng_session_ok $SESSION_NAME $TRACE_PATH - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & @@ -61,7 +61,7 @@ function test_after_apps() local file_sync_before_last=$(mktemp -u) create_lttng_session_ok $SESSION_NAME $TRACE_PATH - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} & ok $? "Application started in background." diff --git a/tests/regression/ust/buffers-pid/test_buffers_pid b/tests/regression/ust/buffers-pid/test_buffers_pid index b397fc113..dd5b367b1 100755 --- a/tests/regression/ust/buffers-pid/test_buffers_pid +++ b/tests/regression/ust/buffers-pid/test_buffers_pid @@ -54,7 +54,7 @@ test_after_multiple_apps() { # BEFORE application is spawned create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME for i in `seq 1 5`; do @@ -87,7 +87,7 @@ test_before_multiple_apps() { # BEFORE application is spawned create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME for i in `seq 1 5`; do @@ -128,7 +128,7 @@ test_after_app() { # BEFORE application is spawned create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & @@ -154,7 +154,7 @@ test_before_app() { # BEFORE application is spawned create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} & ok $? "Start application to trace" diff --git a/tests/regression/ust/high-throughput/test_high_throughput b/tests/regression/ust/high-throughput/test_high_throughput index dcd2f71a7..41ae6118c 100755 --- a/tests/regression/ust/high-throughput/test_high_throughput +++ b/tests/regression/ust/high-throughput/test_high_throughput @@ -42,7 +42,7 @@ start_lttng_sessiond create_lttng_session_ok $SESSION_NAME $TRACE_PATH -enable_ust_lttng_event $SESSION_NAME $EVENT_NAME +enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME for i in `seq 1 $NR_APP`; do diff --git a/tests/regression/ust/low-throughput/test_low_throughput b/tests/regression/ust/low-throughput/test_low_throughput index 92d739dd4..53299489d 100755 --- a/tests/regression/ust/low-throughput/test_low_throughput +++ b/tests/regression/ust/low-throughput/test_low_throughput @@ -41,7 +41,7 @@ start_lttng_sessiond create_lttng_session_ok $SESSION_NAME $TRACE_PATH -enable_ust_lttng_event $SESSION_NAME $EVENT_NAME +enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME # This is going to take 20 minutes diff --git a/tests/regression/ust/multi-session/test_multi_session b/tests/regression/ust/multi-session/test_multi_session index 63ed54def..c2b7b946b 100755 --- a/tests/regression/ust/multi-session/test_multi_session +++ b/tests/regression/ust/multi-session/test_multi_session @@ -37,7 +37,7 @@ test_multi_session() { # BEFORE application is spawned for i in `seq 0 3`; do create_lttng_session_ok "$SESSION_NAME-$i" "$TRACE_PATH/$i" - enable_ust_lttng_event "$SESSION_NAME-$i" "$EVENT_NAME$i" + enable_ust_lttng_event_ok "$SESSION_NAME-$i" "$EVENT_NAME$i" start_lttng_tracing "$SESSION_NAME-$i" done diff --git a/tests/regression/ust/nprocesses/test_nprocesses b/tests/regression/ust/nprocesses/test_nprocesses index a9b9db276..e5e27226c 100755 --- a/tests/regression/ust/nprocesses/test_nprocesses +++ b/tests/regression/ust/nprocesses/test_nprocesses @@ -70,7 +70,7 @@ TRACE_PATH=$(mktemp -d) create_lttng_session_ok $SESSION_NAME $TRACE_PATH -enable_ust_lttng_event $SESSION_NAME $EVENT_NAME +enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME touch ${file_sync_before_last} diff --git a/tests/regression/ust/overlap/test_overlap b/tests/regression/ust/overlap/test_overlap index 8300fbf7c..ab853f31a 100755 --- a/tests/regression/ust/overlap/test_overlap +++ b/tests/regression/ust/overlap/test_overlap @@ -84,8 +84,8 @@ test_enable_simple_wildcard() diag "Simple wildcard overlap" - enable_ust_lttng_event $SESSION_NAME "$event_wild1" - enable_ust_lttng_event $SESSION_NAME "$event_wild2" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild1" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild2" start_lttng_tracing $SESSION_NAME @@ -417,9 +417,9 @@ test_enable_bad_wildcard() diag "Enable bad wildcard" - enable_ust_lttng_event $SESSION_NAME "$event_wild1" - enable_ust_lttng_event $SESSION_NAME "$event_wild2" - enable_ust_lttng_event $SESSION_NAME "$event_wild3" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild1" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild2" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild3" start_lttng_tracing $SESSION_NAME @@ -439,8 +439,8 @@ test_enable_simple_wildcard_2() diag "Simple wildcard 2" - enable_ust_lttng_event $SESSION_NAME "$event_wild1" - enable_ust_lttng_event $SESSION_NAME "$event_wild2" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild1" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild2" start_lttng_tracing $SESSION_NAME @@ -568,8 +568,8 @@ test_disable_simple_wildcard() diag "Disable simple wildcard" - enable_ust_lttng_event $SESSION_NAME "$event_wild1" - enable_ust_lttng_event $SESSION_NAME "$event_wild2" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild1" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild2" disable_ust_lttng_event $SESSION_NAME "$event_wild1" disable_ust_lttng_event $SESSION_NAME "$event_wild2" @@ -593,8 +593,8 @@ test_disable_wildcard_overlap() diag "Disable wildcard overlap" - enable_ust_lttng_event $SESSION_NAME "$event_wild1" - enable_ust_lttng_event $SESSION_NAME "$event_wild2" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild1" + enable_ust_lttng_event_ok $SESSION_NAME "$event_wild2" disable_ust_lttng_event $SESSION_NAME "$event_wild1" diff --git a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush index cbfe1a9e6..e8f695fed 100755 --- a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush +++ b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush @@ -137,7 +137,7 @@ test_after_app_pid() { create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_metadata_per_pid $SESSION_NAME enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME # Start application after tracing @@ -183,7 +183,7 @@ test_before_app_pid() { create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_metadata_per_pid $SESSION_NAME enable_channel_per_pid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME check_app_tmp_file @@ -226,7 +226,7 @@ test_after_app_uid() { create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_metadata_per_uid $SESSION_NAME enable_channel_per_uid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME # Start application after tracing @@ -272,7 +272,7 @@ test_before_app_uid() { create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_metadata_per_uid $SESSION_NAME enable_channel_per_uid $SESSION_NAME "channel0" - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0" start_lttng_tracing $SESSION_NAME check_app_tmp_file diff --git a/tests/regression/ust/test_event_tracef b/tests/regression/ust/test_event_tracef index f3d00d495..b63ee218c 100755 --- a/tests/regression/ust/test_event_tracef +++ b/tests/regression/ust/test_event_tracef @@ -38,7 +38,7 @@ fi function test_event_tracef() { create_lttng_session_ok $SESSION_NAME $TRACE_PATH - enable_ust_lttng_event $SESSION_NAME $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT diff --git a/tests/regression/ust/test_event_wildcard b/tests/regression/ust/test_event_wildcard index 1090b0ae1..29aceff26 100755 --- a/tests/regression/ust/test_event_wildcard +++ b/tests/regression/ust/test_event_wildcard @@ -39,8 +39,8 @@ function test_event_wildcard() create_lttng_session_ok $SESSION_NAME $TRACE_PATH - enable_ust_lttng_event $SESSION_NAME "$EVENT_NAME" - enable_ust_lttng_event $SESSION_NAME "$EVENT_NAME2" + enable_ust_lttng_event_ok $SESSION_NAME "$EVENT_NAME" + enable_ust_lttng_event_ok $SESSION_NAME "$EVENT_NAME2" start_lttng_tracing stop_lttng_tracing diff --git a/tests/stress/test_multi_sessions_per_uid_10app b/tests/stress/test_multi_sessions_per_uid_10app index bf611d20b..91950be0e 100755 --- a/tests/stress/test_multi_sessions_per_uid_10app +++ b/tests/stress/test_multi_sessions_per_uid_10app @@ -82,7 +82,7 @@ test_stress() check_sessiond enable_channel_per_uid $SESSION_NAME-$a $CHANNEL_NAME check_sessiond - enable_ust_lttng_event $SESSION_NAME-$a $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME-$a $EVENT_NAME check_sessiond start_lttng_tracing $SESSION_NAME-$a check_sessiond diff --git a/tests/stress/test_multi_sessions_per_uid_5app_streaming b/tests/stress/test_multi_sessions_per_uid_5app_streaming index 36a15d92e..ec6d9af29 100755 --- a/tests/stress/test_multi_sessions_per_uid_5app_streaming +++ b/tests/stress/test_multi_sessions_per_uid_5app_streaming @@ -117,7 +117,7 @@ test_stress() enable_channel_per_uid $SESSION_NAME-$a $CHANNEL_NAME check_sessiond check_relayd - enable_ust_lttng_event $SESSION_NAME-$a $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME-$a $EVENT_NAME check_sessiond check_relayd start_lttng_tracing $SESSION_NAME-$a diff --git a/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd b/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd index e01e6aaf8..c3fdeb13d 100755 --- a/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd +++ b/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd @@ -119,7 +119,7 @@ test_stress() enable_channel_per_uid $SESSION_NAME-$a $CHANNEL_NAME check_sessiond check_relayd - enable_ust_lttng_event $SESSION_NAME-$a $EVENT_NAME + enable_ust_lttng_event_ok $SESSION_NAME-$a $EVENT_NAME check_sessiond check_relayd start_lttng_tracing $SESSION_NAME-$a diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index f44a7376f..a8e0e4a07 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -448,10 +448,10 @@ function enable_lttng_mmap_overwrite_ust_channel() function enable_ust_lttng_event () { - local sess_name=$1 - local event_name="$2" - local channel_name=$3 - local expected_to_fail=$4 + local expected_to_fail=$1 + local sess_name=$2 + local event_name="$3" + local channel_name=$4 if [ -z $channel_name ]; then # default channel if none specified @@ -462,7 +462,7 @@ function enable_ust_lttng_event () $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -u >$OUTPUT_DEST ret=$? - if [[ $expected_to_fail ]]; then + if [[ $expected_to_fail -eq "1" ]]; then test $ret -ne "0" ok $? "Enable ust event $event_name for session $session_name on channel $channel_name failed as expected" else @@ -470,6 +470,16 @@ function enable_ust_lttng_event () fi } +function enable_ust_lttng_event_ok () +{ + enable_ust_lttng_event 0 "$@" +} + +function enable_ust_lttng_event_fail () +{ + enable_ust_lttng_event 1 "$@" +} + function enable_jul_lttng_event() { sess_name=$1