Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 460adb2..757785f 100644 (file)
@@ -12,12 +12,17 @@ set -e
 ONLY=${ONLY:-"$*"}
 
 # These tests don't apply to mountconf
-MOUNTCONFSKIP="9 10 11 12 13 13b 14 15"
+MOUNTCONFSKIP="10 11 12 13 13b 14 15"
+# bug number for skipped test: 13739 
+HEAD_EXCEPT="                  32a 32b "
 
-# bug number for skipped test:                     2661 10510 12743
-ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP 16   23    36"
+# bug number for skipped test:                                  10510 12743
+ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP $HEAD_EXCEPT 23    36"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
+#                                                   
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="0 1 2 3 6 7 15 18 24b 25 30 31 32 33 34a "
+
 SRCDIR=`dirname $0`
 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
 
@@ -277,7 +282,10 @@ test_5c() {
        start_mds
        [ -d $MOUNT ] || mkdir -p $MOUNT
        grep " $MOUNT " /etc/mtab && echo "test 5c: mtab before mount" && return 10
-       mount -t lustre $MGSNID:/wrong.$FSNAME $MOUNT || :
+       local oldfs="${FSNAME}"
+       FSNAME="wrong.${FSNAME}"
+       mount_client $MOUNT || :
+       FSNAME=${oldfs}
        grep " $MOUNT " /etc/mtab && echo "test 5c: mtab after failed mount" && return 11
        umount_client $MOUNT
        cleanup_nocli  || return $?
@@ -613,6 +621,7 @@ test_15() {
 }
 run_test 15 "zconf-mount without /sbin/mount.lustre (should return error)"
 
+# LOGS/PENDING do not exist anymore since CMD3
 test_16() {
         TMPMTPT="${MOUNT%/*}/conf16"
 
@@ -625,41 +634,27 @@ test_16() {
 
         [ -f "$MDSDEV" ] && LOOPOPT="-o loop"
 
-        log "change the mode of $MDSDEV/OBJECTS,LOGS,PENDING to 555"
+        log "change the mode of $MDSDEV/OBJECTS to 555"
         do_facet mds "mkdir -p $TMPMTPT &&
                       mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
-                      chmod 555 $TMPMTPT/{OBJECTS,LOGS,PENDING} &&
+                      chmod 555 $TMPMTPT/OBJECTS &&
                       umount $TMPMTPT" || return $?
 
-        log "mount Lustre to change the mode of OBJECTS/LOGS/PENDING, then umount Lustre"
+        log "mount Lustre to change the mode of OBJECTS, then umount Lustre"
        setup
         check_mount || return 41
         cleanup || return $?
 
-        log "read the mode of OBJECTS/LOGS/PENDING and check if they has been changed properly"
+        log "read the mode of OBJECTS 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
                 log "Success:Lustre change the mode of OBJECTS correctly"
         else
                 error "Lustre does not change mode of OBJECTS properly"
         fi
-
-        if [ "$EXPECTEDLOGSMODE" = "0777" ]; then
-                log "Success:Lustre change the mode of LOGS correctly"
-        else
-                error "Lustre does not change mode of LOGS properly"
-        fi
-
-        if [ "$EXPECTEDPENDINGMODE" = "0777" ]; then
-                log "Success:Lustre change the mode of PENDING correctly"
-        else
-                error "Lustre does not change mode of PENDING properly"
-        fi
 }
-run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING"
+run_test 16 "verify that lustre will correct the mode of OBJECTS"
 
 test_17() {
         if [ ! -e "$MDSDEV" ]; then
@@ -766,8 +761,8 @@ test_21c() {
 run_test 21c "start mds between two osts, stop mds last"
 
 test_22() {
-        #reformat to remove all logs
-        reformat
+       #reformat to remove all logs
+       reformat
        start_mds
        echo Client mount before any osts are in the logs
        mount_client $MOUNT
@@ -821,6 +816,9 @@ test_23() {
 #run_test 23 "interrupt client during recovery mount delay"
 
 test_24a() {
+       #set up fs1 
+       gen_config
+       #set up fs2
        local fs2mds_HOST=$mds_HOST
        local fs2ost_HOST=$ost_HOST
        [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
@@ -1047,14 +1045,15 @@ test_29() {
        cleanup_nocli
        #writeconf to remove all ost2 traces for subsequent tests
        writeconf
+       start_mds
+       start_ost
+       cleanup
 }
 run_test 29 "permanently remove an OST"
 
 test_30() {
-       # start mds first after writeconf
-       start_mds
-       start_ost
-       mount_client $MOUNT
+       setup
+
        TEST="cat $LPROC/llite/$FSNAME-*/max_read_ahead_whole_mb"
        ORIG=$($TEST) 
        for i in $(seq 1 20); do 
@@ -1089,6 +1088,7 @@ test_32a() {
         [ -z "$TUNEFS" ] && skip "No tunefs" && return
        local DISK1_4=$LUSTRE/tests/disk1_4.zip
         [ ! -r $DISK1_4 ] && skip "Cant find $DISK1_4, skipping" && return
+       mkdir -p $TMP/$tdir
        unzip -o -j -d $TMP/$tdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; }
        load_modules
        sysctl lnet.debug=$PTLDEBUG
@@ -1150,6 +1150,7 @@ test_32b() {
         [ -z "$TUNEFS" ] && skip "No tunefs" && return
        local DISK1_4=$LUSTRE/tests/disk1_4.zip
         [ ! -r $DISK1_4 ] && skip "Cant find $DISK1_4, skipping" && return
+       mkdir -p $TMP/$tdir
        unzip -o -j -d $TMP/$tdir $DISK1_4 || { skip "Cant unzip $DISK1_4, skipping" && return ; }
        load_modules
        sysctl lnet.debug=$PTLDEBUG
@@ -1277,7 +1278,7 @@ test_34c() {
        cleanup
        return 0        
 }
-run_test 34c "force umount with failed mds should be normal"
+run_test 34c "force umount with failed ost should be normal"
 
 test_35() { # bug 12459
        setup
@@ -1292,7 +1293,7 @@ test_35() { # bug 12459
        log "Wait for RECONNECT_INTERVAL seconds (10s)"
        sleep 10
 
-       MSG="conf-sanity.sh test_33 `date +%F%kh%Mm%Ss`"
+       MSG="conf-sanity.sh test_35 `date +%F%kh%Mm%Ss`"
        $LCTL clear
        log "$MSG"
        log "Stopping the MDT:"
@@ -1401,7 +1402,93 @@ test_36() { # 12743
 }
 run_test 36 "df report consistency on OSTs with different block size"
 
-umount_client $MOUNT   
+test_37() {
+       LOCAL_MDSDEV="$TMP/mdt.img"
+       SYM_MDSDEV="$TMP/sym_mdt.img"
+
+       echo "MDS :     $LOCAL_MDSDEV"
+       echo "SYMLINK : $SYM_MDSDEV"
+       rm -f $LOCAL_MDSDEV
+
+       touch $LOCAL_MDSDEV
+       mkfs.lustre --reformat --fsname=lustre --mdt --mgs --device-size=9000 $LOCAL_MDSDEV ||
+               error "mkfs.lustre $LOCAL_MDSDEV failed"
+       ln -s $LOCAL_MDSDEV $SYM_MDSDEV
+
+       echo "mount symlink device - $SYM_MDSDEV"
+
+       mount_op=`mount -v -t lustre -o loop $SYM_MDSDEV ${MOUNT%/*}/mds 2>&1 | grep "unable to set tunable"`
+       umount -d ${MOUNT%/*}/mds
+       rm -f $LOCAL_MDSDEV $SYM_MDSDEV
+
+       if [ -n "$mount_op" ]; then
+               error "**** FAIL: set tunables failed for symlink device"
+       fi
+       return 0
+}
+run_test 37 "verify set tunables works for symlink device"
+
+test_38() { # bug 14222
+       setup
+       # like runtests
+       COUNT=10
+       SRC="/etc /bin"
+       FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
+       log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
+       mkdir -p $DIR/$tdir
+       tar cf - $FILES | tar xf - -C $DIR/$tdir || \
+               error "copying $SRC to $DIR/$tdir"
+       sync
+       umount_client $MOUNT
+       stop_mds
+       log "rename lov_objid file on MDS"
+       rm -f $TMP/lov_objid.orig
+       do_facet mds "debugfs -w $MDSDEV" <<-EOF
+               dump lov_objid $TMP/lov_objid.orig
+               rm lov_objid
+       EOF
+       do_facet mds "od -Ax -td8 $TMP/lov_objid.orig"
+       # check create in mds_lov_connect
+       start_mds
+       mount_client $MOUNT
+       for f in $FILES; do
+               [ $V ] && log "verifying $DIR/$tdir/$f"
+               diff $f $DIR/$tdir/$f || ERROR=y
+       done
+       do_facet mds "debugfs -c $MDSDEV" <<-EOF
+               dump lov_objid $TMP/lov_objid.new
+       EOF
+       do_facet mds "od -Ax -td8 $TMP/lov_objid.new"
+       [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
+       
+       
+       # check it's updates in sync
+       umount_client $MOUNT
+       stop_mds        
+       multiop $TMP/lov_objid.clear Ow4096c
+       do_facet mds "debugfs -w $MDSDEV" <<-EOF
+               write $TMP/lov_objid.clear lov_objid
+       EOF
+       start_mds
+       mount_client $MOUNT
+       for f in $FILES; do
+               [ $V ] && log "verifying $DIR/$tdir/$f"
+               diff $f $DIR/$tdir/$f || ERROR=y
+       done
+       do_facet mds "debugfs -c $MDSDEV" <<-EOF
+               dump lov_objid $TMP/lov_objid.new1
+       EOF
+       do_facet mds "od -Ax -td8 $TMP/lov_objid.new1"
+       umount_client $MOUNT
+       stop_mds
+       [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
+       
+       log "files compared the same"
+       #cleanup
+}
+run_test 38 "MDS recreates missing lov_objid file from OST data"
+
+umount_client $MOUNT
 cleanup_nocli
 cleanup_krb5_env