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
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."
}