From: Jinshan Xiong Date: Thu, 22 Jan 2015 20:52:12 +0000 (-0800) Subject: LU-6095 tests: define TRUNCATE program for racer X-Git-Tag: 2.6.94~23 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=26cf2a21efc668081a08b4efe0a8a719cb2df40c;p=fs%2Flustre-release.git LU-6095 tests: define TRUNCATE program for racer In file_truncate.sh of racer, TRUNCATE was not defined for remote clients. Let it point to tests/truncate in case it's not defined. The same thing happens to MCREATE and LFS, fix them also and do some cleanup. Test-Parameters: alwaysuploadlogs testlist=racer Signed-off-by: Jinshan Xiong Change-Id: Ie6898f1573bd19810a2d8f14dc0aa375d3774e08 Reviewed-on: http://review.whamcloud.com/13501 Reviewed-by: Jian Yu Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index a1694d5..cf699cd 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -58,7 +58,7 @@ test_1() { local rpids="" for rdir in $RDIRS; do do_nodes $clients "DURATION=$DURATION MDSCOUNT=$MDSCOUNT \ - $racer $rdir $NUM_RACER_THREADS" & + LFS=$LFS $racer $rdir $NUM_RACER_THREADS" & pid=$! rpids="$rpids $pid" done diff --git a/lustre/tests/racer/dir_create.sh b/lustre/tests/racer/dir_create.sh index a280e0a..9bd72f9 100755 --- a/lustre/tests/racer/dir_create.sh +++ b/lustre/tests/racer/dir_create.sh @@ -7,7 +7,7 @@ create(){ echo "asdf" > $DIR/$file/$file/$file } -while /bin/true ; do +while /bin/true ; do file=$((RANDOM % MAX)) mkdir -p $DIR/$file/$file/ 2> /dev/null create 2> /dev/null diff --git a/lustre/tests/racer/dir_migrate.sh b/lustre/tests/racer/dir_migrate.sh index 190da48..e95e346 100755 --- a/lustre/tests/racer/dir_migrate.sh +++ b/lustre/tests/racer/dir_migrate.sh @@ -3,13 +3,13 @@ DIR=$1 MAX=$2 -MDTCOUNT=${MDSCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c MDT)} +MDTCOUNT=${MDSCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c MDT)} while /bin/true ; do migrate_dir=$((RANDOM % MAX)) file=$((RANDOM % MAX)) mdt_idx=$((RANDOM % MDTCOUNT)) mkdir -p $DIR/$migrate_dir 2> /dev/null - lfs mv -M$mdt_idx $DIR/$migrate_dir 2> /dev/null + $LFS mv -M$mdt_idx $DIR/$migrate_dir 2> /dev/null touch $DIR/$migrate_dir/$file 2> /dev/null $LFS getdirstripe $DIR/$migrate_dir > /dev/null 2>&1 done diff --git a/lustre/tests/racer/dir_remote.sh b/lustre/tests/racer/dir_remote.sh index 1bc9c3a..6c3132c 100755 --- a/lustre/tests/racer/dir_remote.sh +++ b/lustre/tests/racer/dir_remote.sh @@ -3,13 +3,13 @@ DIR=$1 MAX=$2 -MDTCOUNT=${MDSCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c MDT)} +MDTCOUNT=${MDSCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c MDT)} 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 + # $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 diff --git a/lustre/tests/racer/file_concat.sh b/lustre/tests/racer/file_concat.sh index 8dde304..de194b8 100755 --- a/lustre/tests/racer/file_concat.sh +++ b/lustre/tests/racer/file_concat.sh @@ -9,7 +9,7 @@ concat(){ } -while /bin/true ; do +while /bin/true ; do file=$((RANDOM % MAX)) new_file=$((RANDOM % MAX)) concat 2> /dev/null diff --git a/lustre/tests/racer/file_create.sh b/lustre/tests/racer/file_create.sh index e615365..875c056 100755 --- a/lustre/tests/racer/file_create.sh +++ b/lustre/tests/racer/file_create.sh @@ -4,15 +4,15 @@ DIR=$1 MAX=$2 MAX_MB=${RACER_MAX_MB:-8} -OSTCOUNT=${OSTCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c OST)} +OSTCOUNT=${OSTCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c OST)} -while /bin/true ; do +while /bin/true; do file=$((RANDOM % MAX)) # $RANDOM is between 0 and 32767, and we want $blockcount in 64kB units blockcount=$((RANDOM * MAX_MB / 32 / 64)) stripecount=$((RANDOM % (OSTCOUNT + 1))) [ $OSTCOUNT -gt 0 ] && - lfs setstripe -c $stripecount $DIR/$file 2> /dev/null + $LFS setstripe -c $stripecount $DIR/$file 2> /dev/null dd if=/dev/zero of=$DIR/$file bs=64k count=$blockcount 2> /dev/null done diff --git a/lustre/tests/racer/file_list.sh b/lustre/tests/racer/file_list.sh index 44a3e5f..1d6b80c 100755 --- a/lustre/tests/racer/file_list.sh +++ b/lustre/tests/racer/file_list.sh @@ -3,7 +3,7 @@ DIR=$1 MAX=$2 -while /bin/true ; do +while /bin/true ; do ls -R $DIR/ > /dev/null 2> /dev/null & ls -R $DIR/ > /dev/null 2> /dev/null & ls -R $DIR/ > /dev/null 2> /dev/null & diff --git a/lustre/tests/racer/file_mknod.sh b/lustre/tests/racer/file_mknod.sh index 25992d9..0695743 100755 --- a/lustre/tests/racer/file_mknod.sh +++ b/lustre/tests/racer/file_mknod.sh @@ -3,6 +3,8 @@ DIR=$1 MAX=$2 +MCREATE=${MCREATE:-$LUSTRE/tests/mcreate} + while true; do file=$DIR/$((RANDOM % MAX)) $MCREATE $file 2> /dev/null diff --git a/lustre/tests/racer/file_rename.sh b/lustre/tests/racer/file_rename.sh index a4ef5b8..1f0919f 100755 --- a/lustre/tests/racer/file_rename.sh +++ b/lustre/tests/racer/file_rename.sh @@ -3,7 +3,7 @@ DIR=$1 MAX=$2 -while /bin/true ; do +while /bin/true ; do file=$((RANDOM % MAX)) new_file=$((RANDOM % MAX)) mv $DIR/$file $DIR/$new_file 2> /dev/null diff --git a/lustre/tests/racer/file_rm.sh b/lustre/tests/racer/file_rm.sh index 20d5226..2453c08 100755 --- a/lustre/tests/racer/file_rm.sh +++ b/lustre/tests/racer/file_rm.sh @@ -3,7 +3,7 @@ DIR=$1 MAX=$2 -while /bin/true ; do +while /bin/true ; do file=$((RANDOM % MAX)) rm -rf $DIR/$file 2> /dev/null sleep 1 diff --git a/lustre/tests/racer/file_symlink.sh b/lustre/tests/racer/file_symlink.sh index 187b026..ac5cde0 100755 --- a/lustre/tests/racer/file_symlink.sh +++ b/lustre/tests/racer/file_symlink.sh @@ -3,7 +3,7 @@ DIR=$1 MAX=$2 -while /bin/true ; do +while /bin/true ; do file=$((RANDOM % MAX)) new_file=$((RANDOM % MAX)) ln -s $file $DIR/$new_file 2> /dev/null diff --git a/lustre/tests/racer/file_truncate.sh b/lustre/tests/racer/file_truncate.sh index 1c85e6f..8c19285 100755 --- a/lustre/tests/racer/file_truncate.sh +++ b/lustre/tests/racer/file_truncate.sh @@ -3,6 +3,8 @@ DIR=$1 MAX=$2 +TRUNCATE=${TRUNCATE:-$LUSTRE/tests/truncate} + while true; do file=$DIR/$((RANDOM % MAX)) $TRUNCATE $file $RANDOM 2> /dev/null