Whamcloud - gitweb
LU-6095 tests: define TRUNCATE program for racer 01/13501/6
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 22 Jan 2015 20:52:12 +0000 (12:52 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Feb 2015 18:30:37 +0000 (18:30 +0000)
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 <jinshan.xiong@intel.com>
Change-Id: Ie6898f1573bd19810a2d8f14dc0aa375d3774e08
Reviewed-on: http://review.whamcloud.com/13501
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
12 files changed:
lustre/tests/racer.sh
lustre/tests/racer/dir_create.sh
lustre/tests/racer/dir_migrate.sh
lustre/tests/racer/dir_remote.sh
lustre/tests/racer/file_concat.sh
lustre/tests/racer/file_create.sh
lustre/tests/racer/file_list.sh
lustre/tests/racer/file_mknod.sh
lustre/tests/racer/file_rename.sh
lustre/tests/racer/file_rm.sh
lustre/tests/racer/file_symlink.sh
lustre/tests/racer/file_truncate.sh

index a1694d5..cf699cd 100644 (file)
@@ -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
index a280e0a..9bd72f9 100755 (executable)
@@ -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
index 190da48..e95e346 100755 (executable)
@@ -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
index 1bc9c3a..6c3132c 100755 (executable)
@@ -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
index 8dde304..de194b8 100755 (executable)
@@ -9,7 +9,7 @@ concat(){
 
 }
 
-while /bin/true ; do 
+while /bin/true ; do
     file=$((RANDOM % MAX))
     new_file=$((RANDOM % MAX))
     concat 2> /dev/null
index e615365..875c056 100755 (executable)
@@ -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
 
index 44a3e5f..1d6b80c 100755 (executable)
@@ -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 &
index 25992d9..0695743 100755 (executable)
@@ -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
index a4ef5b8..1f0919f 100755 (executable)
@@ -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
index 20d5226..2453c08 100755 (executable)
@@ -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
index 187b026..ac5cde0 100755 (executable)
@@ -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
index 1c85e6f..8c19285 100755 (executable)
@@ -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