From: grev Date: Fri, 17 Aug 2007 02:22:35 +0000 (+0000) Subject: b=13283 X-Git-Tag: v1_7_91~39 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6e89d5c2527c48b20e9cd025aea2f81378142e8a b=13283 i=Adilger Don't check if $MDSDEV is a file. Set "fs2" real and loop devices correctly. --- diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 21548e5..54b3200 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -30,6 +30,9 @@ HOSTNAME=`hostname` . $LUSTRE/tests/test-framework.sh init_test_env $@ +# use small MDS + OST size to speed formatting time +MDSSIZE=40000 +OSTSIZE=40000 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh} reformat() { @@ -614,54 +617,53 @@ run_test 15 "zconf-mount without /sbin/mount.lustre (should return error)" test_16() { TMPMTPT="${MOUNT%/*}/conf16" - if [ ! -f "$MDSDEV" ]; then - echo "no $MDSDEV existing, so mount Lustre to create one" + if [ ! -e "$MDSDEV" ]; then + log "no $MDSDEV existing, so mount Lustre to create one" setup check_mount || return 41 cleanup || return $? fi - echo "change the mode of $MDSDEV/OBJECTS,LOGS,PENDING to 555" + [ -f "$MDSDEV" ] && LOOPOPT="-o loop" + + log "change the mode of $MDSDEV/OBJECTS,LOGS,PENDING to 555" do_facet mds "mkdir -p $TMPMTPT && - mount -o loop -t ext3 $MDSDEV $TMPMTPT && + mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT && chmod 555 $TMPMTPT/{OBJECTS,LOGS,PENDING} && umount $TMPMTPT" || return $? - echo "mount Lustre to change the mode of OBJECTS/LOGS/PENDING, then umount Lustre" + log "mount Lustre to change the mode of OBJECTS/LOGS/PENDING, then umount Lustre" setup check_mount || return 41 cleanup || return $? - echo "read the mode of OBJECTS/LOGS/PENDING and check if they has been changed properly" + log "read the mode of OBJECTS/LOGS/PENDING and check if they has been changed properly" EXPECTEDOBJECTSMODE=`do_facet mds "debugfs -R 'stat OBJECTS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"` EXPECTEDLOGSMODE=`do_facet mds "debugfs -R 'stat LOGS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"` EXPECTEDPENDINGMODE=`do_facet mds "debugfs -R 'stat PENDING' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"` if [ "$EXPECTEDOBJECTSMODE" = "0777" ]; then - echo "Success:Lustre change the mode of OBJECTS correctly" + log "Success:Lustre change the mode of OBJECTS correctly" else - echo "Error: Lustre does not change mode of OBJECTS properly" - return 1 + error "Lustre does not change mode of OBJECTS properly" fi if [ "$EXPECTEDLOGSMODE" = "0777" ]; then - echo "Success:Lustre change the mode of LOGS correctly" + log "Success:Lustre change the mode of LOGS correctly" else - echo "Error: Lustre does not change mode of LOGS properly" - return 1 + error "Lustre does not change mode of LOGS properly" fi if [ "$EXPECTEDPENDINGMODE" = "0777" ]; then - echo "Success:Lustre change the mode of PENDING correctly" + log "Success:Lustre change the mode of PENDING correctly" else - echo "Error: Lustre does not change mode of PENDING properly" - return 1 + error "Lustre does not change mode of PENDING properly" fi } run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING" test_17() { - if [ ! -f "$MDSDEV" ]; then + if [ ! -e "$MDSDEV" ]; then echo "no $MDSDEV existing, so mount Lustre to create one" setup check_mount || return 41 @@ -690,13 +692,11 @@ test_18() { check_mount || return 41 echo "check journal size..." - FOUNDJOURNALSIZE=`do_facet mds "debugfs -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}'` - if [ "$FOUNDJOURNALSIZE" = "79691776" ]; then - echo "Success:lconf creates large journals" + FOUNDSIZE=`do_facet mds "debugfs -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}'` + if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then + log "Success: mkfs creates large journals" else - echo "Error:lconf not create large journals correctly" - echo "expected journal size: 79691776(76M), found journal size: $FOUNDJOURNALSIZE" - return 1 + error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M" fi cleanup || return $? @@ -704,7 +704,7 @@ test_18() { MDSSIZE=$OLDMDSSIZE gen_config } -run_test 18 "check lconf creates large journals" +run_test 18 "check mkfs creates large journals" test_19a() { start_mds || return 1 @@ -823,16 +823,22 @@ test_23() { test_24a() { local fs2mds_HOST=$mds_HOST + local fs2ost_HOST=$ost_HOST + + [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \ + log "mixed loopback and real device not working" && return + + local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2} + local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2} + # test 8-char fsname as well local FSNAME2=test1234 - add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat ${MDSDEV}_2 || exit 10 + add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10 - local fs2ost_HOST=$ost_HOST - local fs2ostdev=$(ostdevname 1)_2 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10 setup - start fs2mds ${MDSDEV}_2 $MDS_MOUNT_OPTS + start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS start fs2ost $fs2ostdev $OST_MOUNT_OPTS mkdir -p $MOUNT2 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1 @@ -866,9 +872,14 @@ run_test 24a "Multiple MDTs on a single node" test_24b() { local fs2mds_HOST=$mds_HOST - add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat ${MDSDEV}_2 || exit 10 + [ -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \ + log "mixed loopback and real device not working" && return + + local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2} + + add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10 setup - start fs2mds ${MDSDEV}_2 $MDS_MOUNT_OPTS && return 2 + start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2 cleanup || return 6 } run_test 24b "Multiple MGSs on a single node (should return err)" @@ -1148,8 +1159,12 @@ test_33() { # bug 12333 local FSNAME2=test1234 local fs2mds_HOST=$mds_HOST local fs2ost_HOST=$ost_HOST - local fs2mdsdev=${MDSDEV}_2 - local fs2ostdev=$(ostdevname 1)_2 + + [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \ + log "mixed loopback and real device not working" && return + + local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2} + local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2} add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=`hostname`@tcp --reformat $fs2ostdev || exit 10