Refactor: test: wrapper for lttng_snapshot_del_output
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 24 Apr 2015 20:50:39 +0000 (16:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 26 Jun 2015 21:55:58 +0000 (17:55 -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/snapshots/test_kernel_streaming
tests/regression/tools/snapshots/test_ust_streaming
tests/utils/utils.sh

index 89ff4f23f9bc3196b034e97e7f0b45d8799afcd9..a5c7493ed46ec38fa6087638c80df009f0c7efc0 100755 (executable)
@@ -655,7 +655,7 @@ function test_snapshot () {
        ok $? "Mi test: snapshot list extracted snapshot: $result expected: $snapshot_name"
 
        #Test del output
-       lttng_snapshot_del_output $session_name $snapshot_id
+       lttng_snapshot_del_output_ok $session_name $snapshot_id
        $XML_VALIDATE $OUTPUT_DEST
        ok $? "Mi test: snapshot delete xsd validation"
 
@@ -674,7 +674,7 @@ function test_snapshot () {
        ok $? "Mi test: snapshot del extracted snapshot id: $result expected: $session_name"
 
        #Test fail on delete command
-       lttng_snapshot_del_output $session_name $snapshot_id 1
+       lttng_snapshot_del_output_fail $session_name $snapshot_id
        $XML_VALIDATE $OUTPUT_DEST
        ok $? "Mi test: snapshot delete xsd validation"
 
index aa4c5b558af68d095e9dae5902989f37cfa2ce7c..7653bd9f970923d47aea71a5dcd22a96edc5b487 100755 (executable)
@@ -67,7 +67,7 @@ function test_kernel_default_name_with_del()
                return $?
        fi
 
-       lttng_snapshot_del_output $SESSION_NAME 1
+       lttng_snapshot_del_output_ok $SESSION_NAME 1
        snapshot_add_output $SESSION_NAME "net://localhost"
        lttng_snapshot_record $SESSION_NAME
 
index 0ff78fddd4a67b8127935df13981c00a1cb337fe..c412ef71b524531d54f0acce894207109a58cd27 100755 (executable)
@@ -107,7 +107,7 @@ function test_ust_default_name_with_del()
                return $?
        fi
 
-       lttng_snapshot_del_output $SESSION_NAME 1
+       lttng_snapshot_del_output_ok $SESSION_NAME 1
        snapshot_add_output $SESSION_NAME "net://localhost"
        lttng_snapshot_record $SESSION_NAME
 
index 90589271b5cd19ac977acc933245c55fd03e766b..1a8056d020b44240cdc7f9a79802090cabf897dd 100644 (file)
@@ -770,13 +770,13 @@ function lttng_snapshot_add_output_fail ()
 
 function lttng_snapshot_del_output ()
 {
-       local sess_name=$1
-       local id=$2
-       local expected_to_fail=$3
+       local expected_to_fail=$1
+       local sess_name=$2
+       local id=$3
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot del-output -s $sess_name $id >$OUTPUT_DEST
        ret=$?
-       if [[ $expected_to_fail ]]; then
+       if [[ $expected_to_fail -eq "1" ]]; then
                test "$ret" -ne "0"
                ok $? "Expect fail on deletion of snapshot output id $id"
        else
@@ -784,6 +784,16 @@ function lttng_snapshot_del_output ()
        fi
 }
 
+function lttng_snapshot_del_output_ok ()
+{
+       lttng_snapshot_del_output 0 "$@"
+}
+
+function lttng_snapshot_del_output_fail ()
+{
+       lttng_snapshot_del_output 1 "$@"
+}
+
 function lttng_snapshot_record ()
 {
        local sess_name=$1
This page took 0.037222 seconds and 4 git commands to generate.