Whamcloud - gitweb
LU-1741 test: fix conf_sanity test_18 test case
authorBobi Jam <bobijam@whamcloud.com>
Tue, 14 Aug 2012 11:35:35 +0000 (19:35 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Dec 2012 06:46:09 +0000 (01:46 -0500)
* We need always check block device's size bigger than its minimum
  requirement.

* Correct code indentation for formatall().

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I884287f43a2d1499a5be986e7d57d8d1a3827a24
Reviewed-on: http://review.whamcloud.com/3632
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh

index 9263c82..c2b15d3 100644 (file)
@@ -641,8 +641,14 @@ test_18() {
                 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
 
         # check if the block device is large enough
-        [ -z "$OK" ] && $(is_blkdev $SINGLEMDS $MDSDEV $MIN) && OK=1 &&
-                myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
+       is_blkdev $SINGLEMDS $MDSDEV $MIN
+       local large_enough=$?
+       if [ -n "$OK" ]; then
+               [ $large_enough -ne 0 ] && OK=""
+       else
+               [ $large_enough -eq 0 ] && OK=1 && myMDSSIZE=$MIN &&
+                       log "use device $MDSDEV with MIN=$MIN"
+       fi
 
         # check if a loopback device has enough space for fs metadata (5%)
 
index d7a7a83..994d357 100644 (file)
@@ -2882,21 +2882,22 @@ formatall() {
        if ! combined_mgs_mds ; then
                echo "Format mgs: $(mgsdevname)"
                add mgs $(mkfs_opts mgs $(mgsdevname)) --reformat \
-               $(mgsdevname) $(mgsvdevname) ${quiet:+>/dev/null} || exit 10
+                       $(mgsdevname) $(mgsvdevname) ${quiet:+>/dev/null} ||
+                       exit 10
        fi
 
        for num in $(seq $MDSCOUNT); do
                echo "Format mds$num: $(mdsdevname $num)"
                add mds$num $(mkfs_opts mds$num $(mdsdevname ${num})) \
-               --reformat $(mdsdevname $num) $(mdsvdevname $num) \
-               ${quiet:+>/dev/null} || exit 10
+                       --reformat $(mdsdevname $num) $(mdsvdevname $num) \
+                       ${quiet:+>/dev/null} || exit 10
        done
 
        for num in $(seq $OSTCOUNT); do
                echo "Format ost$num: $(ostdevname $num)"
                add ost$num $(mkfs_opts ost$num $(ostdevname ${num})) \
-               --reformat $(ostdevname $num) $(ostvdevname ${num}) \
-               ${quiet:+>/dev/null} || exit 10
+                       --reformat $(ostdevname $num) $(ostvdevname ${num}) \
+                       ${quiet:+>/dev/null} || exit 10
        done
 }