Refactor: test: wrapper for enable_ust_lttng_channel
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 23 Apr 2015 21:22:36 +0000 (17:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 26 Jun 2015 21:14:47 +0000 (17:14 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/mi/test_mi
tests/regression/tools/save-load/test_save
tests/regression/ust/test_event_basic
tests/regression/ust/test_event_perf
tests/utils/utils.sh

index 620b53cf778cbcc96b6ff5e07e3910d14cb56080..6ec2760cd0f3cd6a4614f0cdec86938d1abbab3f 100755 (executable)
@@ -246,20 +246,20 @@ function test_ust_channel ()
 
        #Test the enable_channel command
        OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
-       enable_ust_lttng_channel $session_name ${channel_name[0]}
+       enable_ust_lttng_channel_ok $session_name ${channel_name[0]}
        $XML_VALIDATE $OUTPUT_DEST
        ok $? "Mi test: enable ust channel xsd validation"
        is_command_success $OUTPUT_DEST false
 
        #Expect the command to fail
-       enable_ust_lttng_channel $session_name ${channel_name[0]} true
+       enable_ust_lttng_channel_fail $session_name ${channel_name[0]}
        $XML_VALIDATE $OUTPUT_DEST
        ok $? "Mi test: fail enable ust channel xsd validation"
        is_command_success $OUTPUT_DEST true
 
        #Create two ust channel to test multiple disable
        for (( i = 1; i < 3; i++ )); do
-               enable_ust_lttng_channel $session_name ${channel_name[$i]}
+               enable_ust_lttng_channel_ok $session_name ${channel_name[$i]}
        done
 
        #Test the disable_channel command
@@ -301,7 +301,7 @@ function test_ust_lttng_event ()
        #Test build up
        OUTPUT_DEST=$DEVNULL
        create_lttng_session_ok $session_name $OUTPUT_DIR
-       enable_ust_lttng_channel $session_name $channel_name
+       enable_ust_lttng_channel_ok $session_name $channel_name
 
        OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
        #Test the enable event for ust domain
@@ -373,7 +373,7 @@ function test_list_channel ()
        #Test buid up
        OUTPUT_DEST=$DEVNULL
        create_lttng_session_ok $session_name $OUTPUT_DIR
-       enable_ust_lttng_channel $session_name $channel_name
+       enable_ust_lttng_channel_ok $session_name $channel_name
 
        #Enable ust and jul events
        concat_event=$( IFS=$','; echo "${event[*]}" )
@@ -402,7 +402,7 @@ function test_list_channel ()
 
        #Add a channel and make sure we have 2 channel now
        OUTPUT_DEST=$DEVNULL
-       enable_ust_lttng_channel $session_name $channel_name"a"
+       enable_ust_lttng_channel_ok $session_name $channel_name"a"
 
        #Teardown
        OUTPUT_DEST=$DEVNULL
@@ -420,7 +420,7 @@ function test_list_domain ()
        #Test buid up
        OUTPUT_DEST=$DEVNULL
        create_lttng_session_ok $session_name $OUTPUT_DIR
-       enable_ust_lttng_channel $session_name $channel_name
+       enable_ust_lttng_channel_ok $session_name $channel_name
 
        #Enable ust and jul events
        concat_event=$( IFS=$','; echo "${event[*]}" )
@@ -468,7 +468,7 @@ function test_list_session ()
        #Test buid up
        OUTPUT_DEST=$DEVNULL
        create_lttng_session_ok $session_name $OUTPUT_DIR
-       enable_ust_lttng_channel $session_name $channel_name
+       enable_ust_lttng_channel_ok $session_name $channel_name
 
        #Enable ust and jul events
        concat_event=$( IFS=$','; echo "${event[*]}" )
@@ -556,7 +556,7 @@ function test_start_stop () {
 
        #Enable a channel to test success
        OUTPUT_DEST=$DEVNULL
-       enable_ust_lttng_channel $session_name $channel_name
+       enable_ust_lttng_channel_ok $session_name $channel_name
 
        #Start tracing
        OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
index abb2c5684e9ea08cb65ec11a24f09a51ef58e42a..2994c9f6c695b6d121be04877b4e00eb76236c48 100755 (executable)
@@ -66,7 +66,7 @@ function test_basic_save()
        diag "Test basic save"
 
        create_lttng_session_ok $SESSION_NAME $TRACE_PATH
-       enable_ust_lttng_channel $SESSION_NAME $CHANNEL_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
 
        lttng_save $SESSION_NAME "-o $TRACE_PATH"
@@ -84,9 +84,9 @@ function test_basic_save_all()
        create_lttng_session_ok $SESSION_NAME-2 $TRACE_PATH
        create_lttng_session_ok $SESSION_NAME-3 $TRACE_PATH
 
-       enable_ust_lttng_channel $SESSION_NAME-1 $CHANNEL_NAME
-       enable_ust_lttng_channel $SESSION_NAME-2 $CHANNEL_NAME
-       enable_ust_lttng_channel $SESSION_NAME-3 $CHANNEL_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME-1 $CHANNEL_NAME
+       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
@@ -108,7 +108,7 @@ function test_overwrite()
        diag "Test overwrite session file"
 
        create_lttng_session_ok $SESSION_NAME $TRACE_PATH
-       enable_ust_lttng_channel $SESSION_NAME $CHANNEL_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
 
        lttng_save $SESSION_NAME "-o $TRACE_PATH"
@@ -119,7 +119,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 $SESSION_NAME $CHANNEL_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
 
        # This one MUST fail
index 2b043ef0dafba08201e4bfa7238845a060676dc4..90be0e972e0d7f2cec81669237528071da1084d9 100755 (executable)
@@ -71,8 +71,8 @@ function test_event_basic()
        create_lttng_session_ok $SESSION_NAME $TRACE_PATH
        create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
 
-       enable_ust_lttng_channel $SESSION_NAME $CHAN_NAME
-       enable_ust_lttng_channel $SESSION_NAME2 $CHAN_NAME2
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
 
        enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
        enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME2 $CHAN_NAME
index a2131a0db2ab9b1bd4b186789e4838140beb034c..478ffb4e6f34e96b16889eb1eb7799eb273ae2d7 100755 (executable)
@@ -60,7 +60,7 @@ function test_event_basic()
 
        create_lttng_session_ok $SESSION_NAME $TRACE_PATH
 
-       enable_ust_lttng_channel $SESSION_NAME $CHAN_NAME
+       enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
 
        enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
 
index 12dabc52ccd87a9bbd17372511186198fdcd0790..f44a7376f2a46ae0212a36c3f690447597db1808 100644 (file)
@@ -393,15 +393,15 @@ function create_lttng_session_fail ()
 }
 
 
-function enable_ust_lttng_channel()
+function enable_ust_lttng_channel ()
 {
-       local sess_name=$1
-       local channel_name=$2
-       local expect_fail=$3
+       local expect_fail=$1
+       local sess_name=$2
+       local channel_name=$3
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -u $channel_name -s $sess_name >$OUTPUT_DEST
        ret=$?
-       if [[ $expect_fail ]]; then
+       if [[ $expect_fail -eq "1" ]]; then
                test "$ret" -ne "0"
                ok $? "Expected fail on ust channel creation $channel_name in $sess_name"
        else
@@ -409,6 +409,16 @@ function enable_ust_lttng_channel()
        fi
 }
 
+function enable_ust_lttng_channel_ok ()
+{
+       enable_ust_lttng_channel 0 "$@"
+}
+
+function enable_ust_lttng_channel_fail ()
+{
+       enable_ust_lttng_channel 1 "$@"
+}
+
 function disable_ust_lttng_channel()
 {
        local sess_name=$1
This page took 0.031228 seconds and 4 git commands to generate.