$DEBUG_OFF
myUID=$RUNAS_ID
myRUNAS=$RUNAS
- FAIL_ON_ERROR=false check_runas_id_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+ FAIL_ON_ERROR=false check_runas_id_ret $myUID $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_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+ FAIL_ON_ERROR=false check_runas_id_ret $myUID $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_ret $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
+ FAIL_ON_ERROR=false check_runas_id_ret $myUID $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
chown $myUID:$myUID $IOZDIR
$myRUNAS iozone $IOZONE_OPTS -s $SIZE -f $IOZFILE 2>&1 | tee $IOZLOG
tail -1 $IOZLOG | grep -q complete || \
esac
}
-RUNAS="runas -u $TSTID"
-RUNAS2="runas -u $TSTID2"
-FAIL_ON_ERROR=true check_runas_id $TSTID $RUNAS
-FAIL_ON_ERROR=true check_runas_id $TSTID2 $RUNAS2
+RUNAS="runas -u $TSTID -g $TSTID"
+RUNAS2="runas -u $TSTID2 -g $TSTID2"
+FAIL_ON_ERROR=true check_runas_id $TSTID $TSTID $RUNAS
+FAIL_ON_ERROR=true check_runas_id $TSTID2 $TSTID2 $RUNAS2
FAIL_ON_ERROR=false
# $RUNAS_ID may get set incorrectly somewhere else
[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
-check_runas_id $RUNAS_ID $RUNAS
+check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
build_test_filter
[ "$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 || {
+ FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_ID $RUNAS || {
skip "User $RUNAS_ID does not exist - skipping"
return 0
}
# $RUNAS_ID may get set incorrectly somewhere else
[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
-check_runas_id $RUNAS_ID $RUNAS
+check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
build_test_filter
check_runas_id_ret() {
local myRC=0
- local myRUNAS_ID=$1
- shift
+ local myRUNAS_UID=$1
+ local myRUNAS_GID=$2
+ shift 2
local myRUNAS=$@
if [ -z "$myRUNAS" ]; then
error_exit "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
+ chown $myRUNAS_UID:$myRUNAS_GID $DIR/d0_runas_test
$myRUNAS touch $DIR/d0_runas_test/f$$ || myRC=$?
rm -rf $DIR/d0_runas_test
return $myRC
}
check_runas_id() {
- local myRUNAS_ID=$1
- shift
+ local myRUNAS_UID=$1
+ local myRUNAS_GID=$2
+ shift 2
local myRUNAS=$@
- check_runas_id_ret $myRUNAS_ID $myRUNAS || \
- error "unable to write to $DIR/d0_runas_test as UID $myRUNAS_ID.
+ check_runas_id_ret $myRUNAS_UID $myRUNAS_GID $myRUNAS || \
+ error "unable to write to $DIR/d0_runas_test as UID $myRUNAS_UID.
Please set RUNAS_ID to some UID which exists on MDS and client or
- add user $myRUNAS_ID:$myRUNAS_ID on these nodes."
+ add user $myRUNAS_UID:$myRUNAS_GID on these nodes."
}
# Run multiop in the background, but wait for it to print