Whamcloud - gitweb
b=14901
authoryury <yury>
Wed, 16 Apr 2008 08:38:20 +0000 (08:38 +0000)
committeryury <yury>
Wed, 16 Apr 2008 08:38:20 +0000 (08:38 +0000)
r=grev
- fixes using check_runas_id(). Adds check for used runas id in test_72.

lustre/tests/acceptance-small.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index 9551ba6..728be10 100755 (executable)
@@ -103,7 +103,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $DBENCHDIR
                duration=""
                [ "$SLOW" = "no" ] && duration=" -t 120"
@@ -138,7 +138,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $BONDIR             
                $myRUNAS bonnie++ -f -r 0 -s$((SIZE / 1024)) -n 10 -u$myUID:$myUID -d$BONDIR
                $DEBUG_ON
@@ -167,7 +167,7 @@ for NAME in $CONFIGS; do
                $DEBUG_OFF
                myUID=$RUNAS_ID
                myRUNAS=$RUNAS
-               FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+               FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
                chown $myUID:$myUID $IOZDIR
                $myRUNAS iozone $IOZONE_OPTS -f $IOZFILE
                $DEBUG_ON
index b181c5d..9d291c2 100644 (file)
@@ -2959,6 +2959,12 @@ run_test 71 "Running dbench on lustre (don't segment fault) ===="
 test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly
        check_kernel_version 43 || return 0
        [ "$RUNAS_ID" = "$UID" ] && skip "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 || {
+                skip "User $RUNAS_ID does not exist - skipping"
+                return 0
+        }
        touch $DIR/f72
        chmod 777 $DIR/f72
        chmod ug+s $DIR/f72
index b21d661..3b7f839 100644 (file)
@@ -1338,7 +1338,7 @@ is_patchless ()
 }
 
 check_runas_id_ret() {
-    RC=0
+    local myRC=0
     local myRUNAS_ID=$1
     shift
     local myRUNAS=$@
@@ -1348,9 +1348,9 @@ check_runas_id_ret() {
     mkdir $DIR/d0_runas_test
     chmod 0755 $DIR
     chown $myRUNAS_ID:$myRUNAS_ID $DIR/d0_runas_test
-    $myRUNAS touch $DIR/d0_runas_test/f$$ || RC=1
+    $myRUNAS touch $DIR/d0_runas_test/f$$ || myRC=1
     rm -rf $DIR/d0_runas_test
-    return $RC
+    return $myRC
 }
 
 check_runas_id() {