summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-11-03 09:53:32 -0700
committerTony Hutter <[email protected]>2017-12-06 13:25:40 -0600
commitcf21b5b5b2f2b6bd2ef50686f182108a9aefe8f0 (patch)
tree5f0ca7c217234c4c207d15145895a723cfe17425 /scripts
parent1030f807ba1ded7eeceb3d1dfe950e155a7563f4 (diff)
Allow test-runner to filter test groups by tag
Enable test-runner to accept a list of tags to identify which test groups the user wishes to run. Also allow test-runner to perform multiple iterations of a test run. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Wren Kennedy <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #6788
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/zfs-tests.sh24
1 files changed, 21 insertions, 3 deletions
diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh
index 1d959ae33..147abee0c 100755
--- a/scripts/zfs-tests.sh
+++ b/scripts/zfs-tests.sh
@@ -41,6 +41,8 @@ FILEDIR=${FILEDIR:-/var/tmp}
DISKS=${DISKS:-""}
SINGLETEST=()
SINGLETESTUSER="root"
+TAGS="functional"
+ITERATIONS=1
ZFS_DBGMSG="$STF_SUITE/callbacks/zfs_dbgmsg.ksh"
ZFS_DMESG="$STF_SUITE/callbacks/zfs_dmesg.ksh"
ZFS_MMP="$STF_SUITE/callbacks/zfs_mmp.ksh"
@@ -250,10 +252,13 @@ OPTIONS:
-x Remove all testpools, dm, lo, and files (unsafe)
-k Disable cleanup after test failure
-f Use files only, disables block device tests
+ -c Only create and populate constrained path
+ -I NUM Number of iterations
-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 relative to test suite
+ -T TAGS Comma separated list of tags
-u USER Run single test as USER (default: root)
EXAMPLES:
@@ -270,7 +275,7 @@ $0 -x
EOF
}
-while getopts 'hvqxkfd:s:r:?t:u:' OPTION; do
+while getopts 'hvqxkfcd:s:r:?t:T:u:I:' OPTION; do
case $OPTION in
h)
usage
@@ -295,6 +300,12 @@ while getopts 'hvqxkfd:s:r:?t:u:' OPTION; do
d)
FILEDIR="$OPTARG"
;;
+ I)
+ ITERATIONS="$OPTARG"
+ if [ "$ITERATIONS" -le 0 ]; then
+ fail "Iterations must be greater than 0."
+ fi
+ ;;
s)
FILESIZE="$OPTARG"
;;
@@ -307,6 +318,9 @@ while getopts 'hvqxkfd:s:r:?t:u:' OPTION; do
fi
SINGLETEST+=("$OPTARG")
;;
+ T)
+ TAGS="$OPTARG"
+ ;;
u)
SINGLETESTUSER="$OPTARG"
;;
@@ -496,6 +510,8 @@ msg "LOOPBACKS: $LOOPBACKS"
msg "DISKS: $DISKS"
msg "NUM_DISKS: $NUM_DISKS"
msg "FILESIZE: $FILESIZE"
+msg "ITERATIONS: $ITERATIONS"
+msg "TAGS: $TAGS"
msg "Keep pool(s): $KEEP"
msg "Missing util(s): $STF_MISSING_BIN"
msg ""
@@ -509,8 +525,10 @@ export __ZFS_POOL_EXCLUDE
export TESTFAIL_CALLBACKS
export PATH=$STF_PATH
-msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -i ${STF_SUITE}"
-${TEST_RUNNER} ${QUIET} -c "${RUNFILE}" -i "${STF_SUITE}"
+msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -T ${TAGS} -i ${STF_SUITE}" \
+ "-I ${ITERATIONS}"
+${TEST_RUNNER} ${QUIET} -c "${RUNFILE}" -T "${TAGS}" -i "${STF_SUITE}" \
+ -I "${ITERATIONS}"
RESULT=$?
echo