diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 1163049dd1c232fa525b08c83b9c1d97bd4db37d..5a3b1d2c3e8b4c53c1b92d0111a57174fe7797ad 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" diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index c4eefb4b5d36a4a54b15cf329d661d83fafee3f2..cd59df25b69b7446abbccdeeee0ea3fb9a5df722 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -329,7 +329,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 $? @@ -366,17 +366,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 @@ -876,7 +876,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 } @@ -970,7 +970,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) @@ -1160,7 +1160,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 @@ -1228,7 +1228,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 @@ -1305,8 +1305,8 @@ test_33b() { # was test_33a 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 } @@ -1363,7 +1363,7 @@ test_35() { # bug 12459 setup debugsave - sysctl -w lnet.debug="ha" + lctl set_param debug="ha" log "Set up a fake failnode for the MDS" FAKENID="127.0.0.2" @@ -1573,7 +1573,7 @@ run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages" test_40() { # bug 15759 start_ost #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706 - do_facet mds "sysctl -w lustre.fail_loc=0x80000706" + do_facet mds "lctl set_param fail_loc=0x80000706" start_mds cleanup } diff --git a/lustre/tests/llog-test.sh b/lustre/tests/llog-test.sh index 56c7f0a36e8a1132db6d546dc4754f361a4db34f..1de2b4f9c7a1e8058c6819687f5011f24b72c55c 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 13b61eab464337ad1a207aacdbb35e4fe4b21dbf..dda094d6b4d0bb6421627b30ca84fe1c73851bcc 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -126,7 +126,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 mds "sysctl -w lustre.fail_loc=0x115" + do_facet mds "lctl set_param fail_loc=0x115" clear_failloc mds $((TIMEOUT * 2)) & multiop_bg_pause $MOUNT/$tfile OS_c || return 1 PID=$! @@ -143,9 +143,9 @@ test_13() { mkdir $MOUNT/readdir || return 1 touch $MOUNT/readdir/newentry || return # OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE - do_facet mds "sysctl -w lustre.fail_loc=0x80000104" + do_facet mds "lctl set_param fail_loc=0x80000104" ls $MOUNT/readdir || return 3 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" rm -rf $MOUNT/readdir || return 4 } run_test 13 "mdc_readpage restart test (bug 1138)" @@ -155,14 +155,14 @@ test_14() { mkdir $MOUNT/readdir touch $MOUNT/readdir/newentry # OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE - do_facet mds "sysctl -w lustre.fail_loc=0x80000106" + do_facet mds "lctl set_param fail_loc=0x80000106" ls $MOUNT/readdir || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" } run_test 14 "mdc_readpage resend test (bug 1138)" test_15() { - do_facet mds "sysctl -w lustre.fail_loc=0x80000128" + do_facet mds "lctl set_param fail_loc=0x80000128" touch $DIR/$tfile && return 1 return 0 } @@ -183,11 +183,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 $SAMPLE_FILE $MOUNT/${SAMPLE_FILE##*/}" || 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 $SAMPLE_FILE $MOUNT/${SAMPLE_FILE##*/}" || return 2 @@ -206,7 +206,7 @@ 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 $SAMPLE_FILE $DIR/$tfile sync @@ -215,7 +215,7 @@ test_17() { # expiring the req, hopefully timeout*2 is enough sleep $(($TIMEOUT*2)) - 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 $SAMPLE_FILE $DIR/$tfile" || return 3 @@ -297,7 +297,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 @@ -343,7 +343,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=$? @@ -356,7 +356,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 } @@ -368,18 +368,18 @@ test_21a() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000129" + do_facet mds "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "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 mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 3 $CHECKSTAT -t file $DIR/$tdir-2/f || return 4 @@ -394,11 +394,11 @@ test_21b() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks mdc @@ -417,19 +417,19 @@ test_21c() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 3 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "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 mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -443,16 +443,16 @@ test_21d() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000129" + do_facet mds "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000122" + do_facet mds "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -467,10 +467,10 @@ test_21e() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" kill -USR1 $pid cancel_lru_locks mdc @@ -489,16 +489,16 @@ test_21f() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000122" + do_facet mds "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -512,16 +512,16 @@ test_21g() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "lctl set_param fail_loc=0x80000115" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -535,17 +535,17 @@ test_21h() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" touch $DIR/$tdir-2/f & touch_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" - do_facet mds "sysctl -w lustre.fail_loc=0x80000122" + do_facet mds "lctl set_param fail_loc=0x80000122" cancel_lru_locks mdc kill -USR1 $pid wait $pid || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" wait $touch_pid || return 2 @@ -560,7 +560,7 @@ test_22() { f1=$DIR/${tfile}-1 f2=$DIR/${tfile}-2 - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "lctl set_param fail_loc=0x80000115" multiop $f2 Oc & close_pid=$! @@ -568,7 +568,7 @@ test_22() { multiop $f1 msu || return 1 cancel_lru_locks mdc - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" wait $close_pid || return 2 rm -rf $f2 || return 4 @@ -599,7 +599,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 } @@ -614,7 +614,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. @@ -623,7 +623,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 } @@ -662,10 +662,10 @@ test_27() { FAILURE_MODE="SOFT" facet_failover mds #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 @@ -681,7 +681,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_ADD_CLIENT 0x12f - do_facet mds sysctl -w lustre.fail_loc=0x8000012f + do_facet mds lctl set_param fail_loc=0x8000012f # fail once (evicted), reconnect fail (fail_loc), ok df || (sleep 1; df) || (sleep 1; df) || error "reconnect failed" rm -f $MOUNT/$tfile @@ -692,7 +692,7 @@ run_test 28 "handle error adding new clients (bug 6086)" test_50() { mkdir -p $DIR/$tdir debugsave - sysctl -w lnet.debug="-dlmtrace -ha" + lctl set_param debug="-dlmtrace -ha" # put a load of file creates/writes/deletes writemany -q $DIR/$tdir/$tfile 0 5 & CLIENT_PID=$! @@ -828,7 +828,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=$! @@ -847,7 +847,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 @@ -867,9 +867,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 mds sysctl -w lustre.fail_loc=0x80000136 + do_facet mds lctl set_param fail_loc=0x80000136 stat $DIR/$tfile - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 rm -f $DIR/$tfile } run_test 56 "do not allow reconnect to busy exports" @@ -886,12 +886,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 mds kill -9 $pid - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 mount_client $DIR do_facet client "df $DIR" } @@ -901,11 +901,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" @@ -915,11 +915,11 @@ run_test 58 "Eviction in the middle of open RPC reply processing" 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" - 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 5e499c7bd95d3fc34f207d70a6f642830db36abb..1e2a23abddd9d01561b943e06a70bbd13e3949c3 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 mds sysctl -w lustre.fail_loc=0x80000119 + do_facet mds lctl set_param fail_loc=0x80000119 fail mds - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds 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 mds sysctl -w lustre.fail_loc=0x80000119 + do_facet mds lctl set_param fail_loc=0x80000119 fail mds - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds 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 mds sysctl -w lustre.fail_loc=0x0119 + do_facet mds lctl set_param fail_loc=0x0119 # note that with this fail_loc set, facet_failover df will fail facet_failover mds #sleep for while, let both clients reconnect and timeout sleep $((TIMEOUT * 2)) - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 client_df while [ -z "$(ls $MOUNT1/$tfile-[1-5] 2>/dev/null)" ]; do sleep 5 @@ -202,9 +202,9 @@ test_12() { MULTIPID=$! #define OBD_FAIL_LDLM_ENQUEUE 0x302 - do_facet mds sysctl -w lustre.fail_loc=0x80000302 + do_facet mds lctl set_param fail_loc=0x80000302 facet_failover mds - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 df $MOUNT || { kill -USR1 $MULTIPID && return 1; } ls $DIR/$tfile @@ -227,9 +227,9 @@ test_13() { wait $MULTIPID || return 4 # drop close - do_facet mds sysctl -w lustre.fail_loc=0x80000115 + do_facet mds lctl set_param fail_loc=0x80000115 facet_failover mds - do_facet mds sysctl -w lustre.fail_loc=0 + do_facet mds lctl set_param fail_loc=0 df $MOUNT || return 1 ls $DIR/$tfile @@ -331,11 +331,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 mds 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 @@ -409,10 +409,10 @@ test_18() { # bug 3822 - evicting client with enqueued lock statmany -s $MOUNT1/$tdir/f 1 500 & OPENPID=$! NOW=`date +%s` - do_facet mds sysctl -w lustre.fail_loc=0x8000030b # hold enqueue + do_facet mds 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 sleep 0.500s # wait to ensure first client is one that will be evicted openfile -f O_RDONLY $MOUNT2/$tdir/f0 diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 8f5765e9c361d0466d1bdd217d9701c8cc159ff5..260ec07ef5aa659758d9288ea5b6d442a6b8c6c7 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.sh b/lustre/tests/replay-single.sh index b60f032d4588705dcdb391d2b2b07a1863a593c5..d758682c6973f42985833b255cccc98da113155a 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -56,7 +56,7 @@ test_1() { run_test 1 "simple create" test_1a() { - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" rm -fr $DIR/$tfile local old_last_id=`lctl get_param -n obdfilter.*.last_id` @@ -81,7 +81,7 @@ test_1a() { rm -fr $DIR/$tfile #define OBD_FAIL_OST_CROW_EIO | OBD_FAIL_ONCE - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000801" + do_facet ost1 "lctl set_param fail_loc=0x80000801" rm -fr $DIR/1a1 old_last_id=`lctl get_param -n obdfilter.*.last_id` @@ -95,7 +95,7 @@ test_1a() { rm -fr $DIR/1a1 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" } #CROW run_test 1a "CROW object create (check OST last_id)" @@ -131,9 +131,9 @@ run_test 3a "replay failed open(O_DIRECTORY)" test_3b() { replay_barrier mds #define OBD_FAIL_MDS_OPEN_PACK | OBD_FAIL_ONCE - do_facet mds "sysctl -w lustre.fail_loc=0x80000114" + do_facet mds "lctl set_param fail_loc=0x80000114" touch $DIR/$tfile - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" fail mds $CHECKSTAT -t file $DIR/$tfile && return 2 return 0 @@ -143,9 +143,9 @@ run_test 3b "replay failed open -ENOMEM" test_3c() { replay_barrier mds #define OBD_FAIL_MDS_ALLOC_OBDO | OBD_FAIL_ONCE - do_facet mds "sysctl -w lustre.fail_loc=0x80000128" + do_facet mds "lctl set_param fail_loc=0x80000128" touch $DIR/$tfile - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" fail mds $CHECKSTAT -t file $DIR/$tfile && return 2 @@ -703,7 +703,7 @@ test_35() { touch $DIR/$tfile #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" rm -f $DIR/$tfile & sleep 1 sync @@ -785,7 +785,7 @@ test_40(){ sleep 1 facet_failover mds #define OBD_FAIL_MDS_CONNECT_NET 0x117 - do_facet mds "sysctl -w lustre.fail_loc=0x80000117" + do_facet mds "lctl set_param fail_loc=0x80000117" kill -USR1 $PID stat1=`count_ost_writes` sleep $TIMEOUT @@ -845,7 +845,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) @@ -864,10 +864,10 @@ test_43() { # bug 2530 replay_barrier mds # 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 mds sleep 10 - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" return 0 } @@ -889,12 +889,12 @@ test_44() { echo "$i of 10 ($(date +%s))" 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" + do_facet mds "lctl set_param fail_loc=0x80000701" $LCTL --device $mdcdev recover df $MOUNT done - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds return 0 } @@ -907,11 +907,11 @@ test_44b() { echo "$i of 10 ($(date +%s))" 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" + do_facet mds "lctl set_param fail_loc=0x80000704" $LCTL --device $mdcdev recover df $MOUNT done - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" return 0 } run_test 44b "race in target handle connect" @@ -959,7 +959,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 @@ -970,7 +970,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)" @@ -980,13 +980,13 @@ test_48() { createmany -o $DIR/$tfile 20 || return 1 # OBD_FAIL_OST_EROFS 0x216 fail mds - 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)" @@ -1009,9 +1009,9 @@ test_52() { multiop $DIR/$tfile s || return 1 replay_barrier mds #define OBD_FAIL_LDLM_REPLY 0x30c - do_facet mds "sysctl -w lustre.fail_loc=0x8000030c" + do_facet mds "lctl set_param fail_loc=0x8000030c" fail mds || return 2 - do_facet mds "sysctl -w lustre.fail_loc=0x0" + do_facet mds "lctl set_param fail_loc=0x0" $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true } @@ -1027,10 +1027,10 @@ test_53a() { sleep 1 #define OBD_FAIL_MDS_CLOSE_NET 0x115 - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks MDC # force the close - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" mcreate $DIR/${tdir}-2/f || return 1 # close should still be here @@ -1052,12 +1052,12 @@ test_53b() { close_pid=$! #define OBD_FAIL_MDS_REINT_NET 0x107 - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks MDC # force the close wait $close_pid || return 1 @@ -1080,12 +1080,12 @@ test_53c() { multiop $DIR/${tdir}-1/f O_c & close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks MDC # force the close @@ -1095,7 +1095,7 @@ test_53c() { sleep 2 # close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1112,10 +1112,10 @@ test_53d() { sleep 1 # define OBD_FAIL_MDS_CLOSE_NET_REP 0X138 - do_facet mds "sysctl -w lustre.fail_loc=0x8000013b" + do_facet mds "lctl set_param fail_loc=0x8000013b" kill -USR1 $close_pid cancel_lru_locks MDC # force the close - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" mcreate $DIR/${tdir}-2/f || return 1 # close should still be here @@ -1137,12 +1137,12 @@ test_53e() { close_pid=$! #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" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks MDC # force the close wait $close_pid || return 1 @@ -1165,12 +1165,12 @@ test_53f() { multiop $DIR/${tdir}-1/f O_c & close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0x8000013b" + do_facet mds "lctl set_param fail_loc=0x8000013b" kill -USR1 $close_pid cancel_lru_locks MDC @@ -1180,7 +1180,7 @@ test_53f() { sleep 2 #close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1194,16 +1194,16 @@ test_53g() { multiop $DIR/${tdir}-1/f O_c & close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000119" + do_facet mds "lctl set_param fail_loc=0x80000119" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0x80000115" + do_facet mds "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks MDC # force the close - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" replay_barrier_nodf mds fail_nodf mds wait $open_pid || return 1 @@ -1223,12 +1223,12 @@ test_53h() { multiop $DIR/${tdir}-1/f O_c & close_pid=$! - do_facet mds "sysctl -w lustre.fail_loc=0x80000107" + do_facet mds "lctl set_param fail_loc=0x80000107" mcreate $DIR/${tdir}-2/f & open_pid=$! sleep 1 - do_facet mds "sysctl -w lustre.fail_loc=0x8000013b" + do_facet mds "lctl set_param fail_loc=0x8000013b" kill -USR1 $close_pid cancel_lru_locks MDC # force the close sleep 1 @@ -1239,7 +1239,7 @@ test_53h() { sleep 2 # close should be gone [ -d /proc/$close_pid ] && return 2 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3 $CHECKSTAT -t file $DIR/${tdir}-2/f || return 4 @@ -1250,11 +1250,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 mds "sysctl -w lustre.fail_loc=0x8000012b" + do_facet mds "lctl set_param fail_loc=0x8000012b" touch $DIR/$tfile & # give touch a chance to run sleep 5 - do_facet mds "sysctl -w lustre.fail_loc=0x0" + do_facet mds "lctl set_param fail_loc=0x0" rm $DIR/$tfile return 0 } @@ -1273,13 +1273,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 mds "sysctl -w lustre.fail_loc=0x8000012c" + do_facet mds "lctl set_param fail_loc=0x8000012c" touch $DIR/$tfile replay_barrier mds fail mds sleep 1 $CHECKSTAT -t file $DIR/$tfile || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0x0" + do_facet mds "lctl set_param fail_loc=0x0" rm $DIR/$tfile } run_test 57 "test recovery from llog for setattr op" @@ -1287,13 +1287,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 mds "sysctl -w lustre.fail_loc=0x8000012c" + do_facet mds "lctl set_param fail_loc=0x8000012c" createmany -o $DIR/$tdir/$tfile-%d 2500 replay_barrier mds fail mds sleep 2 $CHECKSTAT -t file $DIR/$tdir/$tfile-* >/dev/null || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0x0" + do_facet mds "lctl set_param fail_loc=0x0" unlinkmany $DIR/$tdir/$tfile-%d 2500 rmdir $DIR/$tdir } @@ -1306,10 +1306,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 mds - do_facet ost1 "sysctl -w lustre.fail_loc=0x0" + do_facet ost1 "lctl set_param fail_loc=0x0" sleep 20 rmdir $DIR/$tdir } @@ -1334,12 +1334,12 @@ test_61a() { replay_barrier ost1 # OBD_FAIL_OST_LLOG_RECOVERY_TIMEOUT 0x221 unlinkmany $DIR/$tdir/$tfile-%d 800 - do_facet ost "sysctl -w lustre.fail_loc=0x80000221" + do_facet ost "lctl set_param fail_loc=0x80000221" facet_failover ost1 sleep 10 fail ost1 sleep 30 - do_facet ost "sysctl -w lustre.fail_loc=0x0" + do_facet ost "lctl set_param fail_loc=0x0" $CHECKSTAT -t file $DIR/$tdir/$tfile-* && return 1 rmdir $DIR/$tdir } @@ -1348,7 +1348,7 @@ run_test 61a "test race llog recovery vs llog cleanup" #test race mds llog sync vs llog cleanup test_61b() { # OBD_FAIL_MDS_LLOG_SYNC_TIMEOUT 0x13a - do_facet mds "sysctl -w lustre.fail_loc=0x8000013a" + do_facet mds "lctl set_param fail_loc=0x8000013a" facet_failover mds sleep 10 fail mds @@ -1360,7 +1360,7 @@ run_test 61b "test race mds llog sync vs llog cleanup" test_61c() { # OBD_FAIL_OST_CANCEL_COOKIE_TIMEOUT 0x222 touch $DIR/$tfile - do_facet ost "sysctl -w lustre.fail_loc=0x80000222" + do_facet ost "lctl set_param fail_loc=0x80000222" rm $DIR/$tfile sleep 10 fail ost1 @@ -1371,10 +1371,10 @@ test_62() { # Bug 15756 - don't mis-drop resent replay replay_barrier mds createmany -o $DIR/$tdir/$tfile- 25 #define OBD_FAIL_TGT_REPLAY_DROP 0x707 - do_facet mds "sysctl -w lustre.fail_loc=0x80000707" + do_facet mds "lctl set_param fail_loc=0x80000707" facet_failover mds df $MOUNT || return 1 - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" unlinkmany $DIR/$tdir/$tfile- 25 || return 2 return 0 } @@ -1408,11 +1408,11 @@ test_65a() #bug 3055 at_start || return 0 $LCTL dk > /dev/null debugsave - sysctl -w lnet.debug="+other" + lctl set_param debug="+other" # slow down a request - do_facet mds sysctl -w lustre.fail_val=30000 + do_facet mds lctl set_param fail_val=30000 #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a - do_facet mds sysctl -w lustre.fail_loc=0x8000050a + do_facet mds lctl set_param fail_loc=0x8000050a createmany -o $DIR/$tfile 10 > /dev/null unlinkmany $DIR/$tfile 10 > /dev/null # check for log message @@ -1429,19 +1429,19 @@ test_65b() #bug 3055 at_start || return 0 # turn on D_ADAPTTO debugsave - sysctl -w lnet.debug="+other" + lctl set_param debug="+other" $LCTL dk > /dev/null # slow down bulk i/o - do_facet ost1 sysctl -w lustre.fail_val=30 + do_facet ost1 lctl set_param fail_val=30 #define OBD_FAIL_OST_BRW_PAUSE_PACK 0x224 - do_facet ost1 sysctl -w lustre.fail_loc=0x224 + do_facet ost1 lctl set_param fail_loc=0x224 rm -f $DIR/$tfile lfs setstripe $DIR/$tfile --index=0 --count=1 # force some real bulk transfer multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 # check for log message $LCTL dk | grep "Early reply #" || error "No early reply" debugrestore @@ -1455,18 +1455,18 @@ test_66a() #bug 3055 at_start || return 0 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" + do_facet mds "lctl set_param fail_val=5000" #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a - do_facet mds "sysctl -w lustre.fail_loc=0x8000050a" + do_facet mds "lctl set_param fail_loc=0x8000050a" createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null 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" + do_facet mds "lctl set_param fail_val=10000" + do_facet mds "lctl set_param fail_loc=0x8000050a" createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep "portal 12" - do_facet mds "sysctl -w lustre.fail_loc=0" + do_facet mds "lctl set_param fail_loc=0" sleep 9 createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null @@ -1482,11 +1482,11 @@ test_66b() #bug 3055 { at_start || return 0 ORIG=$(lctl get_param -n mdc.${FSNAME}-*.timeouts | awk '/network/ {print $4}') - sysctl -w lustre.fail_val=$(($ORIG + 5)) + lctl set_param fail_val=$(($ORIG + 5)) #define OBD_FAIL_PTLRPC_PAUSE_REP 0x50c - sysctl -w lustre.fail_loc=0x50c + lctl set_param fail_loc=0x50c ls $DIR/$tfile > /dev/null 2>&1 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 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" @@ -1499,12 +1499,12 @@ test_67a() #bug 3055 at_start || return 0 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" + do_facet ost1 "lctl set_param fail_val=400" #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a - do_facet ost1 "sysctl -w lustre.fail_loc=0x50a" + do_facet ost1 "lctl set_param fail_loc=0x50a" createmany -o $DIR/$tfile 20 > /dev/null unlinkmany $DIR/$tfile 20 > /dev/null - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" 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" @@ -1518,8 +1518,8 @@ test_67b() #bug 3055 at_start || return 0 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" + do_facet ost1 "lctl set_param fail_val=20000" + do_facet ost1 "lctl set_param fail_loc=0x80000223" cp /etc/profile $DIR/$tfile || error "cp failed" client_reconnect lctl get_param -n ost.OSS.ost_create.timeouts @@ -1528,9 +1528,9 @@ test_67b() #bug 3055 ATTEMPTS=$(($CONN2 - $CONN1)) echo "$ATTEMPTS osc reconnect attemps on instant slow" # do it again; should not timeout - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000223" + do_facet ost1 "lctl set_param fail_loc=0x80000223" cp /etc/profile $DIR/$tfile || error "cp failed" - do_facet ost1 "sysctl -w lustre.fail_loc=0" + do_facet ost1 "lctl set_param fail_loc=0" client_reconnect lctl get_param -n ost.OSS.ost_create.timeouts CONN3=$(`lctl get_param -n osc.*.stats` | awk '/_connect/ {total+=$2} END {print total}') @@ -1551,13 +1551,13 @@ test_68 () #bug 13813 rm -f $DIR/${tfile}_[1-2] lfs setstripe $DIR/$tfile --index=0 --count=1 #define OBD_FAIL_LDLM_PAUSE_CANCEL 0x312 - sysctl -w lustre.fail_val=$(($TIMEOUT - 1)) - sysctl -w lustre.fail_loc=0x80000312 + lctl set_param fail_val=$(($TIMEOUT - 1)) + lctl set_param fail_loc=0x80000312 cp /etc/profile $DIR/${tfile}_1 || error "1st cp failed $?" - sysctl -w lustre.fail_val=$((TIMEOUT * 3 / 2)) - sysctl -w lustre.fail_loc=0x80000312 + lctl set_param fail_val=$((TIMEOUT * 3 / 2)) + lctl set_param fail_loc=0x80000312 cp /etc/profile $DIR/${tfile}_2 || error "2nd cp failed $?" - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 echo $ENQ_MIN >> $ldlm_enqueue_min return 0 } diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 36eb773160e22c73b490f1cc85ffb90a333a77fe..8591dc57d909d0457e74765a9a8157d028b5db2d 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -116,15 +116,15 @@ lustre_fail() { case $fail_node in "mds" ) - do_facet mds "sysctl -w lustre.fail_loc=$fail_loc" ;; + do_facet mds "lctl set_param fail_loc=$fail_loc" ;; "ost" ) for num in `seq $OSTCOUNT`; do - do_facet ost$num "sysctl -w lustre.fail_loc=$fail_loc" + do_facet ost$num "lctl set_param fail_loc=$fail_loc" done ;; "mds_ost" ) - do_facet mds "sysctl -w lustre.fail_loc=$fail_loc" ; + do_facet mds "lctl set_param fail_loc=$fail_loc" ; for num in `seq $OSTCOUNT`; do - do_facet ost$num "sysctl -w lustre.fail_loc=$fail_loc" + do_facet ost$num "lctl set_param fail_loc=$fail_loc" done ;; * ) echo "usage: lustre_fail fail_node fail_loc" ; return 1 ;; @@ -145,10 +145,10 @@ test_0() { $LFS setquota -u $TSTUSR 0 0 0 0 $DIR $LFS setquota -g $TSTUSR 0 0 0 0 $DIR - sysctl -w lnet.debug="+quota" - do_facet mds "sysctl -w lnet.debug=+quota" + lctl set_param debug="+quota" + do_facet mds "lctl set_param debug=+quota" for num in `seq $OSTCOUNT`; do - do_facet ost$num "sysctl -w lnet.debug=+quota" + do_facet ost$num "lctl set_param debug=+quota" done } run_test 0 "Set quota =============================" @@ -1328,7 +1328,7 @@ test_18() { echo " step2: testing ......" count=0 - timeout=$(sysctl -n lustre.timeout) + timeout=$(lctl get_param -n timeout) while [ true ]; do if [ -z `ps -ef | awk '$2 == '${DDPID}' { print $8 }'` ]; then break; fi count=$[count+1] @@ -1380,7 +1380,7 @@ test_18a() { echo " step2: testing ......" count=0 - timeout=$(sysctl -n lustre.timeout) + timeout=$(lctl get_param -n timeout) while [ true ]; do if [ -z `ps -ef | awk '$2 == '${DDPID}' { print $8 }'` ]; then break; fi count=$[count+1] @@ -1455,7 +1455,7 @@ run_test 19 "test if administrative limits updates do not zero operational limit test_99() { $LFS quotaoff $DIR - sysctl -w lnet.debug="-quota" + lctl set_param debug="-quota" return 0 } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 7a054eb8a88011cab79f143d7edba56da3dca29a..cea6a8d088a4e901566d057147495d4647d33902 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -134,8 +134,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 @@ -894,7 +894,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() { @@ -908,7 +908,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.prealloc* | grep '[0-9]' @@ -1028,10 +1028,10 @@ test_27u() { # bug 4900 #define OBD_FAIL_MDS_OSC_PRECREATE 0x139 - sysctl -w lustre.fail_loc=0x139 + lctl set_param fail_loc=0x139 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 @@ -1053,15 +1053,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" @@ -1543,7 +1543,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 @@ -1961,7 +1961,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 @@ -1984,7 +1984,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 @@ -2008,7 +2008,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 @@ -2145,7 +2145,7 @@ test_52c() { # 12848 simulating client < 1.4.7 touch $DIR/d52c/foo # skip MDS_BFLAG_EXT_FLAGS in mdc_getattr_pack #define OBD_FAIL_MDC_OLD_EXT_FLAGS 0x802 - sysctl -w lustre.fail_loc=0x802 + lctl set_param fail_loc=0x802 chattr =i $DIR/d52c/foo || error lsattr $DIR/d52c/foo | egrep -q "^-+i-+ $DIR/d52c/foo" || error chattr -i $DIR/d52c/foo || error @@ -2565,7 +2565,7 @@ test_60c() { echo "create 5000 files" createmany -o $DIR/f60c- 5000 #define OBD_FAIL_MDS_LLOG_CREATE_FAILED 0x137 - sysctl -w lustre.fail_loc=0x80000137 + lctl set_param fail_loc=0x80000137 unlinkmany $DIR/f60c- 5000 } run_test 60c "unlink file when mds full" @@ -2578,14 +2578,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" @@ -2604,9 +2604,9 @@ test_62() { echo foo > $f cancel_lru_locks osc #define OBD_FAIL_OSC_MATCH 0x405 - 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 } # This test is now irrelevant (as of bug 10718 inclusion), we no longer # match every page all of the time. @@ -2632,14 +2632,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 @@ -2908,21 +2908,21 @@ test_69() { $DIRECTIO write ${f}.2 0 1 || error "directio write error" #define OBD_FAIL_OST_ENOENT 0x217 - 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" #define OBD_FAIL_OST_ENOENT 0x217 - 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 ======" @@ -2982,10 +2982,10 @@ test_73() { pid1=$! #define OBD_FAIL_MDS_PAUSE_OPEN 0x129 - sysctl -w lustre.fail_loc=0x80000129 + lctl set_param fail_loc=0x80000129 multiop $DIR/d73-1/f73-2 Oc & sleep 1 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 multiop $DIR/d73-2/f73-3 Oc & pid3=$! @@ -3009,10 +3009,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)" @@ -3022,10 +3022,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)" @@ -3200,11 +3200,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 ====================" @@ -3216,9 +3216,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 @@ -3227,11 +3227,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 ===============" @@ -3239,12 +3239,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 ================" @@ -3255,10 +3255,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 @@ -3270,11 +3270,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/f77g 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 ======================" @@ -3285,19 +3285,19 @@ test_77h() { # bug 10889 [ ! -f $DIR/f77g ] && 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/f77g || 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'` @@ -3309,9 +3309,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'` @@ -4110,9 +4110,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 =============================" @@ -4143,8 +4143,8 @@ test_118a() #bug 11710 reset_async multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c - DIRTY=$(lctl get_param -n llite.*.dump_page_cache | grep -c dirty) - WRITEBACK=$(lctl get_param llite.*.dump_page_cache | grep -c writeback) + DIRTY=$(lctl get_param -n "llite.*.dump_page_cache" | grep -c dirty) + WRITEBACK=$(lctl get_param "llite.*.dump_page_cache" | grep -c writeback) if [[ $DIRTY -ne 0 || $WRITEBACK -ne 0 ]]; then error "Dirty pages not flushed to disk, dirty=$DIRTY, writeback=$WRITEBACK" @@ -4271,7 +4271,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 @@ -4280,11 +4280,11 @@ 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) - 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 @@ -4305,20 +4305,20 @@ test_118g() { 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=$? - 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 @@ -4330,7 +4330,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 ==========" @@ -4389,9 +4389,9 @@ test_118i() { error "got error, but should be not, 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 @@ -4664,20 +4664,20 @@ run_test 120g "Early Lock Cancel: performance test =============" test_121() { #bug 10589 writes=$(LANG=C dd if=/dev/zero of=$DIR/$tfile count=1 2>&1 | awk -F '+' '/out/ {print $1}') - 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 =================================" test_122() { #bug 11544 #define OBD_FAIL_PTLRPC_CLIENT_BULK_CB 0x508 - sysctl -w lustre.fail_loc=0x508 + lctl set_param fail_loc=0x508 dd if=/dev/zero of=$DIR/$tfile count=1 sync - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 } run_test 122 "fail client bulk callback (shouldn't LBUG) =======" @@ -4751,10 +4751,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 @@ -5011,7 +5011,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 00e3147a037ca954bee7f0a76ae7392cfac84f2e..40cc00739e418d999b26d4281c6ef10c8fe9e036 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -333,7 +333,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 @@ -557,7 +557,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 & sleep 0.500s dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 @@ -582,7 +582,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 e2f6e9deb341085abfb827962ae38dd7e1748b9f..14ee67ab96202ccde3eac1fb3e761f661fb7a350 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -148,8 +148,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" ] && \ @@ -269,9 +269,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 @@ -334,9 +334,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 } @@ -457,7 +457,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 @@ -815,7 +815,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() { @@ -863,7 +863,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 @@ -977,64 +977,64 @@ at_max_set() { 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 } @@ -1043,7 +1043,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 () { @@ -1051,7 +1051,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 } @@ -1106,11 +1106,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="" } @@ -1121,7 +1121,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" @@ -1279,7 +1279,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 }