tests/src.ctf.fs: run test_force_origin_unix_epoch succeed test on CTF 1 and CTF...
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 12:41:49 +0000 (08:41 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
Modify test_force_origin_unix_epoch such that it tests with both the CTF
1 and CTF 2 version of the trace.

Change-Id: I356a2c70c10cab2ab4f182649cbbb93debe86e7e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8738
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12754

tests/plugins/src.ctf.fs/succeed/test-succeed.sh

index 7b0960cd14a0a0fe5b8972c7e1b0c57b3b3f801c..124266d8047c8ffe70eed7b295ac5818e4343b43 100755 (executable)
@@ -109,9 +109,6 @@ test_force_origin_unix_epoch() {
        local name1="$1"
        local name2="$2"
        local expected_stdout="$expect_dir/trace-$name1-$name2.expect"
-       local ret=0
-       local ret_stdout
-       local ret_stderr
        local src_ctf_fs_args=("-p" "force-clock-class-origin-unix-epoch=true")
        local details_comp=("-c" "sink.text.details")
        local details_args=("-p" "with-trace-name=no,with-stream-name=no,with-metadata=yes,compact=yes")
@@ -121,33 +118,28 @@ test_force_origin_unix_epoch() {
        temp_stdout_output_file="$(mktemp -t actual-stdout.XXXXXX)"
        temp_stderr_output_file="$(mktemp -t actual-stderr.XXXXXX)"
 
-       bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" \
-               "$(succeed_trace_path "$name1" 1)" "${src_ctf_fs_args[@]}" \
-               "$(succeed_trace_path "$name2" 1)" "${src_ctf_fs_args[@]}" \
-               "${details_comp[@]}" "${details_args[@]}"
-
-       bt_diff "$expected_stdout" "$temp_stdout_output_file"
-       ret_stdout=$?
-
-       if ((ret_stdout != 0)); then
-               ret=1
-       fi
+       for ctf_version in 1 2; do
+               local trace_path
 
-       ok $ret "Trace '$name1' and '$name2' give the expected stdout"
+               trace_1_path=$(succeed_trace_path "$name1" "$ctf_version")
+               trace_2_path=$(succeed_trace_path "$name2" "$ctf_version")
 
-       bt_diff /dev/null "$temp_stderr_output_file"
-       ret_stderr=$?
+               bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" \
+                       "$trace_1_path" "${src_ctf_fs_args[@]}" \
+                       "$trace_2_path" "${src_ctf_fs_args[@]}" \
+                       "${details_comp[@]}" "${details_args[@]}"
 
-       if ((ret_stderr != 0)); then
-               ret=1
-       fi
+               bt_diff "$expected_stdout" "$temp_stdout_output_file"
+               ok $? "Trace '$name1' and '$name2' give the expected stdout"
 
-       ok $ret "Trace '$name1' and '$name2' give the expected stderr"
+               bt_diff /dev/null "$temp_stderr_output_file"
+               ok $? "Trace '$name1' and '$name2' give the expected stderr"
 
-       rm -f "$temp_stdout_output_file" "$temp_stderr_output_file"
+               rm -f "$temp_stdout_output_file" "$temp_stderr_output_file"
+       done
 }
 
-plan_tests 24
+plan_tests 26
 
 test_force_origin_unix_epoch 2packets barectf-event-before-packet
 test_ctf_gen_single simple
This page took 0.025306 seconds and 4 git commands to generate.