From ec21ed6e8261ae5c97c8c4c69f3b201f529b09fa Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 20 Oct 2016 09:32:03 -0500 Subject: [PATCH] LU-8739 test: disable DNE in racer for old MDSs In racer.sh add environtmental variables RACER_ENABLE_REMOTE_DIRS, RACER_ENABLE_STRIPED_DIRS, and RACER_ENABLE_MIGRATION to enable or disable the corresponding operations. RACER_ENABLE_REMOTE_DIRS defaults to true only if the MDS version is at least 2.5, while RACER_ENABLE_STRIPED_DIRS and RACER_ENABLE_MIGRATION default to true only if the MDS version is at least 2.8. Signed-off-by: John L. Hammond Change-Id: I88b6350bd5abef4e13055a0a2ab68692367a6a5d Reviewed-on: https://review.whamcloud.com/23273 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu --- lustre/tests/racer.sh | 22 ++++++++++++++++++++-- lustre/tests/racer/dir_remote.sh | 15 ++++++++++----- lustre/tests/racer/racer.sh | 8 ++++++-- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index cf699cd..e1bfa0e 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -26,6 +26,19 @@ CLIENTS=${CLIENTS:-$HOSTNAME} RACERDIRS=${RACERDIRS:-"$DIR $DIR2"} echo RACERDIRS=$RACERDIRS +if ((MDSCOUNT > 1 && + $(lustre_version_code $SINGLEMDS) >= $(version_code 2.8.0))); then + RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-true} + RACER_ENABLE_STRIPED_DIRS=${RACER_ENABLE_STRIPED_DIRS:-true} + RACER_ENABLE_MIGRATION=${RACER_ENABLE_MIGRATION:-true} +elif ((MDSCOUNT > 1 && + $(lustre_version_code $SINGLEMDS) >= $(version_code 2.5.0))); then + RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-true} +fi + +RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-false} +RACER_ENABLE_STRIPED_DIRS=${RACER_ENABLE_STRIPED_DIRS:-false} +RACER_ENABLE_MIGRATION=${RACER_ENABLE_MIGRATION:-false} check_progs_installed $CLIENTS $racer || { skip_env "$racer not found" && exit 0; } @@ -57,8 +70,13 @@ test_1() { local rpids="" for rdir in $RDIRS; do - do_nodes $clients "DURATION=$DURATION MDSCOUNT=$MDSCOUNT \ - LFS=$LFS $racer $rdir $NUM_RACER_THREADS" & + do_nodes $clients "DURATION=$DURATION \ + MDSCOUNT=$MDSCOUNT \ + RACER_ENABLE_REMOTE_DIRS=$RACER_ENABLE_REMOTE_DIRS \ + RACER_ENABLE_STRIPED_DIRS=$RACER_ENABLE_STRIPED_DIRS \ + RACER_ENABLE_MIGRATION=$RACER_ENABLE_MIGRATION \ + LFS=$LFS \ + $racer $rdir $NUM_RACER_THREADS" & pid=$! rpids="$rpids $pid" done diff --git a/lustre/tests/racer/dir_remote.sh b/lustre/tests/racer/dir_remote.sh index 0950625..5e6f197 100755 --- a/lustre/tests/racer/dir_remote.sh +++ b/lustre/tests/racer/dir_remote.sh @@ -9,11 +9,16 @@ while /bin/true ; do remote_dir=$((RANDOM % MAX)) file=$((RANDOM % MAX)) mdt_idx=$((RANDOM % MDTCOUNT)) - # stripe_count in range [1,MDTCOUNT] - # $LFS mkdir treats stripe_count 0 and 1 the same - stripe_count=$(((RANDOM % MDTCOUNT) + 1)) - mkdir -p $DIR 2> /dev/null - $LFS mkdir -i$mdt_idx -c$stripe_count $DIR/$remote_dir 2> /dev/null + + if $RACER_ENABLE_STRIPED_DIRS; then + # stripe_count in range [1,MDTCOUNT] + # $LFS mkdir treats stripe_count 0 and 1 the same + stripe_count_opt="-c$((RANDOM % MDTCOUNT + 1))" + else + stripe_count_opt="" + fi + + $LFS mkdir -i$mdt_idx $stripe_count_opt $DIR/$remote_dir 2> /dev/null touch $DIR/$remote_dir/$file 2> /dev/null $LFS getdirstripe $DIR/$remote_dir > /dev/null 2>&1 done diff --git a/lustre/tests/racer/racer.sh b/lustre/tests/racer/racer.sh index deef18e..cb24051 100755 --- a/lustre/tests/racer/racer.sh +++ b/lustre/tests/racer/racer.sh @@ -16,8 +16,12 @@ RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \ file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \ file_delxattr file_getxattr file_setxattr" -if [ $MDSCOUNT -gt 1 ]; then - RACER_PROGS="${RACER_PROGS} dir_remote dir_migrate" +if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then + RACER_PROGS+=' dir_remote' +fi + +if $RACER_ENABLE_MIGRATION; then + RACER_PROGS+=' dir_migrate' fi racer_cleanup() -- 1.8.3.1