Eliminate trailing spaces in DISKS

The zfs-tests.sh driver script could add spaces to the end of $DISKS
which defeates shell-based parsing with constructs such as ${DISKS##* }.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #6900
This commit is contained in:
Tim Chase 2018-01-03 15:45:35 -06:00 committed by Brian Behlendorf
parent 93b43af10d
commit 5c596ba7a4
1 changed files with 10 additions and 2 deletions

View File

@ -505,7 +505,11 @@ if [ -z "${DISKS}" ]; then
[ -f "$TEST_FILE" ] && fail "Failed file exists: ${TEST_FILE}"
truncate -s "${FILESIZE}" "${TEST_FILE}" ||
fail "Failed creating: ${TEST_FILE} ($?)"
DISKS="$DISKS$TEST_FILE "
if [[ "$DISKS" ]]; then
DISKS="$DISKS $TEST_FILE"
else
DISKS="$TEST_FILE"
fi
done
#
@ -522,7 +526,11 @@ if [ -z "${DISKS}" ]; then
fail "Failed: ${TEST_FILE} -> ${TEST_LOOPBACK}"
LOOPBACKS="${LOOPBACKS}${TEST_LOOPBACK} "
BASELOOPBACKS=$(basename "$TEST_LOOPBACK")
DISKS="$DISKS$BASELOOPBACKS "
if [[ "$DISKS" ]]; then
DISKS="$DISKS $BASELOOPBACKS"
else
DISKS="$BASELOOPBACKS"
fi
done
fi
fi