Tests: same event name with different descriptor on load
[lttng-tools.git] / tests / regression / tools / save-load / test_load
index 4d79185781aa0792e102bb36b3c15ebca7e98070..b9a3412ac967b0809ba3b07887ae29034bad3796 100755 (executable)
@@ -29,7 +29,7 @@ EVENT_NAME="tp:tptest"
 
 DIR=$(readlink -f $TESTDIR)
 
 
 DIR=$(readlink -f $TESTDIR)
 
-NUM_TESTS=28
+NUM_TESTS=30
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -50,6 +50,8 @@ function test_basic_load()
 function test_complex_load()
 {
        local sess="$SESSION_NAME-complex"
 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
        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
        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
        destroy_lttng_session_ok $sess
 
        stop_lttng_relayd
This page took 0.023688 seconds and 4 git commands to generate.