From de5977c6967e5ff9155c6709373932048df5f3ad Mon Sep 17 00:00:00 2001 From: wang di Date: Mon, 27 Jan 2014 07:20:40 -0800 Subject: [PATCH] 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 --- lustre/tests/test-framework.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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" ] && \ -- 1.8.3.1