Tests: same event name with different descriptor on load
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 26 Oct 2015 14:21:05 +0000 (10:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 16 May 2016 03:23:49 +0000 (23:23 -0400)
Refs #959

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/save-load/load-42-complex.lttng
tests/regression/tools/save-load/test_load

index 399d873c122bb0b8fab869333f79993716a6870c..a80ce5302beea72ae4dc9e893f093f6c5e8ccd0a 100644 (file)
                                                                <loglevel_type>RANGE</loglevel_type>
                                                                <loglevel>6</loglevel>
                                                        </event>
+                                                       <event>
+                                                               <name>uevent_same_name_diff_llevel</name>
+                                                               <enabled>true</enabled>
+                                                               <type>TRACEPOINT</type>
+                                                               <loglevel_type>RANGE</loglevel_type>
+                                                               <loglevel>6</loglevel>
+                                                       </event>
+                                                       <event>
+                                                               <name>uevent_same_name_diff_llevel</name>
+                                                               <enabled>false</enabled>
+                                                               <type>TRACEPOINT</type>
+                                                               <loglevel_type>RANGE</loglevel_type>
+                                                               <loglevel>-1</loglevel>
+                                                       </event>
                                                        <event>
                                                                <name>uevent_disabled</name>
                                                                <enabled>false</enabled>
index 4d79185781aa0792e102bb36b3c15ebca7e98070..b9a3412ac967b0809ba3b07887ae29034bad3796 100755 (executable)
@@ -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
This page took 0.037445 seconds and 4 git commands to generate.