From 33b2d684e091de22aa17248285ba402ba10b2f15 Mon Sep 17 00:00:00 2001 From: fanyong Date: Thu, 4 Dec 2008 03:31:15 +0000 Subject: [PATCH] Branch HEAD b=17770 i=Elena Gryaznova avoid using quota_usr/quota_2usr groups --- lustre/tests/acceptance-small.sh | 6 +++--- lustre/tests/sanity-quota.sh | 8 ++++---- lustre/tests/sanity.sh | 4 ++-- lustre/tests/sanityN.sh | 2 +- lustre/tests/test-framework.sh | 18 ++++++++++-------- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index f80ce68..7b320d8 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -148,7 +148,7 @@ for NAME in $CONFIGS; do $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" @@ -183,7 +183,7 @@ for NAME in $CONFIGS; do $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 @@ -213,7 +213,7 @@ for NAME in $CONFIGS; do $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 || \ diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 7cf7cbb..939afef 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -137,10 +137,10 @@ lustre_fail() { 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 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index a7437dc..3d05213 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -126,7 +126,7 @@ rm -rf $DIR/[Rdfs][0-9]* # $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 @@ -3162,7 +3162,7 @@ test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly [ "$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 } diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index a0ef265..1dba529 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -67,7 +67,7 @@ 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 +check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS build_test_filter diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index afbe3e4..42b3963 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2020,8 +2020,9 @@ get_stripe () { 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" @@ -2032,20 +2033,21 @@ check_runas_id_ret() { 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 -- 1.8.3.1