$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"
$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
$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
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
}
check_runas_id_ret() {
- RC=0
+ local myRC=0
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$$ || RC=1
+ $myRUNAS touch $DIR/d0_runas_test/f$$ || myRC=1
rm -rf $DIR/d0_runas_test
- return $RC
+ return $myRC
}
check_runas_id() {