Skip to content

Commit

Permalink
Split argument list, satisfy shellcheck SC2086
Browse files Browse the repository at this point in the history
Split the arguments for ${TEST_RUNNER} across multiple lines for
clarity. Also added quotes in the message to match the invoked command.

Unquoted variables in argument lists are subject to splitting. In this
particular case we can't quote the variable because it is an optional
argument. Use the method suggested in the description linked below,
instead.

The technique is to use an unquoted variable with an alternate value.

https://github.com/koalaman/shellcheck/wiki/SC2086

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: John Kennedy <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #9212
  • Loading branch information
Ryan Moeller authored and behlendorf committed Aug 26, 2019
1 parent 4302698 commit a18f8bc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/zfs-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

PROG=zfs-tests.sh
VERBOSE="no"
QUIET=
QUIET=""
CLEANUP="yes"
CLEANUPALL="no"
LOOPBACK="yes"
Expand Down Expand Up @@ -307,7 +307,7 @@ while getopts 'hvqxkfScn:d:s:r:?t:T:u:I:' OPTION; do
VERBOSE="yes"
;;
q)
QUIET="-q"
QUIET="yes"
;;
x)
CLEANUPALL="yes"
Expand Down Expand Up @@ -602,10 +602,17 @@ REPORT_FILE=$(mktemp -u -t zts-report.XXXX -p "$FILEDIR")
#
# Run all the tests as specified.
#
msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -T ${TAGS} -i ${STF_SUITE}" \
"-I ${ITERATIONS}"
${TEST_RUNNER} ${QUIET} -c "${RUNFILE}" -T "${TAGS}" -i "${STF_SUITE}" \
-I "${ITERATIONS}" 2>&1 | tee "$RESULTS_FILE"
msg "${TEST_RUNNER} ${QUIET:+-q}" \
"-c \"${RUNFILE}\"" \
"-T \"${TAGS}\"" \
"-i \"${STF_SUITE}\"" \
"-I \"${ITERATIONS}\""
${TEST_RUNNER} ${QUIET:+-q} \
-c "${RUNFILE}" \
-T "${TAGS}" \
-i "${STF_SUITE}" \
-I "${ITERATIONS}" \
2>&1 | tee "$RESULTS_FILE"

#
# Analyze the results.
Expand Down

0 comments on commit a18f8bc

Please sign in to comment.