From: James Nunez Date: Thu, 27 Dec 2018 03:26:09 +0000 (-0700) Subject: LU-10447 tests: replace $SET/$GETSTRIPE for misc tests X-Git-Tag: 2.13.51~206 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=332ec6a585f54eb7b3694ff6f939cd6d8159e6ba LU-10447 tests: replace $SET/$GETSTRIPE for misc tests $SETSTRIPE and $GETSTRIPE were needed when we used the standalone 'lstripe' utility. 'lstripe' hasn't been used for years and we need to clean up all remnants of it. Replace all instances of $SETSTRIPE with '$LFS setstripe' and $GETSTRIPE with '$LFS getstripe' in the recovery-small, sanity-hsm, sanity-lfsck, and sanity-scrub test suites. Test-Parameters: trivial testlist=recovery-small,sanity-hsm Test-Parameters: testlist=sanity-scrub Signed-off-by: James Nunez Change-Id: I3ac87e0c48f33ac40cd8631f3d403fed4090adc5 Reviewed-on: https://review.whamcloud.com/33919 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu --- diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh index 93b5137..1bd6384 100644 --- a/lustre/tests/functions.sh +++ b/lustre/tests/functions.sh @@ -968,7 +968,7 @@ run_rr_alloc() { [ -e $DIR/$tdir ] || $LFS mkdir -i 0 $DIR/$tdir fi chmod 0777 $DIR/$tdir - $SETSTRIPE -c 1 /$DIR/$tdir + $LFS setstripe -c 1 /$DIR/$tdir trap "cleanup_rr_alloc $clients $mntpt_root $rr_alloc_MNTPTS" EXIT ERR for i in $(seq 0 $((rr_alloc_MNTPTS - 1))); do @@ -1033,7 +1033,7 @@ run_rr_alloc() { restore_lustre_params < $qos_prec_objs rm -f $qos_prec_objs - diff_max_min_arr=($($GETSTRIPE -r $DIR/$tdir/ | + diff_max_min_arr=($($LFS getstripe -r $DIR/$tdir/ | grep "lmm_stripe_offset:" | awk '{print $2}' | sort -n | uniq -c | awk 'NR==1 {min=max=$1} \ { $1max ? max=$1 : max} \ diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 5cac794..a30aa8a 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -1542,8 +1542,8 @@ test_65() { mount_client $DIR2 #grant lock1, export2 - $SETSTRIPE -i -0 $DIR2/$tfile || return 1 - $MULTIOP $DIR2/$tfile Ow || return 2 + $LFS setstripe -i -0 $DIR2/$tfile || error "setstripe failed" + $MULTIOP $DIR2/$tfile Ow || error "multiop failed" #define OBD_FAIL_LDLM_BL_EVICT 0x31e do_facet ost $LCTL set_param fail_loc=0x31e @@ -1940,7 +1940,7 @@ test_105() # Since the client just mounted, its last_rcvd entry is not on disk. # Send an RPC so exp_need_sync forces last_rcvd to commit this export # so the client can reconnect during OST recovery (LU-924, LU-1582) - $SETSTRIPE -i 0 $DIR/$tfile + $LFS setstripe -i 0 $DIR/$tfile dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 conv=sync # make sure MGS's state is Partial @@ -2042,7 +2042,7 @@ run_test 107 "drop reint reply, then restart MDT" test_108() { mkdir -p $DIR/$tdir - $SETSTRIPE -c 1 -i 0 $DIR/$tdir + $LFS setstripe -c 1 -i 0 $DIR/$tdir dd if=/dev/zero of=$DIR/$tdir/$tfile bs=1M count=256 & local dd_pid=$! @@ -2105,7 +2105,7 @@ test_110c () { drop_update_reply $mdtidx "$LFS mkdir -i $mdtidx -c2 $remote_dir" || error "lfs mkdir failed" - diridx=$($GETSTRIPE -m $remote_dir) + diridx=$($LFS getstripe -m $remote_dir) [ $diridx -eq $mdtidx ] || error "$diridx != $mdtidx" rm -rf $DIR/$tdir || error "rmdir failed" @@ -2680,7 +2680,7 @@ test_132() { rm -f $DIR/$tfile # get a lock on client so that export would reach the stale list - $SETSTRIPE -i 0 $DIR/$tfile || error "setstripe failed" + $LFS setstripe -i 0 $DIR/$tfile || error "setstripe failed" dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 conv=fsync || error "dd failed" @@ -2712,7 +2712,7 @@ test_131() { rm -f $DIR/$tfile # get a lock on client so that export would reach the stale list - $SETSTRIPE -i 0 $DIR/$tfile || error "setstripe failed" + $LFS setstripe -i 0 $DIR/$tfile || error "setstripe failed" dd if=/dev/zero of=$DIR/$tfile count=1 || error "dd failed" # another IO under the same lock diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index bc7c508..7a4d3c2 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -1051,7 +1051,7 @@ test_11a() { echo "Verifying imported size $LSZ=$ASZ" [[ $LSZ -eq $ASZ ]] || error "Incorrect size $LSZ != $ASZ" echo -n "Verifying released pattern: " - local PTRN=$($GETSTRIPE -L $f) + local PTRN=$($LFS getstripe -L $f) echo $PTRN [[ $PTRN == released ]] || error "Is not released" local fid=$(path2fid $f) diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 23e5ffb..2107436 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -1329,7 +1329,7 @@ ost_remove_lastid() { test_11a() { check_mount_and_prep - $SETSTRIPE -c 1 -i 0 $DIR/$tdir + $LFS setstripe -c 1 -i 0 $DIR/$tdir createmany -o $DIR/$tdir/f 64 || error "(0) Fail to create 64 files." echo "stopall" @@ -1370,7 +1370,7 @@ run_test 11a "LFSCK can rebuild lost last_id" test_11b() { check_mount_and_prep - $SETSTRIPE -c 1 -i 0 $DIR/$tdir + $LFS setstripe -c 1 -i 0 $DIR/$tdir echo "set fail_loc=0x160d to skip the updating LAST_ID on-disk" #define OBD_FAIL_LFSCK_SKIP_LASTID 0x160d diff --git a/lustre/tests/sanity-scrub.sh b/lustre/tests/sanity-scrub.sh index 28ddee3..c84ce25 100644 --- a/lustre/tests/sanity-scrub.sh +++ b/lustre/tests/sanity-scrub.sh @@ -1092,7 +1092,7 @@ run_test 11 "OI scrub skips the new created objects only once" test_12() { check_mount_and_prep - $SETSTRIPE -c 1 -i 0 $DIR/$tdir + $LFS setstripe -c 1 -i 0 $DIR/$tdir #define OBD_FAIL_OSD_COMPAT_INVALID_ENTRY 0x195 do_facet ost1 $LCTL set_param fail_loc=0x195 @@ -1130,7 +1130,7 @@ run_test 12 "OI scrub can rebuild invalid /O entries" test_13() { check_mount_and_prep - $SETSTRIPE -c 1 -i 0 $DIR/$tdir + $LFS setstripe -c 1 -i 0 $DIR/$tdir #define OBD_FAIL_OSD_COMPAT_NO_ENTRY 0x196 do_facet ost1 $LCTL set_param fail_loc=0x196