From 0f1cd71b2c98e80cb67c4d27ee11233b1a909329 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Tue, 14 Aug 2012 19:35:35 +0800 Subject: [PATCH] LU-1741 test: fix conf_sanity test_18 test case * We need always check block device's size bigger than its minimum requirement. * Correct code indentation for formatall(). Signed-off-by: Bobi Jam Change-Id: I884287f43a2d1499a5be986e7d57d8d1a3827a24 Reviewed-on: http://review.whamcloud.com/3632 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Li Wei Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 10 ++++++++-- lustre/tests/test-framework.sh | 11 ++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 9263c82..c2b15d3 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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%) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d7a7a83..994d357 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 } -- 1.8.3.1