scripts: zfs-tests: fix setup script detection when ran with -t /absolute

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
This commit is contained in:
наб 2022-03-24 14:47:22 +01:00 committed by Brian Behlendorf
parent fbe811b054
commit 22ddc7f5ff

View File

@ -446,11 +446,7 @@ if [ -n "$SINGLETEST" ]; then
fi
RUNFILE_DIR="/var/tmp"
RUNFILES="zfs-tests.$$.run"
SINGLEQUIET="False"
if [ -n "$QUIET" ]; then
SINGLEQUIET="True"
fi
[ -n "$QUIET" ] && SINGLEQUIET="True" || SINGLEQUIET="False"
cat >"${RUNFILE_DIR}/${RUNFILES}" << EOF
[DEFAULT]
@ -464,18 +460,13 @@ post =
outputdir = /var/tmp/test_results
EOF
SINGLETESTDIR="${SINGLETEST%/*}"
SETUPDIR="$SINGLETESTDIR"
[ "${SETUPDIR#/}" = "$SETUPDIR" ] && SETUPDIR="$STF_SUITE/$SINGLETESTDIR"
[ -x "$SETUPDIR/setup.ksh" ] && SETUPSCRIPT="setup" || SETUPSCRIPT=
[ -x "$SETUPDIR/cleanup.ksh" ] && CLEANUPSCRIPT="cleanup" || CLEANUPSCRIPT=
SINGLETESTFILE="${SINGLETEST##*/}"
SETUPSCRIPT=
CLEANUPSCRIPT=
if [ -f "$STF_SUITE/$SINGLETESTDIR/setup.ksh" ]; then
SETUPSCRIPT="setup"
fi
if [ -f "$STF_SUITE/$SINGLETESTDIR/cleanup.ksh" ]; then
CLEANUPSCRIPT="cleanup"
fi
cat >>"${RUNFILE_DIR}/${RUNFILES}" << EOF
[$SINGLETESTDIR]