Skip to content

Commit 1341f74

Browse files
nabijaczleweliandrewc12
authored andcommitted
scripts: zfs-tests: fix setup script detection when ran with -t /absolute
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#13259
1 parent badce92 commit 1341f74

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

scripts/zfs-tests.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,7 @@ if [ -n "$SINGLETEST" ]; then
446446
fi
447447
RUNFILE_DIR="/var/tmp"
448448
RUNFILES="zfs-tests.$$.run"
449-
SINGLEQUIET="False"
450-
451-
if [ -n "$QUIET" ]; then
452-
SINGLEQUIET="True"
453-
fi
449+
[ -n "$QUIET" ] && SINGLEQUIET="True" || SINGLEQUIET="False"
454450

455451
cat >"${RUNFILE_DIR}/${RUNFILES}" << EOF
456452
[DEFAULT]
@@ -464,18 +460,13 @@ post =
464460
outputdir = /var/tmp/test_results
465461
EOF
466462
SINGLETESTDIR="${SINGLETEST%/*}"
467-
SINGLETESTFILE="${SINGLETEST##*/}"
468-
SETUPSCRIPT=
469-
CLEANUPSCRIPT=
470463

471-
if [ -f "$STF_SUITE/$SINGLETESTDIR/setup.ksh" ]; then
472-
SETUPSCRIPT="setup"
473-
fi
474-
475-
if [ -f "$STF_SUITE/$SINGLETESTDIR/cleanup.ksh" ]; then
476-
CLEANUPSCRIPT="cleanup"
477-
fi
464+
SETUPDIR="$SINGLETESTDIR"
465+
[ "${SETUPDIR#/}" = "$SETUPDIR" ] && SETUPDIR="$STF_SUITE/$SINGLETESTDIR"
466+
[ -x "$SETUPDIR/setup.ksh" ] && SETUPSCRIPT="setup" || SETUPSCRIPT=
467+
[ -x "$SETUPDIR/cleanup.ksh" ] && CLEANUPSCRIPT="cleanup" || CLEANUPSCRIPT=
478468

469+
SINGLETESTFILE="${SINGLETEST##*/}"
479470
cat >>"${RUNFILE_DIR}/${RUNFILES}" << EOF
480471
481472
[$SINGLETESTDIR]

0 commit comments

Comments
 (0)