From ed7838c0a3f1a2c2f952e5b2f066363a76fd0bbb Mon Sep 17 00:00:00 2001 From: grev Date: Fri, 8 Feb 2008 11:57:27 +0000 Subject: [PATCH] b=14330 i=Adilger move RUNAS to local.sh; run BONNIE as RUNAS_ID user b=14474 i=Adilger don't allow sanity to see MOUNT2; remove chown of MOUNT --- lustre/tests/acceptance-small.sh | 15 +++++++++------ lustre/tests/cfg/local.sh | 9 +++++++++ lustre/tests/sanity.sh | 13 ++----------- lustre/tests/sanityN.sh | 11 +++-------- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 1926422..1c3194c 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -90,7 +90,7 @@ for NAME in $CONFIGS; do if [ "$SANITY" != "no" ]; then title sanity - bash sanity.sh + MOUNT2="" bash sanity.sh $CLEANUP $SETUP SANITY="done" @@ -123,20 +123,23 @@ for NAME in $CONFIGS; do DBENCH="done" fi - chown $UID $MOUNT which bonnie++ > /dev/null 2>&1 || BONNIE=no if [ "$BONNIE" != "no" ]; then title bonnie - mkdir -p $MOUNT/d0.bonnie - $LFS setstripe -c -1 $MOUNT/d0.bonnie + BONDIR=$MOUNT/d0.bonnie + mkdir -p $BONDIR + $LFS setstripe -c -1 $BONDIR sync MIN=`cat /proc/fs/lustre/osc/*/kbytesavail | sort -n | head -n1` SPACE=$(( OSTCOUNT * MIN )) [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4)) log "min OST has ${MIN}kB available, using ${SIZE}kB file size" $DEBUG_OFF - BONFILE=$MOUNT/d0.bonnie - bonnie++ -f -r 0 -s$((SIZE / 1024)) -n 10 -u$UID -d$BONFILE + myUID=$RUNAS_ID + myRUNAS=$RUNAS + FAIL_ON_ERROR=false check_runas_id $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 $CLEANUP $SETUP diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index e1774c7..c40176f 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -75,6 +75,15 @@ DIR=${DIR:-$MOUNT} DIR1=${DIR:-$MOUNT1} DIR2=${DIR2:-$MOUNT2} +if [ $UID -ne 0 ]; then + log "running as non-root uid $UID" + RUNAS_ID="$UID" + RUNAS="" +else + RUNAS_ID=${RUNAS_ID:-500} + RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} +fi + FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD POWER_DOWN=${POWER_DOWN:-"powerman --off"} POWER_UP=${POWER_UP:-"powerman --on"} diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4071860..6dd97c5 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -120,17 +120,8 @@ MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))} [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo rm -rf $DIR/[Rdfs][0-9]* -if [ $UID -ne 0 ]; then - log "running as non-root uid $UID" - RUNAS_ID="$UID" - RUNAS="" -else - RUNAS_ID=${RUNAS_ID:-500} - RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} - - # $RUNAS_ID may get set incorrectly somewhere else - [ $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!" -fi +# $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 diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index f97e40a..3dba623 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -33,14 +33,6 @@ MOUNT_2=${MOUNT_2:-"yes"} CHECK_GRANT=${CHECK_GRANT:-"yes"} GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""} -if [ $UID -ne 0 ]; then - RUNAS_ID="$UID" - RUNAS="" -else - RUNAS_ID=${RUNAS_ID:-500} - RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} -fi - SAVE_PWD=$PWD export NAME=${NAME:-local} @@ -70,6 +62,9 @@ OSTCOUNT=`cat $LPROC/lov/$LOVNAME/numobd` rm -rf $DIR1/[df][0-9]* $DIR1/lnk +# $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 build_test_filter -- 1.8.3.1