Whamcloud - gitweb
LU-3196 tests: a few fixes for > 10 OSTs.
authorwang di <di.wang@intel.com>
Sun, 21 Apr 2013 07:00:38 +0000 (00:00 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 30 Apr 2013 16:24:13 +0000 (12:24 -0400)
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 <di.wang@intel.com>
Change-Id: Id60ffece99f76cd7dd2e88a655e78e9abcbdfa9b
Reviewed-on: http://review.whamcloud.com/6110
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/replay-single.sh
lustre/tests/sanity.sh

index 319d731..07e7104 100755 (executable)
@@ -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
index 682252f..c70826e 100644 (file)
@@ -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