tests: fix shellcheck warning in plugins/src.ctf.lttng-live/test_live
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2020 19:29:28 +0000 (14:29 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 14:10:00 +0000 (09:10 -0500)
commitdb4cb7f1eaa5ed259eb5b99b902f2495b3e6ab4b
treebb6b18735406123dc83000710b90826dced42df3
parent26ab3283d424ba2cdd78f770920e290c2c01d878
tests: fix shellcheck warning in plugins/src.ctf.lttng-live/test_live

shellcheck says:

    In test_live line 143:
            if ! "$BT_TESTS_BT2_BIN" $cli_args 1>"$cli_stdout_file" 2>"$cli_stderr_file"; then
                                     ^-------^ SC2086: Double quote to prevent globbing and word splitting.

    Did you mean:
            if ! "$BT_TESTS_BT2_BIN" "$cli_args" 1>"$cli_stdout_file" 2>"$cli_stderr_file"; then

In this case, we do want to pass the $cli_args string as multiple
arguments, so we don't want to just double-quote it.  Circumvent the
warning by splitting it explicitly into an array, then passing the array
using array expansion.  I think this is clearer anyway, as it shows the
intent of splitting the arguments more explicitly than relying in the
implicit splitting done by the shell.

Also, change it to use bt_cli, instead of running the babeltrace binary
by hand.

Change-Id: Idd277fc792e9a426213932566c3c096a53b56d9e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3140
Tested-by: jenkins <jenkins@lttng.org>
tests/plugins/src.ctf.lttng-live/test_live
This page took 0.024267 seconds and 4 git commands to generate.