tests: fix shellcheck warnings in plugins/src.ctf.fs/succeed/test_succeed
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2020 19:06:14 +0000 (14:06 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 14:10:00 +0000 (09:10 -0500)
Fix the path to utils.sh, so that shellcheck finds it.  Then, fix:

    In test_succeed line 69:
            local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)"
                  ^---------------------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 70:
            local temp_greped_stdout_output_file="$(mktemp -t greped_stdout.XXXXXX)"
                  ^----------------------------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 71:
            local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)"
                  ^---------------------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 103:
            local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)"
                  ^---------------------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 104:
            local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)"
                  ^---------------------^ SC2155: Declare and assign separately to avoid masking return values.

Change-Id: Ia67e0726aa898df7a761a3284fdd2919ac2570e8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reported-by: shellcheck
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3137
Tested-by: jenkins <jenkins@lttng.org>
tests/plugins/src.ctf.fs/succeed/test_succeed

index 63ba2499b39197fe921793334110e57742be1f08..47e45b905b53a531c18e5d8cf9f4093762aebca2 100755 (executable)
@@ -66,9 +66,13 @@ test_packet_end() {
        local ret_stderr
        local details_comp=("-c" "sink.text.details")
        local details_args=("-p" "with-trace-name=no,with-stream-name=no,with-metadata=no,compact=yes")
-       local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)"
-       local temp_greped_stdout_output_file="$(mktemp -t greped_stdout.XXXXXX)"
-       local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)"
+       local temp_stdout_output_file
+       local temp_greped_stdout_output_file
+       local temp_stderr_output_file
+
+       temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)"
+       temp_greped_stdout_output_file="$(mktemp -t greped_stdout.XXXXXX)"
+       temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)"
 
        bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" \
                "$succeed_trace_dir/$name" "${details_comp[@]}" \
@@ -100,8 +104,11 @@ test_force_origin_unix_epoch() {
        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")
-       local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)"
-       local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)"
+       local temp_stdout_output_file
+       local temp_stderr_output_file
+
+       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_dir/$name1" "${src_ctf_fs_args[@]}" \
This page took 0.026782 seconds and 4 git commands to generate.