From: Jonathan Rajotte Date: Fri, 24 Apr 2015 20:50:39 +0000 (-0400) Subject: Refactor: test: wrapper for lttng_snapshot_del_output X-Git-Tag: v2.7.0-rc1~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=31580dc77773c3319db9d28c22913c91b3325561;p=lttng-tools.git Refactor: test: wrapper for lttng_snapshot_del_output Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index 89ff4f23f..a5c7493ed 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -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" diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming index aa4c5b558..7653bd9f9 100755 --- a/tests/regression/tools/snapshots/test_kernel_streaming +++ b/tests/regression/tools/snapshots/test_kernel_streaming @@ -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 diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming index 0ff78fddd..c412ef71b 100755 --- a/tests/regression/tools/snapshots/test_ust_streaming +++ b/tests/regression/tools/snapshots/test_ust_streaming @@ -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 diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 90589271b..1a8056d02 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -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