From: wang di Date: Mon, 27 Jan 2014 15:20:40 +0000 (-0800) Subject: LU-4551 tests: add range support in ONLY X-Git-Tag: 2.5.55~12 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=de5977c6967e5ff9155c6709373932048df5f3ad LU-4551 tests: add range support in ONLY Add range support in ONLY, so we can indicate the range of test cases when running the test. For example ONLY="12-30" sh sanity will run sanity test case 12 until 30. Test-Parameters: allwaysuploadlogs envdefinitions=ONLY="12-20" testlist=sanity Signed-off-by: wang di Change-Id: I4c6dd62f0524ece388ccde3f1e4469a1219f11d2 Reviewed-on: http://review.whamcloud.com/9022 Tested-by: Jenkins Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 0cab0c6..b4a5ade 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4527,10 +4527,16 @@ skip() { build_test_filter() { EXCEPT="$EXCEPT $(testslist_filter)" - [ "$ONLY" ] && log "only running test `echo $ONLY`" - for O in $ONLY; do - eval ONLY_${O}=true - done + for O in $ONLY; do + if [[ $O = [0-9]*-[0-9]* ]]; then + for num in $(seq $(echo $O | tr '-' ' ')); do + eval ONLY_$num=true + done + else + eval ONLY_${O}=true + fi + done + [ "$EXCEPT$ALWAYS_EXCEPT" ] && \ log "excepting tests: `echo $EXCEPT $ALWAYS_EXCEPT`" [ "$EXCEPT_SLOW" ] && \