From ba9ea7f53e8957a1b8ced9dae1a184c9041dbb6b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 25 Feb 2020 14:08:47 -0500 Subject: [PATCH] tests: fix shellcheck warnings in plugins/src.ctf.fs/query/test_query_metadata_info Fix: In test_query_metadata_info line 32: this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" ^------------^ SC2034: this_dir_build appears unused. Verify use (or export if used externally). In test_query_metadata_info line 41: local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)" ^---------------------^ SC2155: Declare and assign separately to avoid masking return values. In test_query_metadata_info line 42: local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)" ^---------------------^ SC2155: Declare and assign separately to avoid masking return values. Change-Id: I747d8092bf4625a748afb313b094e6782824c407 Signed-off-by: Simon Marchi Reported-by: shellcheck Reviewed-on: https://review.lttng.org/c/babeltrace/+/3138 Tested-by: jenkins --- tests/plugins/src.ctf.fs/query/test_query_metadata_info | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/plugins/src.ctf.fs/query/test_query_metadata_info b/tests/plugins/src.ctf.fs/query/test_query_metadata_info index e52e7fa0..3d1e79b1 100755 --- a/tests/plugins/src.ctf.fs/query/test_query_metadata_info +++ b/tests/plugins/src.ctf.fs/query/test_query_metadata_info @@ -29,7 +29,6 @@ fi source "$UTILSSH" this_dir_relative="plugins/src.ctf.fs/query" -this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" succeed_trace_dir="$BT_CTF_TRACES_PATH/succeed" expect_dir="$BT_TESTS_DATADIR/$this_dir_relative" @@ -38,10 +37,13 @@ test_query_metadata_info() { local ret=0 local trace_path="$succeed_trace_dir/$name" local expected_stdout="$expect_dir/metadata-info-$name.expect" - 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 local query=("query" "src.ctf.fs" "metadata-info" "--params" "path=\"$trace_path\"") + 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" \ "${query[@]}" -- 2.34.1