Skip to content

Commit

Permalink
Eliminate trailing spaces in DISKS
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Issue openzfs#6900
  • Loading branch information
dweeezil authored and behlendorf committed Apr 14, 2018
1 parent 93b43af commit 5c596ba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/zfs-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand All @@ -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
Expand Down

0 comments on commit 5c596ba

Please sign in to comment.