From bbb716d3cb71eb69e9b6fb3b6a40be33453ff605 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 25 Feb 2020 14:06:14 -0500 Subject: [PATCH] tests: fix shellcheck warnings in plugins/src.ctf.fs/succeed/test_succeed 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 Reported-by: shellcheck Reviewed-on: https://review.lttng.org/c/babeltrace/+/3137 Tested-by: jenkins --- tests/plugins/src.ctf.fs/succeed/test_succeed | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/plugins/src.ctf.fs/succeed/test_succeed b/tests/plugins/src.ctf.fs/succeed/test_succeed index 63ba2499..47e45b90 100755 --- a/tests/plugins/src.ctf.fs/succeed/test_succeed +++ b/tests/plugins/src.ctf.fs/succeed/test_succeed @@ -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[@]}" \ -- 2.34.1