Whamcloud - gitweb
b=14471
authorkomaln <komaln>
Sat, 8 Mar 2008 20:25:41 +0000 (20:25 +0000)
committerkomaln <komaln>
Sat, 8 Mar 2008 20:25:41 +0000 (20:25 +0000)
r=Adilger

Changed recovery-small.sh to use 'lctl {get,set}_param'

lustre/tests/recovery-small.sh

index 54b0200..054782a 100755 (executable)
@@ -166,17 +166,13 @@ test_15() {
 }
 run_test 15 "failed open (-ENOMEM)"
 
-READ_AHEAD=`cat $LPROC/llite/*/max_read_ahead_mb | head -n 1`
+READ_AHEAD=`lctl get_param -n llite.*.max_read_ahead_mb | head -n 1`
 stop_read_ahead() {
-   for f in $LPROC/llite/*/max_read_ahead_mb; do 
-      echo 0 > $f
-   done
+   lctl set_param -n llite.*.max_read_ahead_mb 0
 }
 
 start_read_ahead() {
-   for f in $LPROC/llite/*/max_read_ahead_mb; do 
-      echo $READ_AHEAD > $f
-   done
+   lctl set_param -n llite.*.max_read_ahead_mb $READ_AHEAD
 }
 
 test_16() {
@@ -229,7 +225,7 @@ test_18a() {
 
     do_facet client cp $SAMPLE_FILE $f
     sync
-    local osc2dev=`grep ${ost2_svc}-osc- $LPROC/devices | egrep -v 'MDT' | awk '{print $1}'`
+    local osc2dev=`lctl get_param -n devices | grep ${ost2_svc}-osc- | egrep -v 'MDT' | awk '{print $1}'`
     $LCTL --device $osc2dev deactivate || return 3
     # my understanding is that there should be nothing in the page
     # cache after the client reconnects?     
@@ -599,8 +595,8 @@ test_26() {      # bug 5921 - evict dead exports by pinger
 # this test can only run from a client on a separate node.
        remote_ost || skip "local OST" && return
        remote_mds || skip "local MDS" && return
-       OST_FILE=$LPROC/obdfilter/${ost1_svc}/num_exports
-        OST_EXP="`do_facet ost1 cat $OST_FILE`"
+       OST_FILE=obdfilter.${ost1_svc}.num_exports
+        OST_EXP="`do_facet ost1 lctl get_param -n $OST_FILE`"
        OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2`
        echo starting with $OST_NEXP1 OST exports
 # OBD_FAIL_PTLRPC_DROP_RPC 0x505
@@ -610,7 +606,7 @@ test_26() {      # bug 5921 - evict dead exports by pinger
        # might have to wait for the next ping.
        echo Waiting for $(($TIMEOUT * 4)) secs
        sleep $(($TIMEOUT * 4))
-        OST_EXP="`do_facet ost1 cat $OST_FILE`"
+        OST_EXP="`do_facet ost1 lctl get_param -n $OST_FILE`"
        OST_NEXP2=`echo $OST_EXP | cut -d' ' -f2`
        echo ending with $OST_NEXP2 OST exports
        do_facet client sysctl -w lustre.fail_loc=0x0
@@ -623,10 +619,10 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
        client_df
         zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2"
         sleep 1 # wait connections being established
-       MDS_FILE=$LPROC/mdt/${mds1_svc}/num_exports
-        MDS_NEXP1="`do_facet $SINGLEMDS cat $MDS_FILE | cut -d' ' -f2`"
-       OST_FILE=$LPROC/obdfilter/${ost1_svc}/num_exports
-        OST_NEXP1="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
+       MDS_FILE=mdt.${mds1_svc}.num_exports
+        MDS_NEXP1="`do_facet $SINGLEMDS lctl get_param -n $MDS_FILE | cut -d' ' -f2`"
+       OST_FILE=obdfilter.${ost1_svc}.num_exports
+        OST_NEXP1="`do_facet ost1 lctl get_param -n $OST_FILE | cut -d' ' -f2`"
        echo starting with $OST_NEXP1 OST and $MDS_NEXP1 MDS exports
        zconf_umount `hostname` $MOUNT2 -f
        # evictor takes up to 2.25x to evict.  But if there's a 
@@ -634,8 +630,8 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
        # might have to wait for the next ping.
        echo Waiting for $(($TIMEOUT * 4)) secs
        sleep $(($TIMEOUT * 4))
-        OST_NEXP2="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
-        MDS_NEXP2="`do_facet $SINGLEMDS cat $MDS_FILE | cut -d' ' -f2`"
+        OST_NEXP2="`do_facet ost1 lctl get_param -n $OST_FILE | cut -d' ' -f2`"
+        MDS_NEXP2="`do_facet $SINGLEMDS lctl get_param -n $MDS_FILE | cut -d' ' -f2`"
        echo ending with $OST_NEXP2 OST and $MDS_NEXP2 MDS exports
         [ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted from OST"
         [ $MDS_NEXP1 -le $MDS_NEXP2 ] && error "client not evicted from MDS"
@@ -858,10 +854,8 @@ run_test 56 "do not allow reconnect to busy exports"
 
 test_57_helper() {
         # no oscs means no client or mdt 
-        while [ -e $LPROC/osc ]; do
-                for f in `find $LPROC -type f`; do 
-                        cat $f > /dev/null 2>&1
-                done
+        while lctl get_param osc.*.* > /dev/null 2>&1; do
+                : # loop until proc file is removed
         done
 }