From d39ed1db2cab75f2d189f3399cbab89e6c2e2435 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 15 Aug 2018 11:39:15 -0600 Subject: [PATCH] LU-8066 tests: don't access /proc/sys/lnet/debug directly In replay-single test_70e use "lctl set_param" to set the debug mask rather than writing into the /proc/sys/lnet/debug file directly, since this tunable moved to sysfs in commit v2_10_51_0-12-g7092309f32. Clean up the test code style in test_70e as well. Test-Parameters: trivial testlist=replay-single Signed-off-by: Andreas Dilger Change-Id: I65c2bd9643fc6fc54a5de7b6404d316c0ff12537 Reviewed-on: https://review.whamcloud.com/33005 Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- lustre/tests/replay-single.sh | 60 ++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 2dde582..164ad4c 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -2272,17 +2272,12 @@ test_70d () { } run_test 70d "mkdir/rmdir striped dir ${MDSCOUNT}mdts recovery" -cleanup_70e() { - trap 0 - kill -9 $rename_70e_pid -} - test_70e () { [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0 local clients=${CLIENTS:-$HOSTNAME} local rc=0 - echo ha > /proc/sys/lnet/debug + lctl set_param debug=+ha zconf_mount_clients $clients $MOUNT local duration=300 @@ -2295,45 +2290,40 @@ test_70e () { $LFS mkdir -i0 $DIR/$tdir/test_1 touch $DIR/$tdir/test_0/a touch $DIR/$tdir/test_1/b - trap cleanup_70e EXIT ( - while true; do - mrename $DIR/$tdir/test_0/a $DIR/$tdir/test_1/b > \ - /dev/null || { - echo "a->b fails" - break; - } + while true; do + mrename $DIR/$tdir/test_0/a $DIR/$tdir/test_1/b > /dev/null || { + echo "a->b fails" + break; + } - checkstat $DIR/$tdir/test_0/a && { - echo "a still exists" - break - } + checkstat $DIR/$tdir/test_0/a && { + echo "a still exists" + break + } - checkstat $DIR/$tdir/test_1/b || { - echo "b still exists" - break - } + checkstat $DIR/$tdir/test_1/b || { + echo "b still exists" + break + } - touch $DIR/$tdir/test_0/a || { - echo "touch a fails" - break - } + touch $DIR/$tdir/test_0/a || { + echo "touch a fails" + break + } - mrename $DIR/$tdir/test_1/b $DIR/$tdir/test_0/a > \ - /dev/null || { - echo "a->a fails" - break; - } - done + mrename $DIR/$tdir/test_1/b $DIR/$tdir/test_0/a > /dev/null || { + echo "a->a fails" + break; + } + done )& rename_70e_pid=$! - echo "Started $rename_70e_pid" + stack_trap "kill -9 $rename_70e_pid" EXIT + echo "Started PID=$rename_70e_pid" random_fail_mdt 2 $duration $rename_70e_pid kill -0 $rename_70e_pid || error "rename $rename_70e_pid stopped" - - cleanup_70e - true } run_test 70e "rename cross-MDT with random fails" -- 1.8.3.1