From: komaln Date: Wed, 28 May 2008 06:04:19 +0000 (+0000) Subject: b=14471 X-Git-Tag: v1_9_50~434 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0fe560ea5dd4e582f2393f54de106e34a8b2c6ae b=14471 r=adilger to replace the sysctl lustre.* and lnet.* instances with lctl {get,set}_param --- diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 6fc248a..a6cd753 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -22,8 +22,8 @@ fi [ "$TMP" ] || TMP=/tmp [ "$COUNT" ] || COUNT=1000 [ "$DEBUG_LVL" ] || DEBUG_LVL=0 -[ "$DEBUG_OFF" ] || DEBUG_OFF="eval sysctl -w lnet.debug=\"$DEBUG_LVL\"" -[ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484" +[ "$DEBUG_OFF" ] || DEBUG_OFF="eval lctl set_param debug=\"$DEBUG_LVL\"" +[ "$DEBUG_ON" ] || DEBUG_ON="eval lctl set_param debug=0x33f0484" export TESTSUITE_LIST="RUNTESTS SANITY DBENCH BONNIE IOZONE FSX SANITYN LFSCK LIBLUSTRE REPLAY_SINGLE CONF_SANITY RECOVERY_SMALL REPLAY_OST_SINGLE REPLAY_DUAL INSANITY SANITY_QUOTA SANITY_SEC" diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index b1579e5..d165584 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -320,7 +320,7 @@ test_5e() { start_mds #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506 - do_facet client "sysctl -w lustre.fail_loc=0x80000506" + do_facet client "lctl set_param fail_loc=0x80000506" grep " $MOUNT " /etc/mtab && echo "test 5e: mtab before mount" && return 10 mount_client $MOUNT || echo "mount failed (not fatal)" cleanup || return $? @@ -357,17 +357,17 @@ run_test 8 "double mount setup" test_9() { start_ost - do_facet ost1 sysctl lnet.debug=\'inode trace\' || return 1 - do_facet ost1 sysctl lnet.subsystem_debug=\'mds ost\' || return 1 + do_facet ost1 lctl set_param debug=\'inode trace\' || return 1 + do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1 - CHECK_PTLDEBUG="`do_facet ost1 sysctl -n lnet.debug`" + CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`" if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ];then echo "lnet.debug success" else echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'" return 1 fi - CHECK_SUBSYS="`do_facet ost1 sysctl -n lnet.subsystem_debug`" + CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`" if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then echo "lnet.subsystem_debug success" else @@ -862,7 +862,7 @@ test_23b() { # was test_23 start_ost start_mds # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD - sysctl -w lustre.fail_loc=0x80000313 + lctl set_param fail_loc=0x80000313 mount_client $MOUNT cleanup } @@ -960,7 +960,7 @@ test_26() { # we need modules before mount for sysctl, so make sure... do_facet mds "lsmod | grep -q lustre || modprobe lustre" #define OBD_FAIL_MDS_FS_SETUP 0x135 - do_facet mds "sysctl -w lustre.fail_loc=0x80000135" + do_facet mds "lctl set_param fail_loc=0x80000135" start_mds && echo MDS started && return 1 lctl get_param -n devices DEVS=$(lctl get_param -n devices | wc -l) @@ -1150,7 +1150,7 @@ test_32a() { local tmpdir=$TMP/conf32a unzip -o -j -d $tmpdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; } load_modules - sysctl lnet.debug=$PTLDEBUG + lctl set_param debug=$PTLDEBUG $TUNEFS $tmpdir/mds || error "tunefs failed" # nids are wrong, so client wont work, but server should start @@ -1218,7 +1218,7 @@ test_32b() { local tmpdir=$TMP/conf32b unzip -o -j -d $tmpdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; } load_modules - sysctl lnet.debug=$PTLDEBUG + lctl set_param debug=$PTLDEBUG NEWNAME=sofia # writeconf will cause servers to register with their current nids @@ -1295,8 +1295,8 @@ test_33b() { # was test_34 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1 # Drop lock cancelation reply during umount #define OBD_FAIL_LDLM_CANCEL 0x304 - do_facet client sysctl -w lustre.fail_loc=0x80000304 - #sysctl -w lnet.debug=-1 + do_facet client lctl set_param fail_loc=0x80000304 + #lctl set_param debug=-1 umount_client $MOUNT cleanup } @@ -1352,8 +1352,8 @@ run_test 34c "force umount with failed ost should be normal" test_35() { # bug 12459 setup - DBG_SAVE="`sysctl -n lnet.debug`" - sysctl -w lnet.debug="ha" + DBG_SAVE="`lctl get_param -n debug`" + lctl set_param debug="ha" log "Set up a fake failnode for the MDS" FAKENID="127.0.0.2" @@ -1375,7 +1375,7 @@ test_35() { # bug 12459 log "Wait for df ($DFPID) ... " wait $DFPID log "done" - sysctl -w lnet.debug="$DBG_SAVE" + lctl set_param debug="$DBG_SAVE" # retrieve from the log the first server that the client tried to # contact after the connection loss diff --git a/lustre/tests/llog-test.sh b/lustre/tests/llog-test.sh index 56c7f0a..1de2b4f 100644 --- a/lustre/tests/llog-test.sh +++ b/lustre/tests/llog-test.sh @@ -59,7 +59,7 @@ setup() { log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`" #define OBD_FAIL_OST_ALL_REPLY_NET 0x211 - do_facet ost "sysctl -w lustre.fail_loc=0x80000211" + do_facet ost "lctl set_param fail_loc=0x80000211" zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail" fi diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 2dc816b..3f29d3f 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -123,7 +123,7 @@ run_test 11 "wake up a thread waiting for completion after eviction (b=2460)" #b=2494 test_12(){ $LCTL mark multiop $MOUNT/$tfile OS_c - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x115" clear_failloc $SINGLEMDS $((TIMEOUT * 2)) & multiop_bg_pause $MOUNT/$tfile OS_c || return 1 PID=$! @@ -140,9 +140,9 @@ test_13() { mkdir $MOUNT/readdir || return 1 touch $MOUNT/readdir/newentry || return # OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000104" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000104" ls $MOUNT/readdir || return 3 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" rm -rf $MOUNT/readdir || return 4 } run_test 13 "mdc_readpage restart test (bug 1138)" @@ -152,14 +152,14 @@ test_14() { mkdir $MOUNT/readdir touch $MOUNT/readdir/newentry # OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000106" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000106" ls $MOUNT/readdir || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" } run_test 14 "mdc_readpage resend test (bug 1138)" test_15() { - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000128" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000128" touch $DIR/$tfile && return 1 return 0 } @@ -180,11 +180,11 @@ test_16() { stop_read_ahead #define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000504" + do_facet ost1 "lctl set_param fail_loc=0x80000504" cancel_lru_locks osc # OST bulk will time out here, client resends do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1 - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 # give recovery a chance to finish (shouldn't take long) sleep $TIMEOUT do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 2 @@ -195,13 +195,13 @@ run_test 16 "timeout bulk put, don't evict client (2732)" test_17() { # OBD_FAIL_PTLRPC_BULK_GET_NET 0x0503 | OBD_FAIL_ONCE # OST bulk will time out here, client retries - do_facet ost1 sysctl -w lustre.fail_loc=0x80000503 + do_facet ost1 lctl set_param fail_loc=0x80000503 # need to ensure we send an RPC do_facet client cp /etc/termcap $DIR/$tfile sync sleep $TIMEOUT - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 do_facet client "df $DIR" # expect cmp to succeed, client resent bulk do_facet client "cmp /etc/termcap $DIR/$tfile" || return 3 @@ -280,7 +280,7 @@ test_18c() { # OBD_FAIL_OST_CONNECT_NET2 # lost reply to connect request - do_facet ost1 sysctl -w lustre.fail_loc=0x80000225 + do_facet ost1 lctl set_param fail_loc=0x80000225 # force reconnect df $MOUNT > /dev/null 2>&1 sleep 2 @@ -326,7 +326,7 @@ test_20a() { # bug 2983 - ldlm_handle_enqueue cleanup MULTI_PID=$! cancel_lru_locks osc #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308 - do_facet ost1 sysctl -w lustre.fail_loc=0x80000308 + do_facet ost1 lctl set_param fail_loc=0x80000308 kill -USR1 $MULTI_PID wait $MULTI_PID rc=$? @@ -339,7 +339,7 @@ test_20b() { # bug 2986 - ldlm_handle_enqueue error during open lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1 cancel_lru_locks osc #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308 - do_facet ost1 sysctl -w lustre.fail_loc=0x80000308 + do_facet ost1 lctl set_param fail_loc=0x80000308 dd if=/etc/hosts of=$DIR/$tdir/$tfile && \ error "didn't fail open enqueue" || true } @@ -351,18 +351,18 @@ test_21a() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc wait $close_pid || return 1 wait $open_pid || return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 3 $CHECKSTAT -t file $DIR/$tdir-2/f || return 4 @@ -377,11 +377,11 @@ test_21b() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks mdc @@ -400,19 +400,19 @@ test_21c() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 3 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc wait $close_pid || return 1 wait $open_pid || return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -426,16 +426,16 @@ test_21d() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -450,10 +450,10 @@ test_21e() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $pid cancel_lru_locks mdc @@ -472,16 +472,16 @@ test_21f() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -495,16 +495,16 @@ test_21g() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -518,17 +518,17 @@ test_21h() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" touch $DIR/$tdir-2/f & touch_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" cancel_lru_locks mdc kill -USR1 $pid wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" wait $touch_pid || return 2 @@ -543,7 +543,7 @@ test_22() { f1=$DIR/${tfile}-1 f2=$DIR/${tfile}-2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" multiop $f2 Oc & close_pid=$! @@ -551,7 +551,7 @@ test_22() { multiop $f1 msu || return 1 cancel_lru_locks mdc - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" wait $close_pid || return 2 rm -rf $f2 || return 4 @@ -582,7 +582,7 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it kill -USR1 $MULTI_PID wait $MULTI_PID rc=$? - sysctl -w lustre.fail_loc=0x0 + lctl set_param fail_loc=0x0 client_reconnect [ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true } @@ -597,7 +597,7 @@ test_26a() { # was test_26 bug 5921 - evict dead exports by pinger OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2` echo starting with $OST_NEXP1 OST exports # OBD_FAIL_PTLRPC_DROP_RPC 0x505 - do_facet client sysctl -w lustre.fail_loc=0x505 + do_facet client lctl set_param fail_loc=0x505 # evictor takes up to 2.25x to evict. But if there's a # race to start the evictor from various obds, the loser # might have to wait for the next ping. @@ -606,7 +606,7 @@ test_26a() { # was test_26 bug 5921 - evict dead exports by pinger 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 + do_facet client lctl set_param fail_loc=0x0 [ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted" return 0 } @@ -645,10 +645,10 @@ test_27() { FAILURE_MODE="SOFT" facet_failover $SINGLEMDS #define OBD_FAIL_OSC_SHUTDOWN 0x407 - sysctl -w lustre.fail_loc=0x80000407 + lctl set_param fail_loc=0x80000407 # need to wait for reconnect echo -n waiting for fail_loc - while [ `sysctl -n lustre.fail_loc` -eq -2147482617 ]; do + while [ `lctl get_param -n fail_loc` -eq -2147482617 ]; do sleep 1 echo -n . done @@ -664,7 +664,7 @@ test_28() { # bug 6086 - error adding new clients do_facet client mcreate $MOUNT/$tfile || return 1 drop_bl_callback "chmod 0777 $MOUNT/$tfile" ||echo "evicted as expected" #define OBD_FAIL_MDS_CLIENT_ADD 0x12f - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012f" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012f" # fail once (evicted), reconnect fail (fail_loc), ok df || (sleep 10; df) || (sleep 10; df) || error "reconnect failed" rm -f $MOUNT/$tfile @@ -803,7 +803,7 @@ test_55() { echo "(dd_pid=$DDPID, time=$count)successful" #define OBD_FAIL_OST_DROP_REQ 0x21d - do_facet ost sysctl -w lustre.fail_loc=0x0000021d + do_facet ost lctl set_param fail_loc=0x0000021d # second dd will be never finished dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 & DDPID=$! @@ -822,7 +822,7 @@ test_55() { echo "(dd_pid=$DDPID, time=$count)successful" #Recover fail_loc and dd will finish soon - do_facet ost sysctl -w lustre.fail_loc=0 + do_facet ost lctl set_param fail_loc=0 count=0 echo "step3: testing ......" while [ true ]; do @@ -842,9 +842,9 @@ run_test 55 "ost_brw_read/write drops timed-out read/write request" test_56() { # b=11277 #define OBD_FAIL_MDS_RESEND 0x136 touch $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000136" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000136" stat $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" rm -f $DIR/$tfile } run_test 56 "do not allow reconnect to busy exports" @@ -861,12 +861,12 @@ test_57() { # bug 10866 pid=$! sleep 1 #define OBD_FAIL_LPROC_REMOVE 0xB00 - sysctl -w lustre.fail_loc=0x80000B00 + lctl set_param fail_loc=0x80000B00 zconf_umount `hostname` $DIR - sysctl -w lustre.fail_loc=0x80000B00 + lctl set_param fail_loc=0x80000B00 fail_abort $SINGLEMDS kill -9 $pid - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 mount_client $DIR do_facet client "df $DIR" } @@ -876,11 +876,11 @@ test_58() { # bug 11546 #define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801 touch $MOUNT/$tfile ls -la $MOUNT/$tfile - sysctl -w lustre.fail_loc=0x80000801 + lctl set_param fail_loc=0x80000801 cp $MOUNT/$tfile /dev/null & pid=$! sleep 1 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 drop_bl_callback rm -f $MOUNT/$tfile wait $pid do_facet client "df $DIR" @@ -891,11 +891,11 @@ test_59() { # bug 10589 zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2" echo $DIR2 | grep -q $MOUNT2 || error "DIR2 is not set properly: $DIR2" #define OBD_FAIL_LDLM_CANCEL_EVICT_RACE 0x311 - sysctl -w lustre.fail_loc=0x311 + lctl set_param fail_loc=0x311 writes=$(LANG=C dd if=/dev/zero of=$DIR2/$tfile count=1 2>&1) [ $? = 0 ] || error "dd write failed" writes=$(echo $writes | awk -F '+' '/out/ {print $1}') - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 sync zconf_umount `hostname` $MOUNT2 -f reads=$(LANG=C dd if=$DIR/$tfile of=/dev/null 2>&1) diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 749db7f..2f16467 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -141,9 +141,9 @@ test_9() { mcreate $MOUNT1/$tfile-1 mcreate $MOUNT2/$tfile-2 # drop first reint reply - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000119 + do_facet $SINGLEMDS lctl set_param fail_loc=0x80000119 fail $SINGLEMDS - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0 + do_facet $SINGLEMDS lctl set_param fail_loc=0 rm $MOUNT1/$tfile-[1,2] || return 1 @@ -157,9 +157,9 @@ test_10() { munlink $MOUNT1/$tfile-1 mcreate $MOUNT2/$tfile-2 # drop first reint reply - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000119 + do_facet $SINGLEMDS lctl set_param fail_loc=0x80000119 fail $SINGLEMDS - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0 + do_facet $SINGLEMDS lctl set_param fail_loc=0 checkstat $MOUNT1/$tfile-1 && return 1 checkstat $MOUNT1/$tfile-2 || return 2 @@ -177,12 +177,12 @@ test_11() { mcreate $MOUNT2/$tfile-4 mcreate $MOUNT1/$tfile-5 # drop all reint replies for a while - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x0119 + do_facet $SINGLEMDS lctl set_param fail_loc=0x0119 # note that with this fail_loc set, facet_failover df will fail facet_failover $SINGLEMDS #sleep for while, let both clients reconnect and timeout sleep $((TIMEOUT * 2)) - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0 + do_facet $SINGLEMDS lctl set_param fail_loc=0 rm $MOUNT1/$tfile-[1-5] || return 1 @@ -197,9 +197,9 @@ test_12() { MULTIPID=$! #define OBD_FAIL_LDLM_ENQUEUE 0x302 - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000302 + do_facet $SINGLEMDS lctl set_param fail_loc=0x80000302 facet_failover $SINGLEMDS - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0 + do_facet $SINGLEMDS lctl set_param fail_loc=0 df $MOUNT || return 1 ls $DIR/$tfile @@ -222,9 +222,9 @@ test_13() { wait $MULTIPID || return 4 # drop close - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x80000115 + do_facet $SINGLEMDS lctl set_param fail_loc=0x80000115 facet_failover $SINGLEMDS - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0 + do_facet $SINGLEMDS lctl set_param fail_loc=0 df $MOUNT || return 1 ls $DIR/$tfile @@ -326,11 +326,11 @@ test_15b() { echo "data" > "$MOUNT2/${tfile}-m2" umount $MOUNT2 - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000802" + do_facet ost1 "lctl set_param fail_loc=0x80000802" facet_failover $SINGLEMDS df $MOUNT || return 1 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" zconf_mount `hostname` $MOUNT2 || error "mount $MOUNT2 fail" return 0 @@ -404,18 +404,18 @@ test_18() { # bug 3822 - evicting client with enqueued lock statmany -s $MOUNT1/$tdir/f 1 500 & OPENPID=$! NOW=`date +%s` - do_facet $SINGLEMDS sysctl -w lustre.fail_loc=0x8000030b # hold enqueue + do_facet $SINGLEMDS lctl set_param fail_loc=0x8000030b # hold enqueue sleep 1 #define OBD_FAIL_LDLM_BL_CALLBACK 0x305 - do_facet client sysctl -w lustre.fail_loc=0x80000305 # drop cb, evict + do_facet client lctl set_param fail_loc=0x80000305 # drop cb, evict cancel_lru_locks mdc usleep 500 # wait to ensure first client is one that will be evicted openfile -f O_RDONLY $MOUNT2/$tdir/f0 wait $OPENPID dmesg | grep "entering recovery in server" && \ error "client not evicted" || true - do_facet client "sysctl -w lustre.fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet client "lctl set_param fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" } run_test 18 "ldlm_handle_enqueue succeeds on evicted export (3822)" diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index defcf05..cd9e4df 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -36,7 +36,7 @@ test_0a() { zconf_umount `hostname` $MOUNT -f # needs to run during initial client->OST connection #define OBD_FAIL_OST_ALL_REPLY_NET 0x211 - do_facet ost "sysctl -w lustre.fail_loc=0x80000211" + do_facet ost "lctl set_param fail_loc=0x80000211" zconf_mount `hostname` $MOUNT && df $MOUNT || error "0a mount fail" } run_test 0a "target handle mismatch (bug 5317) `date +%H:%M:%S`" @@ -130,7 +130,7 @@ test_6() { sleep 2 # ensure we have a fresh statfs sync #define OBD_FAIL_MDS_REINT_NET_REP 0x119 - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" after_dd=`kbytesfree` log "before: $before after_dd: $after_dd" (( $before > $after_dd )) || return 1 diff --git a/lustre/tests/replay-single-lmv.sh b/lustre/tests/replay-single-lmv.sh index fbc53c9..c053978 100755 --- a/lustre/tests/replay-single-lmv.sh +++ b/lustre/tests/replay-single-lmv.sh @@ -21,7 +21,7 @@ SETUP=${SETUP:-"setup"} CLEANUP=${CLEANUP:-"stopall"} if [ "$ONLY" == "cleanup" ]; then - sysctl -w lnet.debug=0 || true + lctl set_param debug=0 || true $CLEANUP exit 0 fi diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index e7e716a..25c244a 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -158,9 +158,9 @@ run_test 3a "replay failed open(O_DIRECTORY)" test_3b() { replay_barrier $SINGLEMDS #define OBD_FAIL_MDS_OPEN_PACK | OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000114" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000114" touch $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" fail $SINGLEMDS $CHECKSTAT -t file $DIR/$tfile && return 2 return 0 @@ -170,9 +170,9 @@ run_test 3b "replay failed open -ENOMEM" test_3c() { replay_barrier $SINGLEMDS #define OBD_FAIL_MDS_ALLOC_OBDO | OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000128" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000128" touch $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" fail $SINGLEMDS $CHECKSTAT -t file $DIR/$tfile && return 2 @@ -746,7 +746,7 @@ test_35() { touch $DIR/$tfile #define OBD_FAIL_MDS_REINT_NET_REP 0x119 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" rm -f $DIR/$tfile & sleep 1 sync @@ -827,7 +827,7 @@ test_40(){ sleep 1 facet_failover $SINGLEMDS #define OBD_FAIL_MDS_CONNECT_NET 0x117 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000117" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000117" kill -USR1 $PID stat1=`count_ost_writes` sleep $TIMEOUT @@ -887,7 +887,7 @@ test_42() { replay_barrier ost1 unlinkmany $DIR/$tfile-%d 0 400 debugsave - sysctl -w lnet.debug=-1 + lctl set_param debug=-1 facet_failover ost1 # osc is evicted, fs is smaller (but only with failout OSTs (bug 7287) @@ -906,10 +906,10 @@ test_43() { # bug 2530 replay_barrier $SINGLEMDS # OBD_FAIL_OST_CREATE_NET 0x204 - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204" + do_facet ost1 "lctl set_param fail_loc=0x80000204" fail $SINGLEMDS sleep 10 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" return 0 } @@ -920,11 +920,11 @@ test_44() { [ "$mdcdev" ] || exit 2 for i in `seq 1 10`; do #define OBD_FAIL_TGT_CONN_RACE 0x701 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000701" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000701" $LCTL --device $mdcdev recover df $MOUNT done - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" return 0 } run_test 44 "race in target handle connect" @@ -934,11 +934,11 @@ test_44b() { [ "$mdcdev" ] || exit 2 for i in `seq 1 10`; do #define OBD_FAIL_TGT_DELAY_RECONNECT 0x704 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000704" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000704" $LCTL --device $mdcdev recover df $MOUNT done - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" return 0 } run_test 44b "race in target handle connect" @@ -986,7 +986,7 @@ test_47() { # bug 2824 # OBD_FAIL_OST_CREATE_NET 0x204 fail ost1 - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204" + do_facet ost1 "lctl set_param fail_loc=0x80000204" df $MOUNT || return 2 # let the MDS discover the OST failure, attempt to recover, fail @@ -997,7 +997,7 @@ test_47() { # bug 2824 createmany -o $DIR/$tfile 20 || return 3 unlinkmany $DIR/$tfile 20 || return 4 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" return 0 } run_test 47 "MDS->OSC failure during precreate cleanup (2824)" @@ -1007,13 +1007,13 @@ test_48() { createmany -o $DIR/$tfile 20 || return 1 # OBD_FAIL_OST_EROFS 0x216 fail $SINGLEMDS - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000216" + do_facet ost1 "lctl set_param fail_loc=0x80000216" df $MOUNT || return 2 createmany -o $DIR/$tfile 20 20 || return 2 unlinkmany $DIR/$tfile 40 || return 3 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" return 0 } run_test 48 "MDS->OSC failure during precreate cleanup (2824)" @@ -1036,9 +1036,9 @@ test_52() { multiop $DIR/$tfile s || return 1 replay_barrier $SINGLEMDS #define OBD_FAIL_LDLM_REPLY 0x30c - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000030c" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000030c" fail $SINGLEMDS || return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x0" $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true } @@ -1054,10 +1054,10 @@ test_53a() { sleep 1 #define OBD_FAIL_MDS_CLOSE_NET 0x115 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc # force the close - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" mcreate $DIR/${tdir}-2/f || return 1 @@ -1081,12 +1081,12 @@ test_53b() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET 0x107 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks mdc # force the close wait $close_pid || return 1 @@ -1110,13 +1110,13 @@ test_53c() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET 0x107 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 #define OBD_FAIL_MDS_CLOSE_NET 0x115 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc # force the close @@ -1126,7 +1126,7 @@ test_53c() { sleep 2 # close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1143,10 +1143,10 @@ test_53d() { sleep 1 #define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f" kill -USR1 $close_pid cancel_lru_locks mdc # force the close - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" mcreate $DIR/${tdir}-2/f || return 1 # close should still be here @@ -1167,12 +1167,12 @@ test_53e() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET_REP 0x119 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x119" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks mdc # force the close wait $close_pid || return 1 @@ -1196,13 +1196,13 @@ test_53f() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET_REP 0x119 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x119" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 #define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f" kill -USR1 $close_pid cancel_lru_locks mdc # force the close @@ -1212,7 +1212,7 @@ test_53f() { sleep 2 # close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1227,17 +1227,17 @@ test_53g() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET_REP 0x119 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x119" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 #define OBD_FAIL_MDS_CLOSE_NET 0x115 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc # force the close - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" replay_barrier_nodf $SINGLEMDS fail_nodf $SINGLEMDS wait $open_pid || return 1 @@ -1258,13 +1258,13 @@ test_53h() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET 0x107 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 #define OBD_FAIL_MDS_CLOSE_NET_REP 0x13f - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000013f" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000013f" kill -USR1 $close_pid cancel_lru_locks mdc # force the close sleep 1 @@ -1275,7 +1275,7 @@ test_53h() { sleep 2 # close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1288,11 +1288,11 @@ run_test 53h "|X| open request and close reply while two MDC requests in flight" #b3761 ASSERTION(hash != 0) failed test_55() { # OBD_FAIL_MDS_OPEN_CREATE | OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012b" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012b" touch $DIR/$tfile & # give touch a chance to run sleep 5 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x0" rm $DIR/$tfile return 0 } @@ -1311,13 +1311,13 @@ run_test 56 "don't replay a symlink open request (3440)" #recovery one mds-ost setattr from llog test_57() { #define OBD_FAIL_MDS_OST_SETATTR 0x12c - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012c" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012c" touch $DIR/$tfile replay_barrier $SINGLEMDS fail $SINGLEMDS sleep 1 $CHECKSTAT -t file $DIR/$tfile || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x0" rm $DIR/$tfile } run_test 57 "test recovery from llog for setattr op" @@ -1325,13 +1325,13 @@ run_test 57 "test recovery from llog for setattr op" #recovery many mds-ost setattr from llog test_58() { #define OBD_FAIL_MDS_OST_SETATTR 0x12c - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012c" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012c" createmany -o $DIR/$tdir/$tfile-%d 2500 replay_barrier $SINGLEMDS fail $SINGLEMDS sleep 2 $CHECKSTAT -t file $DIR/$tdir/$tfile-* >/dev/null || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x0" unlinkmany $DIR/$tdir/$tfile-%d 2500 rmdir $DIR/$tdir } @@ -1344,10 +1344,10 @@ test_59() { sync unlinkmany $DIR/$tdir/$tfile-%d 200 #define OBD_FAIL_PTLRPC_DELAY_RECOV 0x507 - do_facet ost1 "sysctl -w lustre.fail_loc=0x507" + do_facet ost1 "lctl set_param fail_loc=0x507" fail ost1 fail $SINGLEMDS - do_facet ost1 "sysctl -w lustre.fail_loc=0x0" + do_facet ost1 "lctl set_param fail_loc=0x0" sleep 20 rmdir $DIR/$tdir } @@ -1388,7 +1388,7 @@ run_test 61 "test race llog recovery vs llog cleanup" #test race mds llog sync vs llog cleanup test_61b() { # OBD_FAIL_MDS_LLOG_SYNC_TIMEOUT 0x140 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000140" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140" facet_failover $SINGLEMDS sleep 10 fail $SINGLEMDS diff --git a/lustre/tests/sanity-lmv.sh b/lustre/tests/sanity-lmv.sh index fecae0e..490b338 100644 --- a/lustre/tests/sanity-lmv.sh +++ b/lustre/tests/sanity-lmv.sh @@ -169,7 +169,7 @@ run_test() { [ "$SANITYLOG" ] && rm -f $SANITYLOG || true error() { - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 log "FAIL: $TESTNAME $@" $LCTL dk $TMP/lustre-log-$TESTNAME.log if [ "$SANITYLOG" ]; then diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4bb6b1f..2010e9c 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -143,8 +143,8 @@ echo # add a newline after mke2fs. umask 077 -OLDDEBUG="`sysctl -n lnet.debug 2> /dev/null`" -sysctl -w lnet.debug=-1 2> /dev/null || true +OLDDEBUG="`lctl get_param -n debug 2> /dev/null`" +lctl set_param debug=-1 2> /dev/null || true test_0() { touch $DIR/$tfile $CHECKSTAT -t file $DIR/$tfile || error @@ -917,7 +917,7 @@ reset_enospc() { [ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0 mkdir -p $DIR/d27/nospc rmdir $DIR/d27/nospc - sysctl -w lustre.fail_loc=$FAIL_LOC + lctl set_param fail_loc=$FAIL_LOC } exhaust_precreations() { @@ -932,7 +932,7 @@ exhaust_precreations() { mkdir -p $DIR/d27/${OST} $SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1 #define OBD_FAIL_OST_ENOSPC 0x215 - sysctl -w lustre.fail_loc=0x215 + lctl set_param fail_loc=0x215 echo "Creating to objid $last_id on ost $OST..." createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2)) lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc* | grep '[0-9]' @@ -1053,10 +1053,10 @@ test_27u() { # bug 4900 #define OBD_FAIL_MDS_OSC_PRECREATE 0x13d - sysctl -w lustre.fail_loc=0x13d + lctl set_param fail_loc=0x13d mkdir -p $DIR/d27u createmany -o $DIR/d27u/t- 1000 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 TLOG=$DIR/$tfile.getstripe $GETSTRIPE $DIR/d27u > $TLOG @@ -1078,15 +1078,15 @@ test_27v() { # bug 4900 touch $DIR/$tdir/$tfile #define OBD_FAIL_TGT_DELAY_PRECREATE 0x705 - sysctl -w lustre.fail_loc=0x705 + lctl set_param fail_loc=0x705 START=`date +%s` for F in `seq 1 32`; do touch $DIR/$tdir/$tfile.$F done - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 FINISH=`date +%s` - TIMEOUT=`sysctl -n lustre.timeout` + TIMEOUT=`lctl get_param -n timeout` [ $((FINISH - START)) -ge $((TIMEOUT / 2)) ] && \ error "$FINISH - $START >= $TIMEOUT / 2" @@ -1649,7 +1649,7 @@ test_36f() { DATESTR="Dec 20 2000" mkdir -p $DIR/$tdir #define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214 - sysctl -w lustre.fail_loc=0x80000214 + lctl set_param fail_loc=0x80000214 date; date +%s cp /etc/hosts $DIR/$tdir/$tfile sync & # write RPC generated with "current" inode timestamp, but delayed @@ -2070,7 +2070,7 @@ run_test 48b "Access removed working dir (should return errors)=" test_48c() { # bug 2350 check_kernel_version 36 || return 0 - #sysctl -w lnet.debug=-1 + #lctl set_param debug=-1 #set -vx mkdir -p $DIR/d48c/dir cd $DIR/d48c/dir @@ -2093,7 +2093,7 @@ run_test 48c "Access removed working subdir (should return errors)" test_48d() { # bug 2350 check_kernel_version 36 || return 0 - #sysctl -w lnet.debug=-1 + #lctl set_param debug=-1 #set -vx mkdir -p $DIR/d48d/dir cd $DIR/d48d/dir @@ -2117,7 +2117,7 @@ run_test 48d "Access removed parent subdir (should return errors)" test_48e() { # bug 4134 check_kernel_version 41 || return 0 - #sysctl -w lnet.debug=-1 + #lctl set_param debug=-1 #set -vx mkdir -p $DIR/d48e/dir cd $DIR/d48e/dir @@ -2663,9 +2663,9 @@ test_60c() { echo "create 5000 files" createmany -o $DIR/f60c- 5000 #define OBD_FAIL_MDS_LLOG_CREATE_FAILED 0x13c - sysctl -w lustre.fail_loc=0x8000013c + lctl set_param fail_loc=0x8000013c unlinkmany $DIR/f60c- 5000 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 } run_test 60c "unlink file when mds full" @@ -2677,14 +2677,14 @@ test_60d() { $LCTL mark "$MESSAGE" || error "$LCTL mark failed" dmesg | grep -q "$MESSAGE" || error "didn't find debug marker in log" - lctl set_param -n printk=0 || error "set lnet.printk failed" + lctl set_param printk=0 || error "set lnet.printk failed" lctl get_param -n printk | grep emerg || error "lnet.printk dropped emerg" MESSAGE="new test message ID $RANDOM $$" # Assume here that libcfs_debug_mark_buffer() uses D_WARNING $LCTL mark "$MESSAGE" || error "$LCTL mark failed" dmesg | grep -q "$MESSAGE" && error "D_WARNING wasn't masked" || true - sysctl -w lnet.printk="$SAVEPRINTK" + lctl set_param -n printk="$SAVEPRINTK" } run_test 60d "test printk console message masking" @@ -2702,9 +2702,9 @@ test_62() { f="$DIR/f62" echo foo > $f cancel_lru_locks osc - sysctl -w lustre.fail_loc=0x405 + lctl set_param fail_loc=0x405 cat $f && error "cat succeeded, expect -EIO" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 } run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)" @@ -2728,14 +2728,14 @@ run_test 63 "Verify oig_wait interruption does not crash =======" # bug 3677 - async write errors left page locked test_63b() { debugsave - sysctl -w lnet.debug=-1 + lctl set_param debug=-1 # ensure we have a grant to do async writes dd if=/dev/zero of=$DIR/$tfile bs=4k count=1 rm $DIR/$tfile #define OBD_FAIL_OSC_BRW_PREP_REQ 0x406 - sysctl -w lustre.fail_loc=0x80000406 + lctl set_param fail_loc=0x80000406 multiop $DIR/$tfile Owy && \ error "sync didn't return ENOMEM" sync; sleep 2; sync # do a real sync this time to flush page @@ -2967,20 +2967,20 @@ test_69() { $DIRECTIO write ${f}.2 0 1 || error "directio write error" - sysctl -w lustre.fail_loc=0x217 + lctl set_param fail_loc=0x217 truncate $f 1 # vmtruncate() will ignore truncate() error. $DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 $DIRECTIO write $f 0 2 || error "write error" cancel_lru_locks osc $DIRECTIO read $f 0 1 || error "read error" - sysctl -w lustre.fail_loc=0x217 + lctl set_param fail_loc=0x217 $DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 rm -f $f } run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======" @@ -3041,10 +3041,10 @@ test_73() { multiop_bg_pause $DIR/d73-1/f73-1 O_c || return 1 pid1=$! - lctl set_param -n fail_loc=0x80000129 + lctl set_param fail_loc=0x80000129 multiop $DIR/d73-1/f73-2 Oc & sleep 1 - lctl set_param -n fail_loc=0 + lctl set_param fail_loc=0 multiop $DIR/d73-2/f73-3 Oc & pid3=$! @@ -3068,10 +3068,10 @@ test_74a() { # bug 6149, 6184 # very important to OR with OBD_FAIL_ONCE (0x80000000) -- otherwise it # will spin in a tight reconnection loop touch $DIR/f74a - sysctl -w lustre.fail_loc=0x8000030e + lctl set_param fail_loc=0x8000030e # get any lock that won't be difficult - lookup works. ls $DIR/f74a - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 true } run_test 74a "ldlm_enqueue freed-export error path, ls (shouldn't LBUG)" @@ -3081,10 +3081,10 @@ test_74b() { # bug 13310 # # very important to OR with OBD_FAIL_ONCE (0x80000000) -- otherwise it # will spin in a tight reconnection loop - sysctl -w lustre.fail_loc=0x8000030e + lctl set_param fail_loc=0x8000030e # get a "difficult" lock touch $DIR/f74b - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 true } run_test 74b "ldlm_enqueue freed-export error path, touch (shouldn't LBUG)" @@ -3284,11 +3284,11 @@ run_test 77a "normal checksum read/write operation =============" test_77b() { # bug 10889 [ ! -f $F77_TMP ] && setup_f77 #define OBD_FAIL_OSC_CHECKSUM_SEND 0x409 - sysctl -w lustre.fail_loc=0x80000409 + lctl set_param fail_loc=0x80000409 set_checksums 1 dd if=$F77_TMP of=$DIR/f77b bs=1M count=$F77SZ conv=sync || \ error "dd error: $?" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 set_checksums 0 } run_test 77b "checksum error on client write ====================" @@ -3300,9 +3300,9 @@ test_77c() { # bug 10889 cancel_lru_locks osc set_checksum_type $algo #define OBD_FAIL_OSC_CHECKSUM_RECEIVE 0x408 - sysctl -w lustre.fail_loc=0x80000408 + lctl set_param fail_loc=0x80000408 cmp $F77_TMP $DIR/f77b || error "file compare failed" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 done set_checksums 0 set_checksum_type $ORIG_CSUM_TYPE @@ -3311,11 +3311,11 @@ run_test 77c "checksum error on client read ===================" test_77d() { # bug 10889 #define OBD_FAIL_OSC_CHECKSUM_SEND 0x409 - sysctl -w lustre.fail_loc=0x80000409 + lctl set_param fail_loc=0x80000409 set_checksums 1 directio write $DIR/f77 0 $F77SZ $((1024 * 1024)) || \ error "direct write: rc=$?" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 set_checksums 0 } run_test 77d "checksum error on OST direct write ===============" @@ -3323,12 +3323,12 @@ run_test 77d "checksum error on OST direct write ===============" test_77e() { # bug 10889 [ ! -f $DIR/f77 ] && skip "requires 77d - skipping" && return #define OBD_FAIL_OSC_CHECKSUM_RECEIVE 0x408 - sysctl -w lustre.fail_loc=0x80000408 + lctl set_param fail_loc=0x80000408 set_checksums 1 cancel_lru_locks osc directio read $DIR/f77 0 $F77SZ $((1024 * 1024)) || \ error "direct read: rc=$?" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 set_checksums 0 } run_test 77e "checksum error on OST direct read ================" @@ -3339,10 +3339,10 @@ test_77f() { # bug 10889 cancel_lru_locks osc set_checksum_type $algo #define OBD_FAIL_OSC_CHECKSUM_SEND 0x409 - sysctl -w lustre.fail_loc=0x409 + lctl set_param fail_loc=0x409 directio write $DIR/f77 0 $F77SZ $((1024 * 1024)) && \ error "direct write succeeded" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 done set_checksum_type $ORIG_CSUM_TYPE set_checksums 0 @@ -3354,11 +3354,11 @@ test_77g() { # bug 10889 skip "remote OST" && return [ ! -f $F77_TMP ] && setup_f77 #define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a - sysctl -w lustre.fail_loc=0x8000021a + lctl set_param fail_loc=0x8000021a set_checksums 1 dd if=$F77_TMP of=$DIR/f77 bs=1M count=$F77SZ || \ error "write error: rc=$?" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 set_checksums 0 } run_test 77g "checksum error on OST write ======================" @@ -3369,19 +3369,19 @@ test_77h() { # bug 10889 [ ! -f $DIR/f77 ] && skip "requires 77g - skipping" && return cancel_lru_locks osc #define OBD_FAIL_OST_CHECKSUM_SEND 0x21b - sysctl -w lustre.fail_loc=0x8000021b + lctl set_param fail_loc=0x8000021b set_checksums 1 cmp $F77_TMP $DIR/f77 || error "file compare failed" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 set_checksums 0 } run_test 77h "checksum error on OST read =======================" test_77i() { # bug 13805 #define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b - sysctl -w lustre.fail_loc=0x40b + lctl set_param fail_loc=0x40b remount_client $MOUNT - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do PARAM=`echo ${VALUE[0]} | cut -d "=" -f1` algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'` @@ -3393,9 +3393,9 @@ run_test 77i "client not supporting OSD_CONNECT_CKSUM ==========" test_77j() { # bug 13805 #define OBD_FAIL_OSC_CKSUM_ADLER_ONLY 0x40c - sysctl -w lustre.fail_loc=0x40c + lctl set_param fail_loc=0x40c remount_client $MOUNT - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do PARAM=`echo ${VALUE[0]} | cut -d "=" -f1` algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'` @@ -4199,9 +4199,9 @@ test_117() # bug 10891 { dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 #define OBD_FAIL_OST_SETATTR_CREDITS 0x21e - sysctl -w lustre.fail_loc=0x21e + lctl set_param fail_loc=0x21e > $DIR/$tfile || error "truncate failed" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 echo "Truncate succeeded." } run_test 117 "verify fsfilt_extend ==========" @@ -4365,7 +4365,7 @@ test_118f() { reset_async #define OBD_FAIL_OSC_BRW_PREP_REQ2 0x40a - sysctl -w lustre.fail_loc=0x8000040a + lctl set_param fail_loc=0x8000040a # Should simulate EINVAL error which is fatal multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c @@ -4374,7 +4374,7 @@ test_118f() { error "Must return error due to dropped pages, rc=$RC" fi - sysctl -w lustre.fail_loc=0x0 + lctl set_param fail_loc=0x0 LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked) DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty) @@ -4397,24 +4397,24 @@ test_118f() { run_test 118f "Simulate unrecoverable OSC side error ==========" test_118g() { - reset_async + reset_async #define OBD_FAIL_OSC_BRW_PREP_REQ 0x406 - sysctl -w lustre.fail_loc=0x406 + lctl set_param fail_loc=0x406 # simulate local -ENOMEM - multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c - RC=$? + multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c + RC=$? - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 if [[ $RC -eq 0 ]]; then error "Must return error due to dropped pages, rc=$RC" fi - LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked) - DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty) - WRITEBACK=$(lctl get_param -n llite.*.dump_page_cache | - grep -c writeback) + LOCKED=$(lctl get_param -n llite.*.dump_page_cache | grep -c locked) + DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty) + WRITEBACK=$(lctl get_param -n llite.*.dump_page_cache | + grep -c writeback) if [[ $LOCKED -ne 0 ]]; then error "Locked pages remain in cache, locked=$LOCKED" fi @@ -4426,7 +4426,7 @@ test_118g() { rm -f $DIR/$tfile echo "No pages locked after fsync" - reset_async + reset_async return 0 } run_test 118g "Don't stay in wait if we got local -ENOMEM ==========" @@ -4777,10 +4777,10 @@ test_121() { #bug #10589 rm -rf $DIR/$tfile writes=$(LANG=C dd if=/dev/zero of=$DIR/$tfile count=1 2>&1 | awk -F '+' '/out/ {print $1}') #define OBD_FAIL_LDLM_CANCEL_RACE 0x310 - sysctl -w lustre.fail_loc=0x310 + lctl set_param fail_loc=0x310 cancel_lru_locks osc > /dev/null reads=$(LANG=C dd if=$DIR/$tfile of=/dev/null 2>&1 | awk -F '+' '/in/ {print $1}') - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 [ "$reads" -eq "$writes" ] || error "read" $reads "blocks, must be" $writes } run_test 121 "read cancel race =========" @@ -4855,10 +4855,10 @@ test_123b () { # statahead(bug 15027) cancel_lru_locks osc #define OBD_FAIL_MDC_GETATTR_ENQUEUE 0x803 - sysctl -w lustre.fail_loc=0x80000803 + lctl set_param fail_loc=0x80000803 ls -lR $DIR/$tdir > /dev/null log "ls done" - sysctl -w lustre.fail_loc=0x0 + lctl set_param fail_loc=0x0 lctl get_param -n llite.*.statahead_stats rm -r $DIR/$tdir sync @@ -5117,7 +5117,7 @@ HOME=$OLDHOME log "cleanup: ======================================================" check_and_cleanup_lustre if [ "$I_MOUNTED" != "yes" ]; then - sysctl -w lnet.debug="$OLDDEBUG" 2> /dev/null || true + lctl set_param debug="$OLDDEBUG" 2> /dev/null || true fi echo '=========================== finished ===============================' diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index 777dec8..6bbf940 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -337,7 +337,7 @@ test_17() { # bug 3513, 3667 cp /etc/termcap $DIR1/f17 cancel_lru_locks osc > /dev/null #define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE 0x30a - sysctl -w lustre.fail_loc=0x8000030a + lctl set_param fail_loc=0x8000030a ls -ls $DIR1/f17 | awk '{ print $1,$6 }' > $DIR1/f17-1 & \ ls -ls $DIR2/f17 | awk '{ print $1,$6 }' > $DIR2/f17-2 wait @@ -576,7 +576,7 @@ run_test 28 "read/write/truncate file with lost stripes" test_29() { # bug 10999 touch $DIR1/$tfile #define OBD_FAIL_LDLM_GLIMPSE 0x30f - sysctl -w lustre.fail_loc=0x8000030f + lctl set_param fail_loc=0x8000030f ls -l $DIR2/$tfile & usleep 500 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 @@ -601,7 +601,7 @@ test_31() { writes=`LANG=C dd if=/dev/zero of=$DIR/$tdir/$tfile count=1 2>&1 | awk 'BEGIN { FS="+" } /out/ {print $1}'` #define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314 - sysctl -w lustre.fail_loc=0x314 + lctl set_param fail_loc=0x314 reads=`LANG=C dd if=$DIR2/$tdir/$tfile of=/dev/null 2>&1 | awk 'BEGIN { FS="+" } /in/ {print $1}'` [ $reads -eq $writes ] || error "read" $reads "blocks, must be" $writes diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 8ffc340..dc97eb3 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -182,8 +182,8 @@ load_modules() { echo Loading modules from $LUSTRE load_module ../lnet/libcfs/libcfs - [ "$PTLDEBUG" ] && sysctl -w lnet.debug=$PTLDEBUG - [ "$SUBSYSTEM" ] && sysctl -w lnet.subsystem_debug=${SUBSYSTEM# } + [ "$PTLDEBUG" ] && lctl set_param debug=$PTLDEBUG + [ "$SUBSYSTEM" ] && lctl set_param subsystem_debug=${SUBSYSTEM# } [ -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf [ -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre [ -z "$LNETOPTS" -a -n "$MODPROBECONF" ] && \ @@ -409,9 +409,9 @@ mount_facet() { echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}" echo "Start of ${device} on ${facet} failed ${RC}" else - do_facet ${facet} "sysctl -w lnet.debug=$PTLDEBUG; \ - sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; \ - sysctl -w lnet.debug_mb=${DEBUG_SIZE}; \ + do_facet ${facet} "lctl set_param debug=$PTLDEBUG; \ + lctl set_param subsystem_debug=${SUBSYSTEM# }; \ + lctl set_param debug_mb=${DEBUG_SIZE}; \ sync" fi return $RC @@ -473,9 +473,9 @@ zconf_mount() { do_node $client mkdir -p $mnt do_node $client mount -t lustre $OPTIONS $device $mnt || return 1 - do_node $client "sysctl -w lnet.debug=$PTLDEBUG; - sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; - sysctl -w lnet.debug_mb=${DEBUG_SIZE}" + do_node $client "lctl set_param debug=$PTLDEBUG; + lctl set_param subsystem_debug=${SUBSYSTEM# }; + lctl set_param debug_mb=${DEBUG_SIZE}" [ -d /r ] && $LCTL modules > /r/tmp/ogdb-$HOSTNAME return 0 } @@ -596,7 +596,7 @@ wait_for() { } wait_mds_recovery_done () { - local timeout=`do_facet mds sysctl -n lustre.timeout` + local timeout=`do_facet mds lctl get_param -n timeout` #define OBD_RECOVERY_TIMEOUT (obd_timeout * 5 / 2) # as we are in process of changing obd_timeout in different ways # let's set MAX longer than that @@ -1021,7 +1021,7 @@ set_obd_timeout() { do_facet $facet lsmod | grep -q obdclass || \ do_facet $facet "modprobe obdclass" - do_facet $facet "sysctl -w lustre.timeout=$timeout" + do_facet $facet "lctl set_param timeout=$timeout" } setupall() { @@ -1086,7 +1086,7 @@ check_and_setup_lustre() { cleanup_and_setup_lustre() { if [ "$ONLY" == "cleanup" -o "`mount | grep $MOUNT`" ]; then - sysctl -w lnet.debug=0 || true + lctl set_param debug=0 || true cleanupall if [ "$ONLY" == "cleanup" ]; then exit 0 @@ -1154,64 +1154,64 @@ absolute_path() { drop_request() { # OBD_FAIL_MDS_ALL_REQUEST_NET RC=0 - do_facet mds sysctl -w lustre.fail_loc=0x123 + do_facet mds lctl set_param fail_loc=0x123 do_facet client "$1" || RC=$? - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 return $RC } drop_reply() { # OBD_FAIL_MDS_ALL_REPLY_NET RC=0 - do_facet mds sysctl -w lustre.fail_loc=0x122 + do_facet mds lctl set_param fail_loc=0x122 do_facet client "$@" || RC=$? - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 return $RC } drop_reint_reply() { # OBD_FAIL_MDS_REINT_NET_REP RC=0 - do_facet mds sysctl -w lustre.fail_loc=0x119 + do_facet mds lctl set_param fail_loc=0x119 do_facet client "$@" || RC=$? - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 return $RC } pause_bulk() { #define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214 RC=0 - do_facet ost1 sysctl -w lustre.fail_loc=0x214 + do_facet ost1 lctl set_param fail_loc=0x214 do_facet client "$1" || RC=$? do_facet client "sync" - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 return $RC } drop_ldlm_cancel() { #define OBD_FAIL_LDLM_CANCEL 0x304 RC=0 - do_facet client sysctl -w lustre.fail_loc=0x304 + do_facet client lctl set_param fail_loc=0x304 do_facet client "$@" || RC=$? - do_facet client sysctl -w lustre.fail_loc=0 + do_facet client lctl set_param fail_loc=0 return $RC } drop_bl_callback() { #define OBD_FAIL_LDLM_BL_CALLBACK 0x305 RC=0 - do_facet client sysctl -w lustre.fail_loc=0x305 + do_facet client lctl set_param fail_loc=0x305 do_facet client "$@" || RC=$? - do_facet client sysctl -w lustre.fail_loc=0 + do_facet client lctl set_param fail_loc=0 return $RC } drop_ldlm_reply() { #define OBD_FAIL_LDLM_REPLY 0x30c RC=0 - do_facet mds sysctl -w lustre.fail_loc=0x30c + do_facet mds lctl set_param fail_loc=0x30c do_facet client "$@" || RC=$? - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 return $RC } @@ -1220,7 +1220,7 @@ clear_failloc() { pause=$2 sleep $pause echo "clearing fail_loc on $facet" - do_facet $facet "sysctl -e -w lustre.fail_loc=0" + do_facet $facet "lctl set_param fail_loc=0 2>/dev/null || true" } set_nodes_failloc () { @@ -1228,7 +1228,7 @@ set_nodes_failloc () { local node for node in $nodes ; do - do_node $node sysctl -w lustre.fail_loc=$2 + do_node $node lctl set_param fail_loc=$2 done } @@ -1283,11 +1283,11 @@ pgcache_empty() { } debugsave() { - DEBUGSAVE="$(sysctl -n lnet.debug)" + DEBUGSAVE="$(lctl get_param -n debug)" } debugrestore() { - [ -n "$DEBUGSAVE" ] && sysctl -w lnet.debug="${DEBUGSAVE}" + [ -n "$DEBUGSAVE" ] && lctl set_param debug="${DEBUGSAVE}" DEBUGSAVE="" } @@ -1298,7 +1298,7 @@ debugrestore() { error_noexit() { local TYPE=${TYPE:-"FAIL"} local ERRLOG - sysctl -e -w lustre.fail_loc=0 || true + lctl set_param fail_loc=0 2>/dev/null || true log " ${TESTSUITE} ${TESTNAME}: @@@@@@ ${TYPE}: $@ " ERRLOG=$TMP/lustre_${TESTSUITE}_${TESTNAME}.$(date +%s) echo "Dumping lctl log to $ERRLOG" @@ -1456,7 +1456,7 @@ reset_fail_loc () { local NODE for NODE in $myNODES; do - do_node $NODE sysctl -e -w lustre.fail_loc=0 || true + do_node $NODE "lctl set_param fail_loc=0 2>/dev/null || true" done }