From abe5c93175c331493f204985e630b7d28eb27327 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 30 Mar 2022 12:30:13 -0600 Subject: [PATCH] LU-15479 tests: clean up sanity test_316/test_319 These tests use the deprecated "lfs mv" insted of "lfs migrate". Fix test_316 to specify which MDT to create 'd' on, so MDT space balancing does not result in 'd' being created on MDT0001, which defeats the purpose of the test trying to migrate it to MDT0001. Fix test_319 to call "lfs migrate" on the parent directory and not on the test file, since this returns an "ENOTDIR" error. Also fix some minor script style issues. Test-Parameters: trivial testlist=sanity env=ONLY="316 319",ONLY_REPEAT=100 mdscount=2 mdtcount=4 Test-Parameters: fstype=zfs testlist=sanity env=ONLY="316 319",ONLY_REPEAT=100 mdscount=2 mdtcount=4 Fixes: ae7ca90713b4 ("LU-11926 ldlm: Lost lease lock on migrate error") Signed-off-by: Andreas Dilger Change-Id: I08d55ce70cbd900c2f4d31b27baa1a33423ebbe5 Reviewed-on: https://review.whamcloud.com/46959 Tested-by: jenkins Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 63273e9..7b351d7 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -24123,17 +24123,17 @@ test_315() { # LU-618 run_test 315 "read should be accounted" test_316() { - [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" - large_xattr_enabled || skip_env "ea_inode feature disabled" + (( $MDSCOUNT >= 2 )) || skip "needs >= 2 MDTs" + large_xattr_enabled || skip "ea_inode feature disabled" - rm -rf $DIR/$tdir/d - mkdir -p $DIR/$tdir/d - chown nobody $DIR/$tdir/d - touch $DIR/$tdir/d/file + mkdir_on_mdt0 $DIR/$tdir || error "mkdir $tdir failed" + mkdir $DIR/$tdir/d || error "mkdir $tdir/d failed" + chown nobody $DIR/$tdir/d || error "chown $tdir/d failed" + touch $DIR/$tdir/d/$tfile || error "touch $tdir/d/$tfile failed" - $LFS mv -m1 $DIR/$tdir/d || error "lfs mv failed" + $LFS migrate -m1 $DIR/$tdir/d || error "lfs migrate -m1 failed" } -run_test 316 "lfs mv" +run_test 316 "lfs migrate of file with large_xattr enabled" test_317() { [ $MDS1_VERSION -lt $(version_code 2.11.53) ] && @@ -24252,7 +24252,7 @@ test_318() { run_test 318 "Verify async readahead tunables" test_319() { - [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0 + (( $MDSCOUNT >= 2 )) || skip "needs >= 2 MDTs" local before=$(date +%s) local evict @@ -24264,7 +24264,7 @@ test_319() { #define OBD_FAIL_LDLM_LOCAL_CANCEL_PAUSE 0x32c $LCTL set_param fail_val=5 fail_loc=0x8000032c - $LFS mv -m1 $file & + $LFS migrate -m1 $mdir & sleep 1 dd if=$file of=/dev/null -- 1.8.3.1