From cc9180d338c75cec14e09b83ca647bcf57d04cbb Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 14 Feb 2025 21:56:39 +1100 Subject: [PATCH] ZTS: zfs-tests: use configured FILEDIR for all temp paths The default file vdevs, constrained binpath and temporary runfiles were all explicitly places in /var/tmp. Instead, put them under FILEDIR, which is set from -d and defaults to /var/tmp. TEST_BASE_DIR is also initialised from FILEDIR, which means all data for the run will now end up under the operator-specified data dir. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Reviewed-by: Igor Kozhukhov --- scripts/zfs-tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh index 2906d7344..e158b5eb0 100755 --- a/scripts/zfs-tests.sh +++ b/scripts/zfs-tests.sh @@ -152,7 +152,7 @@ cleanup_all() { else TEST_LOOPBACKS=$("${LOSETUP}" -a | awk -F: '/file-vdev/ {print $1}') fi - TEST_FILES=$(ls "${FILEDIR}"/file-vdev* /var/tmp/file-vdev* 2>/dev/null) + TEST_FILES=$(ls "${FILEDIR}"/file-vdev* 2>/dev/null) msg msg "--- Cleanup ---" @@ -308,8 +308,8 @@ constrain_path() { # Special case links for zfs test suite utilities create_links "$CMD_DIR/tests/zfs-tests/cmd" "$ZFSTEST_FILES" else - # Constrained path set to /var/tmp/constrained_path.* - SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXXXX} + # Constrained path set to $FILEDIR/constrained_path.* + SYSTEMDIR=${SYSTEMDIR:-$FILEDIR/constrained_path.XXXXXX} STF_PATH=$(mktemp -d "$SYSTEMDIR") STF_PATH_REMOVE="yes" STF_MISSING_BIN="" @@ -492,7 +492,7 @@ if [ -n "$SINGLETEST" ]; then if [ -n "$TAGS" ]; then fail "-t and -T are mutually exclusive." fi - RUNFILE_DIR="/var/tmp" + RUNFILE_DIR="$FILEDIR" RUNFILES="zfs-tests.$$.run" [ -n "$QUIET" ] && SINGLEQUIET="True" || SINGLEQUIET="False"