Whamcloud - gitweb
b=13769
authorgrev <grev>
Tue, 27 Nov 2007 12:52:21 +0000 (12:52 +0000)
committergrev <grev>
Tue, 27 Nov 2007 12:52:21 +0000 (12:52 +0000)
i=Adilger
i=Nathan
t-f helper check_runas_id()

b=14148
i=Adilger
check_runas_id() modification

lustre/tests/sanity.sh
lustre/tests/sanityN.sh
lustre/tests/test-framework.sh

index 2cd7334..e662553 100644 (file)
@@ -143,6 +143,8 @@ MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
 [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
 rm -rf $DIR/[Rdfs][1-9]*
 
+check_runas_id $RUNAS_ID $RUNAS
+
 build_test_filter
 
 if [ "${ONLY}" = "MOUNT" ] ; then 
index ea6a79c..4ba69e8 100644 (file)
@@ -75,6 +75,8 @@ OSTCOUNT=`cat $LPROC/lov/$LOVNAME/numobd`
 
 rm -rf $DIR1/[df][0-9]* $DIR1/lnk
 
+check_runas_id $RUNAS_ID $RUNAS
+
 build_test_filter
 
 test_1a() {
index 6158781..cfaba5f 100644 (file)
@@ -931,7 +931,7 @@ cleanup_and_setup_lustre() {
 
 check_and_cleanup_lustre() {
     if [ "`mount | grep $MOUNT`" ]; then
-        rm -rf $DIR/[Rdfs][1-9]*
+        rm -rf $DIR/[Rdfs][0-9]*
         rm -f $DIR/${TESTSUITE}/[Rdfs][1-9]*
     fi
     if [ "$I_MOUNTED" = "yes" ]; then
@@ -1374,3 +1374,17 @@ is_patchless ()
 {
     grep -q patchless $LPROC/version
 }
+
+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$$ || \
+        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."
+    rm -rf $DIR/d0_runas_test
+}