Skip to content

Commit

Permalink
Bug fixes for single test runs in zfs-tests
Browse files Browse the repository at this point in the history
Correctly remove the temporary runfile after the
single test is run.

Cleanup and setup scripts are relative to the
test suite's location, correct how we look for
those scripts.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5844
  • Loading branch information
dinatale2 authored and behlendorf committed Mar 1, 2017
1 parent ec0e24c commit d25534f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/zfs-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ find_runfile() {
usage() {
cat << EOF
USAGE:
$0 [hvqxkf] [-s SIZE] [-r RUNFILE]
$0 [hvqxkf] [-s SIZE] [-r RUNFILE] [-t PATH] [-u USER]
DESCRIPTION:
ZFS Test Suite launch script
Expand All @@ -169,7 +169,7 @@ OPTIONS:
-d DIR Use DIR for files and loopback devices
-s SIZE Use vdevs of SIZE (default: 4G)
-r RUNFILE Run tests in RUNFILE (default: linux.run)
-t PATH Run single test at PATH
-t PATH Run single test at PATH relative to test suite
-u USER Run single test as USER (default: root)
EXAMPLES:
Expand Down Expand Up @@ -264,11 +264,11 @@ EOF
SETUPSCRIPT=
CLEANUPSCRIPT=

if [ -f "$SINGLETESTDIR/setup.ksh" ]; then
if [ -f "$STF_SUITE/$SINGLETESTDIR/setup.ksh" ]; then
SETUPSCRIPT="setup"
fi

if [ -f "$SINGLETESTDIR/cleanup.ksh" ]; then
if [ -f "$STF_SUITE/$SINGLETESTDIR/cleanup.ksh" ]; then
CLEANUPSCRIPT="cleanup"
fi

Expand Down Expand Up @@ -409,7 +409,7 @@ RESULT=$?
echo

if [ ${#SINGLETEST[@]} -ne 0 ]; then
rm -f "$RUNFILEDIR/$RUNFILE" &>/dev/null
rm -f "$RUNFILE" &>/dev/null
fi

exit ${RESULT}

0 comments on commit d25534f

Please sign in to comment.