From 6369e368e5f4e0e982bd1b24922489507b7a94f1 Mon Sep 17 00:00:00 2001
From: grev <grev>
Date: Wed, 5 Sep 2007 18:15:56 +0000
Subject: [PATCH] b=13500 i=Nathan

Wait for MDT value to update.

b=13145
i=Brian

Run conf param on MGS.
---
 lustre/tests/conf-sanity.sh | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh
index a61e502e48..992a1d03a0 100644
--- a/lustre/tests/conf-sanity.sh
+++ b/lustre/tests/conf-sanity.sh
@@ -919,7 +919,7 @@ set_and_check() {
 	    FINAL=$(($ORIG + 5))
 	fi
 	echo "Setting $PARAM from $ORIG to $FINAL"
-	$LCTL conf_param $PARAM=$FINAL
+	do_facet mds "$LCTL conf_param $PARAM=$FINAL" || error conf_param failed
 	local RESULT
 	local MAX=20
 	local WAIT=0
@@ -1007,14 +1007,23 @@ test_29() {
 
 	# check MDT too 
 	local MPROC="$LPROC/osc/$FSNAME-OST0001-osc-[M]*/active"
-        RESULT=`do_facet mds " [ -r $MPROC ] && cat $MPROC"`
-        [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
-        if [ $RESULT -ne $DEAC ]; then
-            echo "MDT not deactivated: $RESULT"
-            return 4
-        else
-	    echo "MDT deactivated also"
-	fi
+	local MAX=30
+	local WAIT=0
+	while [ 1 ]; do
+	    sleep 5
+	    RESULT=`do_facet mds " [ -r $MPROC ] && cat $MPROC"`
+	    [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
+	    if [ $RESULT -eq $DEAC ]; then
+		echo "MDT deactivated also after $WAIT sec (got $RESULT)"
+		break
+	    fi
+	    WAIT=$((WAIT + 5))
+	    if [ $WAIT -eq $MAX ]; then
+		echo "MDT not deactivated: wanted $DEAC got $RESULT"
+		return 4
+	    fi
+	    echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
+	done
 
         # test new client starts deactivated
  	umount_client $MOUNT || return 200
-- 
GitLab