From fd9abd44a6e7fbd7eaaf253713027b7041325797 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 4 Jan 2008 08:33:42 +0000 Subject: [PATCH] Branch b1_6 b=14551 i=grev Fix check_runas_id() in sanity-quota.sh. --- lustre/tests/sanity-quota.sh | 6 +++--- lustre/tests/test-framework.sh | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index bbe8463..b233bf3 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -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 diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 3fe9d39..464b72b 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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." } -- 1.8.3.1