From 1ba0debc5aa24dc827a6b26fbb6c55720ae3c913 Mon Sep 17 00:00:00 2001 From: komaln Date: Tue, 20 May 2008 06:39:02 +0000 Subject: [PATCH] b=14471 r=Adilger Changed replay-single.sh to use 'lctl {get,set}_param' --- lustre/tests/replay-single.sh | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 1ce5c2c..ea3c622 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -59,20 +59,20 @@ test_1a() { do_facet ost1 "sysctl -w lustre.fail_loc=0" rm -fr $DIR/$tfile - local old_last_id=`cat $LPROC/obdfilter/*/last_id` + local old_last_id=`lctl get_param -n obdfilter.*.last_id` touch -o $DIR/$tfile 1 sync - local new_last_id=`cat $LPROC/obdfilter/*/last_id` + local new_last_id=`lctl get_param -n obdfilter.*.last_id` test "$old_last_id" = "$new_last_id" || { echo "OST object create is caused by MDS" return 1 } - old_last_id=`cat $LPROC/obdfilter/*/last_id` + old_last_id=`lctl get_param -n obdfilter.*.last_id` echo "data" > $DIR/$tfile sync - new_last_id=`cat $LPROC/obdfilter/*/last_id` + new_last_id=`lctl get_param -n obdfilter.*.last_id` test "$old_last_id" = "$new_last_id "&& { echo "CROW does not work on write" return 1 @@ -84,10 +84,10 @@ test_1a() { do_facet ost1 "sysctl -w lustre.fail_loc=0x80000801" rm -fr $DIR/1a1 - old_last_id=`cat $LPROC/obdfilter/*/last_id` + old_last_id=`lctl get_param -n obdfilter.*.last_id` echo "data" > $DIR/1a1 sync - new_last_id=`cat $LPROC/obdfilter/*/last_id` + new_last_id=`lctl get_param -n obdfilter.*.last_id` test "$old_last_id" = "$new_last_id" || { echo "CROW does work with fail_loc=0x80000801" return 1 @@ -772,7 +772,7 @@ test_39() { # bug 4176 run_test 39 "test recovery from unlink llog (test llog_gen_rec) " count_ost_writes() { - awk -vwrites=0 '/ost_write/ { writes += $2 } END { print writes; }' $LPROC/osc/*/stats + lctl get_param -n osc.*.stats | awk -vwrites=0 '/ost_write/ { writes += $2 } END { print writes; }' } #b=2477,2532 @@ -829,7 +829,7 @@ test_41() { do_facet client dd if=/dev/zero of=$f bs=4k count=1 || return 3 cancel_lru_locks osc # fail ost2 and read from ost1 - local osc2dev=`grep ${ost2_svc}-osc- $LPROC/devices | awk '{print $1}'` + local osc2dev=`lctl get_param -n devices | grep ${ost2_svc}-osc- | awk '{print $1}'` [ "$osc2dev" ] || return 4 $LCTL --device $osc2dev deactivate || return 1 do_facet client dd if=$f of=/dev/null bs=4k count=1 || return 3 @@ -876,7 +876,7 @@ run_test 43 "mds osc import failure during recovery; don't LBUG" test_44() { local at_max_saved=0 - mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices` + mdcdev=`lctl get_param -n devices | awk '/-mdc-/ {print $1}'` [ "$mdcdev" ] || exit 2 # adaptive timeouts slow this way down @@ -887,7 +887,7 @@ test_44() { for i in `seq 1 10`; do echo "$i of 10 ($(date +%s))" - do_facet mds "grep service $LPROC/mdt/MDS/mds/timeouts" + do_facet mds "lctl get_param -n mdt.MDS.mds.timeouts | grep service" #define OBD_FAIL_TGT_CONN_RACE 0x701 do_facet mds "sysctl -w lustre.fail_loc=0x80000701" $LCTL --device $mdcdev recover @@ -901,11 +901,11 @@ test_44() { run_test 44 "race in target handle connect" test_44b() { - mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices` + mdcdev=`lctl get_param -n devices | awk '/-mdc-/ {print $1}'` [ "$mdcdev" ] || exit 2 for i in `seq 1 10`; do echo "$i of 10 ($(date +%s))" - do_facet mds "grep service $LPROC/mdt/MDS/mds/timeouts" + do_facet mds "lctl get_param -n mdt.MDS.mds.timeouts | grep service" #define OBD_FAIL_TGT_DELAY_RECONNECT 0x704 do_facet mds "sysctl -w lustre.fail_loc=0x80000704" $LCTL --device $mdcdev recover @@ -918,7 +918,7 @@ run_test 44b "race in target handle connect" # Handle failed close test_45() { - mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices` + mdcdev=`lctl get_param -n devices | awk '/-mdc-/ {print $1}'` [ "$mdcdev" ] || exit 2 $LCTL --device $mdcdev recover @@ -992,7 +992,7 @@ test_48() { run_test 48 "MDS->OSC failure during precreate cleanup (2824)" test_50() { - local oscdev=`do_facet mds grep \'${ost1_svc}-osc \' $LPROC/devices | awk '{print $1}' | head -1` + local oscdev=`do_facet mds lctl get_param -n devices | grep ${ost1_svc}-osc | awk '{print $1}' | head -1` [ "$oscdev" ] || return 1 do_facet mds $LCTL --device $oscdev recover || return 2 do_facet mds $LCTL --device $oscdev recover || return 3 @@ -1405,9 +1405,9 @@ test_65a() #bug 3055 # check for log message $LCTL dk | grep "Early reply #" || error "No early reply" # client should show 30s estimates - grep portal $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep portal sleep 9 - grep portal $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep portal } run_test 65a "AT: verify early replies" @@ -1433,33 +1433,33 @@ test_65b() #bug 3055 $LCTL dk | grep "Early reply #" || error "No early reply" debugrestore # client should show 30s estimates - grep portal $LPROC/osc/${FSNAME}-OST0000-osc-*/timeouts + lctl get_param -n osc.${FSNAME}-OST0000-osc-*.timeouts | grep portal } run_test 65b "AT: verify early replies on packed reply / bulk" test_66a() #bug 3055 { at_start || return 0 - grep "portal 12" $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep "portal 12" # adjust 5s at a time so no early reply is sent (within deadline) do_facet mds "sysctl -w lustre.fail_val=5000" #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a do_facet mds "sysctl -w lustre.fail_loc=0x8000050a" createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null - grep "portal 12" $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep "portal 12" do_facet mds "sysctl -w lustre.fail_val=10000" do_facet mds "sysctl -w lustre.fail_loc=0x8000050a" createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null - grep "portal 12" $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep "portal 12" do_facet mds "sysctl -w lustre.fail_loc=0" sleep 9 createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null - grep portal $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts | grep "portal 12" - CUR=$(awk '/portal 12/ {print $5}' $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts) - WORST=$(awk '/portal 12/ {print $7}' $LPROC/mdc/${FSNAME}-MDT0000-mdc-*/timeouts) + lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep portal | grep "portal 12" + CUR=$(lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | awk '/portal 12/ {print $5}') + WORST=$(lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | awk '/portal 12/ {print $7}') echo "Current MDT timeout $CUR, worst $WORST" [ $CUR -lt $WORST ] || error "Current $CUR should be less than worst $WORST" } @@ -1468,14 +1468,14 @@ run_test 66a "AT: verify MDT service time adjusts with no early replies" test_66b() #bug 3055 { at_start || return 0 - ORIG=$(awk '/network/ {print $4}' $LPROC/mdc/${FSNAME}-*/timeouts) + ORIG=$(lctl get_param -n mdc.${FSNAME}-*.timeouts | awk '/network/ {print $4}') sysctl -w lustre.fail_val=$(($ORIG + 5)) #define OBD_FAIL_PTLRPC_PAUSE_REP 0x50c sysctl -w lustre.fail_loc=0x50c ls $DIR/$tfile > /dev/null 2>&1 sysctl -w lustre.fail_loc=0 - CUR=$(awk '/network/ {print $4}' $LPROC/mdc/${FSNAME}-*/timeouts) - WORST=$(awk '/network/ {print $6}' $LPROC/mdc/${FSNAME}-*/timeouts) + CUR=$(lctl get_param -n mdc.${FSNAME}-*.timeouts | awk '/network/ {print $4}') + WORST=$(lctl get_param -n mdc.${FSNAME}-*.timeouts | awk '/network/ {print $6}') echo "network timeout orig $ORIG, cur $CUR, worst $WORST" [ $WORST -gt $ORIG ] || error "Worst $WORST should be worse than orig $ORIG" } @@ -1484,7 +1484,7 @@ run_test 66b "AT: verify net latency adjusts" test_67a() #bug 3055 { at_start || return 0 - CONN1=$(awk '/_connect/ {total+=$2} END {print total}' $LPROC/osc/*/stats) + CONN1=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}') # sleeping threads may drive values above this do_facet ost1 "sysctl -w lustre.fail_val=400" #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a @@ -1492,7 +1492,7 @@ test_67a() #bug 3055 createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null do_facet ost1 "sysctl -w lustre.fail_loc=0" - CONN2=$(awk '/_connect/ {total+=$2} END {print total}' $LPROC/osc/*/stats) + CONN2=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}') ATTEMPTS=$(($CONN2 - $CONN1)) echo "$ATTEMPTS osc reconnect attemps on gradual slow" [ $ATTEMPTS -gt 0 ] && error_ignore 13721 "AT should have prevented reconnect" @@ -1503,15 +1503,15 @@ run_test 67a "AT: verify slow request processing doesn't induce reconnects" test_67b() #bug 3055 { at_start || return 0 - CONN1=$(awk '/_connect/ {total+=$2} END {print total}' $LPROC/osc/*/stats) + CONN1=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}') #define OBD_FAIL_OST_PAUSE_CREATE 0x223 do_facet ost1 "sysctl -w lustre.fail_val=20000" do_facet ost1 "sysctl -w lustre.fail_loc=0x80000223" cp /etc/profile $DIR/$tfile || error "cp failed" client_reconnect - cat $LPROC/ost/OSS/ost_create/timeouts + lctl get_param -n ost.OSS.ost_create.timeouts log "phase 2" - CONN2=$(awk '/_connect/ {total+=$2} END {print total}' $LPROC/osc/*/stats) + CONN2=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}') ATTEMPTS=$(($CONN2 - $CONN1)) echo "$ATTEMPTS osc reconnect attemps on instant slow" # do it again; should not timeout @@ -1519,8 +1519,8 @@ test_67b() #bug 3055 cp /etc/profile $DIR/$tfile || error "cp failed" do_facet ost1 "sysctl -w lustre.fail_loc=0" client_reconnect - cat $LPROC/ost/OSS/ost_create/timeouts - CONN3=$(awk '/_connect/ {total+=$2} END {print total}' $LPROC/osc/*/stats) + lctl get_param -n ost.OSS.ost_create.timeouts + CONN3=$(`lctl get_param -n osc.*.stats` | awk '/_connect/ {total+=$2} END {print total}') ATTEMPTS=$(($CONN3 - $CONN2)) echo "$ATTEMPTS osc reconnect attemps on 2nd slow" [ $ATTEMPTS -gt 0 ] && error "AT should have prevented reconnect" -- 1.8.3.1