Whamcloud - gitweb
Fix a merge error in conf-sanity.sh. Using CMDVERBOSE this way was
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 39e92a9..34ba231 100644 (file)
@@ -2,6 +2,11 @@
 # requirement:
 #      add uml1 uml2 uml3 in your /etc/hosts
 
+# FIXME - there is no reason to use all of these different
+#   return codes, espcially when most of them are mapped to something
+#   else anyway.  The combination of test number and return code
+#   figure out what failed.
+
 set -e
 
 SRCDIR=`dirname $0`
@@ -16,14 +21,6 @@ init_test_env $@
 
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
-FORCE=${FORCE:-" --force"}
-
-if [ "$VERBOSE" == "true" ]; then
-       CMDVERBOSE=""
-else
-       CMDVERBOSE=" > /dev/null"
-fi
-
 gen_config() {
        rm -f $XMLCONFIG
 
@@ -46,33 +43,33 @@ gen_second_config() {
 
 start_mds() {
        echo "start mds service on `facet_active_host mds`"
-       start mds --reformat $MDSLCONFARGS $CMDVERBOSE || return 94
+       start mds --reformat $MDSLCONFARGS  || return 94
 }
 stop_mds() {
        echo "stop mds service on `facet_active_host mds`"
-       stop mds $@ $CMDVERBOSE || return 97 
+       stop mds $@  || return 97 
 }
 
 start_ost() {
        echo "start ost service on `facet_active_host ost`"
-       start ost --reformat $OSTLCONFARGS $CMDVERBOSE || return 95
+       start ost --reformat $OSTLCONFARGS  || return 95
 }
 
 stop_ost() {
        echo "stop ost service on `facet_active_host ost`"
-       stop ost $@ $CMDVERBOSE || return 98 
+       stop ost $@  || return 98 
 }
 
 mount_client() {
        local MOUNTPATH=$1
        echo "mount lustre on ${MOUNTPATH}....."
-       zconf_mount $MOUNTPATH $CMDVERBOSE || return 96
+       zconf_mount `hostname`  $MOUNTPATH  || return 96
 }
 
 umount_client() {
        local MOUNTPATH=$1
        echo "umount lustre on ${MOUNTPATH}....."
-       zconf_umount $MOUNTPATH $CMDVERBOSE || return 97
+       zconf_umount `hostname`  $MOUNTPATH || return 97
 }
 
 manual_umount_client(){
@@ -131,7 +128,7 @@ run_test 0 "single mount setup"
 test_1() {
        start_ost
        echo "start ost second time..."
-       start ost --reformat $OSTLCONFARGS $CMDVERBOSE 
+       start ost --reformat $OSTLCONFARGS 
        start_mds       
        mount_client $MOUNT
        check_mount || return 42
@@ -143,7 +140,7 @@ test_2() {
        start_ost
        start_mds       
        echo "start mds second time.."
-       start mds --reformat $MDSLCONFARGS $CMDVERBOSE 
+       start mds --reformat $MDSLCONFARGS 
        
        mount_client $MOUNT  
        check_mount || return 43
@@ -165,7 +162,7 @@ run_test 3 "mount client twice"
 test_4() {
        setup
        touch $DIR/$tfile || return 85
-       stop_ost ${FORCE}
+       stop_ost --force
        cleanup 
        eno=$?
        # ok for ost to fail shutdown
@@ -178,14 +175,27 @@ run_test 4 "force cleanup ost, then cleanup"
 
 test_5() {
        setup
-       touch $DIR/$tfile || return 86
-       stop_mds ${FORCE} || return 98
-       cleanup 
-       eno=$?
-       # ok for mds to fail shutdown
-       if [ 201 -ne $eno ]; then
-               return $eno;
-       fi
+       touch $DIR/$tfile || return 1
+       stop_mds --force || return 2
+
+       # cleanup may return an error from the failed 
+       # disconnects; for now I'll consider this successful 
+       # if all the modules have unloaded.
+       umount $MOUNT &
+       UMOUNT_PID=$!
+       sleep $TIMEOUT
+       echo "killing umount"
+       kill -TERM $UMOUNT_PID
+       wait $UMOUNT_PID 
+
+       # cleanup client modules
+       $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null 
+       
+       # stop_mds is a no-op here, and should not fail
+       stop_mds  || return 4
+       stop_ost || return 5
+
+       lsmod | grep -q portals && return 6
        return 0
 }
 run_test 5 "force cleanup mds, then cleanup"
@@ -454,13 +464,13 @@ test_14() {
         add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
             --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
         add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE \
-            --mkfsoptions -V
+            --mkfsoptions "-Llabel_conf_15"
         add_client client mds --lov lov1 --path $MOUNT
 
         FOUNDSTRING=`awk -F"<" '/<mkfsoptions>/{print $2}' $XMLCONFIG`
-        EXPECTEDSTRING="mkfsoptions>-V"
+        EXPECTEDSTRING="mkfsoptions>-Llabel_conf_15"
         if [ $EXPECTEDSTRING != $FOUNDSTRING ]; then
-                echo "Error:expected string: $EXPECTEDSTRING; found: $FOUNDSTRING"
+                echo "Error: expected: $EXPECTEDSTRING; found: $FOUNDSTRING"
                 return 1
         fi
         echo "Success:mkfsoptions for ost written to xml file correctly."
@@ -470,8 +480,12 @@ test_14() {
         start_ost
         start_mds
         mount_client $MOUNT || return $?
+        if [ -z "`dumpe2fs -h $OSTDEV | grep label_conf_15`" ]; then
+                echo "Error: the mkoptions not applied to mke2fs of ost."
+                return 1
+        fi
         cleanup
-        echo "lconf mkfsoptions-parsing for ost success"
+        echo "lconf mkfsoptions for ost success"
 
         gen_config
 }