Whamcloud - gitweb
LU-8739 test: disable DNE in racer for old MDSs 73/23273/2
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 20 Oct 2016 14:32:03 +0000 (09:32 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Dec 2016 05:41:36 +0000 (05:41 +0000)
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 <john.hammond@intel.com>
Change-Id: I88b6350bd5abef4e13055a0a2ab68692367a6a5d
Reviewed-on: https://review.whamcloud.com/23273
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/tests/racer.sh
lustre/tests/racer/dir_remote.sh
lustre/tests/racer/racer.sh

index cf699cd..e1bfa0e 100644 (file)
@@ -26,6 +26,19 @@ CLIENTS=${CLIENTS:-$HOSTNAME}
 RACERDIRS=${RACERDIRS:-"$DIR $DIR2"}
 echo RACERDIRS=$RACERDIRS
 
 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; }
 
 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
 
        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
                pid=$!
                rpids="$rpids $pid"
        done
index 0950625..5e6f197 100755 (executable)
@@ -9,11 +9,16 @@ while /bin/true ; do
        remote_dir=$((RANDOM % MAX))
        file=$((RANDOM % MAX))
        mdt_idx=$((RANDOM % MDTCOUNT))
        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
        touch $DIR/$remote_dir/$file 2> /dev/null
        $LFS getdirstripe $DIR/$remote_dir > /dev/null 2>&1
 done
index deef18e..cb24051 100755 (executable)
@@ -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"
 
 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()
 fi
 
 racer_cleanup()