Whamcloud - gitweb
b=14242 test_6g fails when b_release_1_6_4 is run on Cray XT3
authorElena Gryaznova <grev@sun.com>
Fri, 20 Aug 2010 16:47:22 +0000 (20:47 +0400)
committerMikhail Pershin <tappro@sun.com>
Fri, 20 Aug 2010 18:27:07 +0000 (22:27 +0400)
i=Andreas.Dilger

lustre/tests/cfg/local.sh
lustre/tests/replay-vbr.sh
lustre/tests/sanity-benchmark.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh

index 3d4845c..4bee2a5 100644 (file)
@@ -114,10 +114,12 @@ DIR2=${DIR2:-$MOUNT2}
 if [ $UID -ne 0 ]; then
         log "running as non-root uid $UID"
         RUNAS_ID="$UID"
+        RUNAS_GID=`id -g $USER`
         RUNAS=""
 else
         RUNAS_ID=${RUNAS_ID:-500}
-        RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
+        RUNAS_GID=${RUNAS_GID:-$RUNAS_ID}
+        RUNAS=${RUNAS:-"runas -u $RUNAS_ID -g $RUNAS_GID"}
 fi
 
 PDSH=${PDSH:-no_dsh}
index 92ee205..29d47ee 100644 (file)
@@ -261,7 +261,7 @@ test_4a() { # former test_0h
 
     do_node $CLIENT1 mcreate $file
     pre=$(get_version $CLIENT1 $file)
-    do_node $CLIENT1 chown $RUNAS_ID $file
+    do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
     post=$(get_version $CLIENT1 $file)
     if (($pre == $post)); then
         error "version not changed: pre $pre, post $post"
@@ -276,7 +276,7 @@ test_4b() { # former test_0i
 
     do_node $CLIENT1 mcreate $file
     pre=$(get_version $CLIENT1 $file)
-    do_node $CLIENT1 chown :$RUNAS_ID $file
+    do_node $CLIENT1 chgrp $RUNAS_GID $file
     post=$(get_version $CLIENT1 $file)
     if (($pre == $post)); then
         error "version not changed: pre $pre, post $post"
@@ -295,8 +295,8 @@ test_4c() { # former test_0j
     do_node $CLIENT1 mcreate $file
 
     replay_barrier $SINGLEMDS
-    do_node $CLIENT2 chown :$RUNAS_ID $MOUNT2/$tfile
-    do_node $CLIENT1 chown $RUNAS_ID $file
+    do_node $CLIENT2 chgrp $RUNAS_GID $MOUNT2/$tfile
+    do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
     zconf_umount $CLIENT2 $MOUNT2
     facet_failover $SINGLEMDS
 
@@ -318,8 +318,8 @@ test_4d() { # former test_0k
     do_node $CLIENT1 mcreate $file
 
     replay_barrier $SINGLEMDS
-    do_node $CLIENT2 chown $RUNAS_ID $MOUNT2/$tfile
-    do_node $CLIENT1 chown :$RUNAS_ID $file
+    do_node $CLIENT2 chown $RUNAS_ID:$RUNAS_GID $MOUNT2/$tfile
+    do_node $CLIENT1 chgrp $RUNAS_GID $file
     zconf_umount $CLIENT2 $MOUNT2
     facet_failover $SINGLEMDS
 
@@ -356,7 +356,7 @@ test_4f() { # former test_0m
     do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
 
     replay_barrier $SINGLEMDS
-    do_node $CLIENT2 chown :$RUNAS_ID $MOUNT2/$tfile
+    do_node $CLIENT2 chgrp $RUNAS_GID $MOUNT2/$tfile
     do_node $CLIENT1 chmod 666 $file
     zconf_umount $CLIENT2 $MOUNT2
     facet_failover $SINGLEMDS
@@ -1008,11 +1008,11 @@ test_10b() { # former test_2b
     replay_barrier $SINGLEMDS
     do_node $CLIENT1 chmod 666 $DIR/$tfile-a            # R
     do_node $CLIENT2 chmod 666 $DIR1/$tfile-b           # R
-    do_node $CLIENT2 chown :$RUNAS_ID $DIR2/$tfile-a    # U
-    do_node $CLIENT1 chown $RUNAS_ID $DIR/$tfile-a      # J
+    do_node $CLIENT2 chgrp $RUNAS_GID $DIR2/$tfile-a    # U
+    do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-a      # J
     do_node $CLIENT2 truncate $DIR2/$tfile-b 1          # U
-    do_node $CLIENT2 chown :$RUNAS_ID $DIR1/$tfile-b    # R
-    do_node $CLIENT1 chown $RUNAS_ID $DIR/$tfile-b      # R
+    do_node $CLIENT2 chgrp $RUNAS_GID $DIR1/$tfile-b    # R
+    do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-b      # R
     zconf_umount $CLIENT2 $MOUNT2
     facet_failover $SINGLEMDS
 
@@ -1038,7 +1038,7 @@ test_10b() { # former test_2b
 
     do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$UID -g \\\#$UID \
             $DIR1/$tfile-a || error "$DIR/$tfile-a: unexpected state"
-    do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$RUNAS_ID -g \\\#$RUNAS_ID \
+    do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$RUNAS_ID -g \\\#$RUNAS_GID \
             $DIR1/$tfile-b || error "$DIR/$tfile-b: unexpected state"
 
     zconf_umount $CLIENT2 $MOUNT1
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; }
index cf816a4..5ccee9b 100755 (executable)
@@ -127,7 +127,7 @@ rm -rf $DIR/[Rdfs][0-9]*
 # $RUNAS_ID may get set incorrectly somewhere else
 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
 
-check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
+check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
 
 build_test_filter
 
@@ -301,16 +301,16 @@ test_6g() {
         $RUNAS mkdir $DIR/d6g/d || error
         chmod g+s $DIR/d6g/d || error
         mkdir $DIR/d6g/d/subdir
-       $CHECKSTAT -g \#$RUNAS_ID $DIR/d6g/d/subdir || error
+       $CHECKSTAT -g \#$RUNAS_GID $DIR/d6g/d/subdir || error
 }
 run_test 6g "Is new dir in sgid dir inheriting group?"
 
 test_6h() { # bug 7331
        [ $RUNAS_ID -eq $UID ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
        touch $DIR/f6h || error "touch failed"
-       chown $RUNAS_ID:$RUNAS_ID $DIR/f6h || error "initial chown failed"
-       $RUNAS -G$RUNAS_ID chown $RUNAS_ID:0 $DIR/f6h && error "chown worked"
-       $CHECKSTAT -t file -u \#$RUNAS_ID -g \#$RUNAS_ID $DIR/f6h || error
+       chown $RUNAS_ID:$RUNAS_GID $DIR/f6h || error "initial chown failed"
+       $RUNAS -G$RUNAS_GID chown $RUNAS_ID:0 $DIR/f6h && error "chown worked"
+       $CHECKSTAT -t file -u \#$RUNAS_ID -g \#$RUNAS_GID $DIR/f6h || error
 }
 run_test 6h "$RUNAS chown RUNAS_ID.0 .../f6h (should return error)"
 
@@ -562,13 +562,13 @@ run_test 21 "write to dangling link ============================"
 test_22() {
        WDIR=$DIR/$tdir
        mkdir -p $WDIR
-       chown $RUNAS_ID $WDIR
+       chown $RUNAS_ID:$RUNAS_GID $WDIR
        (cd $WDIR || error "cd $WDIR failed";
        $RUNAS tar cf - /etc/hosts /etc/sysconfig/network | \
        $RUNAS tar xf -)
        ls -lR $WDIR/etc || error "ls -lR $WDIR/etc failed"
        $CHECKSTAT -t dir $WDIR/etc || error "checkstat -t dir failed"
-       $CHECKSTAT -u \#$RUNAS_ID $WDIR/etc || error "checkstat -u failed"
+       $CHECKSTAT -u \#$RUNAS_ID -g \#$RUNAS_GID $WDIR/etc || error "checkstat -u failed"
 }
 run_test 22 "unpack tar archive as non-root user ==============="
 
@@ -3335,14 +3335,14 @@ test_56q() {
 
        setup_56 $NUMFILES $NUMDIRS
 
-       chgrp $RUNAS_ID $TDIR/file* || error "chown $DIR/${tdir}g/file$i failed"
+       chgrp $RUNAS_GID $TDIR/file* || error "chown $DIR/${tdir}g/file$i failed"
        EXPECTED=$NUMFILES
-       NUMS="`$LFIND -gid $RUNAS_ID $TDIR | wc -l`"
+       NUMS="`$LFIND -gid $RUNAS_GID $TDIR | wc -l`"
        [ $NUMS -eq $EXPECTED ] || \
                error "lfs find -gid $TDIR wrong: found $NUMS, expected $EXPECTED"
 
        EXPECTED=$(( ($NUMFILES+1) * $NUMDIRS + 1))
-       NUMS="`$LFIND ! -gid $RUNAS_ID $TDIR | wc -l`"
+       NUMS="`$LFIND ! -gid $RUNAS_GID $TDIR | wc -l`"
        [ $NUMS -eq $EXPECTED ] || \
                error "lfs find ! -gid $TDIR wrong: found $NUMS, expected $EXPECTED"
 
@@ -3847,7 +3847,7 @@ test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly
        [ "$RUNAS_ID" = "$UID" ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
 
         # Check that testing environment is properly set up. Skip if not
-        FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_ID $RUNAS || {
+        FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_GID $RUNAS || {
                 skip_env "User $RUNAS_ID does not exist - skipping"
                 return 0
         }
index dcb2fe9..a4cbd2c 100644 (file)
@@ -65,7 +65,7 @@ rm -rf $DIR1/[df][0-9]* $DIR1/lnk
 # $RUNAS_ID may get set incorrectly somewhere else
 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
 
-check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
+check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
 
 build_test_filter
 
@@ -473,13 +473,13 @@ test_25() {
        chmod 0755 $DIR1/$tdir/f1 || error "chmod 0755 $DIR1/$tdir/f1"
 
        $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #1"
-       setfacl -m u:$RUNAS_ID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #1"
+       setfacl -m u:$RUNAS_ID:--- -m g:$RUNAS_GID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #1"
        $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #2"
-       setfacl -m u:$RUNAS_ID:r-x $DIR1/$tdir || error "setfacl $DIR2/$tdir #2"
+       setfacl -m u:$RUNAS_ID:r-x -m g:$RUNAS_GID:r-x $DIR1/$tdir || error "setfacl $DIR2/$tdir #2"
        $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #3"
-       setfacl -m u:$RUNAS_ID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #3"
+       setfacl -m u:$RUNAS_ID:--- -m g:$RUNAS_GID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #3"
        $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #4"
-       setfacl -x u:$RUNAS_ID: $DIR1/$tdir || error "setfacl $DIR2/$tdir #4"
+       setfacl -x u:$RUNAS_ID: -x g:$RUNAS_GID: $DIR1/$tdir || error "setfacl $DIR2/$tdir #4"
        $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #5"
 
        rm -rf $DIR1/$tdir