Whamcloud - gitweb
b=14242 test_6g fails when b_release_1_6_4 is run on Cray XT3
[fs/lustre-release.git] / lustre / tests / sanity-benchmark.sh
index 46aa92f..ca97c75 100644 (file)
@@ -59,9 +59,11 @@ test_dbench() {
     
     $DEBUG_OFF
     myUID=$RUNAS_ID
+    myGID=$RUNAS_GID
     myRUNAS=$RUNAS
-    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
-    chown $myUID:$myUID $DBENCHDIR
+    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myGID $myRUNAS || \
+      { myRUNAS="" && myUID=$UID && myGID=`id -g $USER`; }
+    chown $myUID:$myGID $DBENCHDIR
     local duration=""
     [ "$SLOW" = "no" ] && duration=" -t 120"
     if [ "$SLOW" != "no" -o $DB_THREADS -eq 1 ]; then
@@ -92,10 +94,12 @@ test_bonnie() {
     log "min OST has ${MIN}kB available, using ${SIZE}kB file size"
     $DEBUG_OFF
     myUID=$RUNAS_ID
+    myGID=$RUNAS_GID
     myRUNAS=$RUNAS
-    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
-    chown $myUID:$myUID $BONDIR                
-    $myRUNAS bonnie++ -f -r 0 -s$((SIZE / 1024)) -n 10 -u$myUID:$myUID -d$BONDIR
+    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myGID $myRUNAS || \
+      { myRUNAS="" && myUID=$UID && myGID=`id -$USER`; }
+    chown $myUID:$myGID $BONDIR                
+    $myRUNAS bonnie++ -f -r 0 -s$((SIZE / 1024)) -n 10 -u$myUID:$myGID -d$BONDIR
     $DEBUG_ON
 }
 run_test bonnie "bonnie++"
@@ -122,9 +126,11 @@ test_iozone() {
                # $SPACE was calculated with all OSTs
     $DEBUG_OFF
     myUID=$RUNAS_ID
+    myGID=$RUNAS_GID
     myRUNAS=$RUNAS
-    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
-    chown $myUID:$myUID $IOZDIR
+    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myGID $myRUNAS || \
+        { myRUNAS="" && myUID=$UID && myGID=`id -g $USER`; }
+    chown $myUID:$myGID $IOZDIR
     $myRUNAS iozone $IOZONE_OPTS -s $SIZE -f $IOZFILE 2>&1 | tee $IOZLOG
     tail -1 $IOZLOG | grep -q complete || \
        { error "iozone (1) failed" && return 1; }