Whamcloud - gitweb
Branch b1_6
authorjohann <johann>
Fri, 4 Jan 2008 08:33:42 +0000 (08:33 +0000)
committerjohann <johann>
Fri, 4 Jan 2008 08:33:42 +0000 (08:33 +0000)
b=14551
i=grev

Fix check_runas_id() in sanity-quota.sh.

lustre/tests/sanity-quota.sh
lustre/tests/test-framework.sh

index bbe8463..b233bf3 100644 (file)
@@ -1043,15 +1043,15 @@ test_14a(){
 
         MISSING_USERS=""
         for i in `seq 1 30`; do
-                check_runas_id_ret quota15_$i
+                check_runas_id_ret quota15_$i "runas -u quota15_$i"
                 if [ "$?" != "0" ]; then
                        MISSING_USERS="$MISSING_USERS quota15_$i"
                 fi
         done
 
         if [ -n "$MISSING_USERS" ]; then
-                echo "following users are missing: $MISSING_USERS, test skipped"
-                return
+                skip "following users are missing: $MISSING_USERS"
+                return 0
         fi
 
         $LFS quotaoff -ug $DIR
index 3fe9d39..464b72b 100644 (file)
@@ -1233,28 +1233,29 @@ is_patchless ()
     grep -q patchless $LPROC/version
 }
 
-check_runas_id() {
+check_runas_id_ret() {
+    RC=0
     local myRUNAS_ID=$1
     shift
     local myRUNAS=$@
+    if [ -z "$myRUNAS" ]; then
+        FAIL_ON_ERROR="true"
+        error "myRUNAS command must be specified for check_runas_id"
+    fi
     mkdir $DIR/d0_runas_test
     chmod 0755 $DIR
     chown $myRUNAS_ID:$myRUNAS_ID $DIR/d0_runas_test
-    $myRUNAS touch $DIR/d0_runas_test/f$$ || \
-        error "unable to write to $DIR/d0_runas_test as UID $myRUNAS_ID. 
-        Please set RUNAS_ID to some UID which exists on MDS and client or 
-        add user $myRUNAS_ID:$myRUNAS_ID on these nodes."
+    $myRUNAS touch $DIR/d0_runas_test/f$$ || RC=1
     rm -rf $DIR/d0_runas_test
+    return $RC
 }
 
-check_runas_id_ret() {
+check_runas_id() {
     local myRUNAS_ID=$1
     shift
     local myRUNAS=$@
-    mkdir $DIR/d0_runas_test
-    chmod 0755 $DIR
-    chown $myRUNAS_ID:$myRUNAS_ID $DIR/d0_runas_test
-    $myRUNAS touch $DIR/d0_runas_test/f$$ || return 1
-    rm -rf $DIR/d0_runas_test
-    return 0
+    check_runas_id_ret $myRUNAS_ID $myRUNAS || \
+        error "unable to write to $DIR/d0_runas_test as UID $myRUNAS_ID. 
+        Please set RUNAS_ID to some UID which exists on MDS and client or 
+        add user $myRUNAS_ID:$myRUNAS_ID on these nodes."
 }