From 26313f021227c4faebfa5b4bc098aff94e18a132 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 26 Oct 2015 10:21:05 -0400 Subject: [PATCH] Tests: same event name with different descriptor on load MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Refs #959 Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- .../tools/save-load/load-42-complex.lttng | 14 ++++++++++++++ tests/regression/tools/save-load/test_load | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/regression/tools/save-load/load-42-complex.lttng b/tests/regression/tools/save-load/load-42-complex.lttng index 399d873c1..a80ce5302 100644 --- a/tests/regression/tools/save-load/load-42-complex.lttng +++ b/tests/regression/tools/save-load/load-42-complex.lttng @@ -60,6 +60,20 @@ RANGE 6 + + uevent_same_name_diff_llevel + true + TRACEPOINT + RANGE + 6 + + + uevent_same_name_diff_llevel + false + TRACEPOINT + RANGE + -1 + uevent_disabled false diff --git a/tests/regression/tools/save-load/test_load b/tests/regression/tools/save-load/test_load index 4d7918578..b9a3412ac 100755 --- a/tests/regression/tools/save-load/test_load +++ b/tests/regression/tools/save-load/test_load @@ -29,7 +29,7 @@ EVENT_NAME="tp:tptest" DIR=$(readlink -f $TESTDIR) -NUM_TESTS=28 +NUM_TESTS=30 source $TESTDIR/utils/utils.sh @@ -50,6 +50,8 @@ function test_basic_load() function test_complex_load() { local sess="$SESSION_NAME-complex" + local mi_result="" + local ret=1 diag "Test complex load" # Start relayd with localhost binding. The complex session uses those @@ -80,6 +82,18 @@ function test_complex_load() else fail "Disabled event is loaded in disabled state" fi + + mi_result=$($CURDIR/../mi/extract_xml $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:channels/lttng:channel[lttng:name='chan2']/lttng:events/lttng:event[lttng:name='uevent_disabled']/lttng:enabled/text()") + test $mi_result = "false" + ok $? "Disabled event is loaded in disabled state" + + # Check that uevent_same_name_diff_llevel with log level 6 (TRACE_INFO) is enabled + # This ensure that the state of events with similar name but not same + # descriptor tuple (exclusion,filter,loglevel) is restored correctly. + mi_result=$($CURDIR/../mi/extract_xml $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:channels/lttng:channel[lttng:name='chan2']/lttng:events/lttng:event[lttng:name='uevent_same_name_diff_llevel' and lttng:loglevel='TRACE_INFO']/lttng:enabled/text()") + test $mi_result = "true" + ok $? "Enabled event with same name but different loglevel is in disabled state" + destroy_lttng_session_ok $sess stop_lttng_relayd -- 2.34.1