From: wang di Date: Sun, 21 Apr 2013 07:00:38 +0000 (-0700) Subject: LU-3196 tests: a few fixes for > 10 OSTs. X-Git-Tag: 2.3.65~45 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ac37e7b4d101761bbff401ed12fcf671d6b68f9c LU-3196 tests: a few fixes for > 10 OSTs. 1. Because the stripe index not necessarily follow OST index order, even it specifies the index, so we should not check the layout by OST inde order in sanity 27C. 2. In test 33c, it should print the OSTXXXX by %.4x instead of %.4d. 3. In replay 44, timeout is under mds, instead of mdt. Signed-off-by: wang di Change-Id: Id60ffece99f76cd7dd2e88a655e78e9abcbdfa9b Reviewed-on: http://review.whamcloud.com/6110 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Emoly Liu Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 319d731..07e7104 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -922,7 +922,8 @@ test_44a() { # was test_44 for i in `seq 1 10`; do echo "$i of 10 ($(date +%s))" - do_facet $SINGLEMDS "lctl get_param -n mdt.*.mdt.timeouts | grep service" + do_facet $SINGLEMDS \ + "lctl get_param -n md[ts].*.mdt.timeouts | grep service" #define OBD_FAIL_TGT_CONN_RACE 0x701 do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000701" # lctl below may fail, it is valid case @@ -944,7 +945,8 @@ test_44b() { for i in `seq 1 10`; do echo "$i of 10 ($(date +%s))" - do_facet $SINGLEMDS "lctl get_param -n mdt.*.mdt.timeouts | grep service" + do_facet $SINGLEMDS \ + "lctl get_param -n md[ts].*.mdt.timeouts | grep service" #define OBD_FAIL_TGT_DELAY_RECONNECT 0x704 do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000704" # lctl below may fail, it is valid case diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 682252f..c70826e 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1867,6 +1867,7 @@ test_27C() { #LU-2871 declare -a ost_idx local index + local found local i local j @@ -1879,11 +1880,21 @@ test_27C() { #LU-2871 ost_idx=($($GETSTRIPE $tfile$i | tail -n $((OSTCOUNT + 1)) | awk '{print $1}')) echo ${ost_idx[@]} + # check the layout - for j in $(seq 0 $((OSTCOUNT - 1))); do - index=$(((i + j) % OSTCOUNT)) - [ ${ost_idx[$j]} -eq $index ] || - error "$j:${ost_idx[$j]} != $index" + [ ${#ost_idx[@]} -eq $OSTCOUNT ] || + error "${#ost_idx[@]} != $OSTCOUNT" + + for index in $(seq 0 $((OSTCOUNT - 1))); do + found=0 + for j in $(echo ${ost_idx[@]}); do + if [ $index -eq $j ]; then + found=1 + break + fi + done + [ $found = 1 ] || + error "Can not find $index in ${ost_idx[@]}" done done } @@ -2421,7 +2432,7 @@ test_33c() { for ostnum in $(seq $OSTCOUNT); do # test-framework's OST numbering is one-based, while Lustre's # is zero-based - ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1))) + ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1))) # Parsing llobdstat's output sucks; we could grep the /proc # path, but that's likely to not be as portable as using the # llobdstat utility. So we parse lctl output instead. @@ -2445,7 +2456,7 @@ test_33c() { # Total up write_bytes after writing. We'd better find non-zeros. for ostnum in $(seq $OSTCOUNT); do - ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1))) + ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1))) write_bytes=$(do_facet ost$ostnum lctl get_param -n \ obdfilter/$ostname/stats | awk '/^write_bytes/ {print $7}' ) @@ -2460,7 +2471,7 @@ test_33c() { if $all_zeros then for ostnum in $(seq $OSTCOUNT); do - ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1))) + ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1))) echo "Check that write_bytes is present in obdfilter/*/stats:" do_facet ost$ostnum lctl get_param -n \ obdfilter/$ostname/stats