3 # add uml1 uml2 uml3 in your /etc/hosts
5 # FIXME - there is no reason to use all of these different
6 # return codes, espcially when most of them are mapped to something
7 # else anyway. The combination of test number and return code
8 # figure out what failed.
14 # bug number for skipped test: 13369
15 ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT 34a"
16 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
18 if [ "$FAILURE_MODE" = "HARD" ]; then
19 CONFIG_EXCEPTIONS="24a " && \
20 echo "Except the tests: $CONFIG_EXCEPTIONS for FAILURE_MODE=$FAILURE_MODE, bug 23573" && \
21 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $CONFIG_EXCEPTIONS"
25 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
28 LUSTRE=${LUSTRE:-`dirname $0`/..}
29 RLUSTRE=${RLUSTRE:-$LUSTRE}
32 . $LUSTRE/tests/test-framework.sh
34 # STORED_MDSSIZE is used in test_18
35 if [ -n "$MDSSIZE" ]; then
36 STORED_MDSSIZE=$MDSSIZE
38 # use small MDS + OST size to speed formatting time
41 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
43 if ! combined_mgs_mds; then
44 # bug number for skipped test: 23954
45 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 24b"
48 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
49 remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
52 [ "$SLOW" = "no" ] && EXCEPT_SLOW="30 31 45"
66 # who knows if/where $TUNEFS is installed? Better reformat if it fails...
67 do_facet ${facet} "$TUNEFS --quiet --writeconf $dev" ||
68 { echo "tunefs failed, reformatting instead" && reformat_and_config && return 1; }
75 # if writeconf fails anywhere, we reformat everything
76 writeconf1 mds $MDSDEV || return 0
77 writeconf1 ost1 `ostdevname 1` || return 0
78 writeconf1 ost2 `ostdevname 2` || return 0
82 # The MGS must be started before the OSTs for a new fs, so start
83 # and stop to generate the startup logs.
86 wait_osc_import_state mds ost FULL
91 reformat_and_config() {
93 if ! combined_mgs_mds ; then
101 start mgs $MGSDEV $MGS_MOUNT_OPTS
105 echo "start mds service on `facet_active_host mds`"
106 start mds $MDSDEV $MDS_MOUNT_OPTS $@ || return 94
110 echo "stop mgs service on `facet_active_host mgs`"
111 # These tests all use non-failover stop
112 stop mgs -f || return 97
116 if ! combined_mgs_mds ; then
123 echo "stop mds service on `facet_active_host mds`"
124 # These tests all use non-failover stop
125 stop mds -f || return 97
129 echo "start ost1 service on `facet_active_host ost1`"
130 start ost1 `ostdevname 1` $OST_MOUNT_OPTS $@ || return 95
134 echo "stop ost1 service on `facet_active_host ost1`"
135 # These tests all use non-failover stop
136 stop ost1 -f || return 98
140 echo "start ost2 service on `facet_active_host ost2`"
141 start ost2 `ostdevname 2` $OST_MOUNT_OPTS $@ || return 92
145 echo "stop ost2 service on `facet_active_host ost2`"
146 # These tests all use non-failover stop
147 stop ost2 -f || return 93
151 echo "start client on `facet_active_host client`"
152 start client || return 99
156 echo "stop client on `facet_active_host client`"
157 stop client || return 100
162 echo "mount $FSNAME on ${MOUNTPATH}....."
163 zconf_mount `hostname` $MOUNTPATH || return 96
167 local SAVEMOUNTOPT=$MOUNTOPT
168 MOUNTOPT="remount,$1"
170 echo "remount '$1' lustre on ${MOUNTPATH}....."
171 zconf_mount `hostname` $MOUNTPATH || return 96
172 MOUNTOPT=$SAVEMOUNTOPT
177 echo "umount lustre on ${MOUNTPATH}....."
178 zconf_umount `hostname` $MOUNTPATH || return 97
181 manual_umount_client(){
184 echo "manual umount lustre on ${MOUNT}...."
185 do_facet client "umount -d ${FORCE} $MOUNT"
191 start_mds || error "MDT start failed"
192 start_ost || error "OST start failed"
193 mount_client $MOUNT || error "client start failed"
198 if ! combined_mgs_mds ; then
207 unload_modules_conf () {
208 if combined_mgs_mds || ! local_mode; then
209 unload_modules || return 1
214 stop_mds || return 201
215 stop_ost || return 202
216 unload_modules_conf || return 203
220 umount_client $MOUNT || return 200
221 cleanup_nocli || return $?
225 do_facet client "cp /etc/passwd $DIR/a" || return 71
226 do_facet client "rm $DIR/a" || return 72
227 # make sure lustre is actually mounted (touch will block,
228 # but grep won't, so do it after)
229 do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
230 echo "setup single mount lustre success"
234 do_facet client "touch $DIR/a" || return 71
235 do_facet client "rm $DIR/a" || return 72
236 do_facet client "touch $DIR2/a" || return 73
237 do_facet client "rm $DIR2/a" || return 74
238 echo "setup double mount lustre success"
243 if [ "$ONLY" == "setup" ]; then
248 if [ "$ONLY" == "cleanup" ]; then
253 #create single point mountpoint
259 check_mount || return 41
262 run_test 0 "single mount setup"
266 echo "start ost second time..."
267 start_ost && error "2nd OST start should fail"
268 start_mds || error "MDT start failed"
269 mount_client $MOUNT || error "client start failed"
270 check_mount || return 42
273 run_test 1 "start up ost twice (should return errors)"
278 echo "start mds second time.."
279 start_mds && error "2nd MDT start should fail"
281 check_mount || return 43
284 run_test 2 "start up mds twice (should return err)"
288 #mount.lustre returns an error if already in mtab
289 mount_client $MOUNT && error "2nd client mount should fail"
290 check_mount || return 44
293 run_test 3 "mount client twice (should return err)"
297 touch $DIR/$tfile || return 85
301 # ok for ost to fail shutdown
302 if [ 202 -ne $eno ]; then
307 run_test 4 "force cleanup ost, then cleanup"
309 test_5a() { # was test_5
311 touch $DIR/$tfile || return 1
312 fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
314 stop_mds -f || return 2
316 # cleanup may return an error from the failed
317 # disconnects; for now I'll consider this successful
318 # if all the modules have unloaded.
322 echo "killing umount"
323 kill -TERM $UMOUNT_PID
324 echo "waiting for umount to finish"
326 if grep " $MOUNT " /proc/mounts; then
327 echo "test 5: /proc/mounts after failed umount"
331 echo "killing umount"
332 kill -TERM $UMOUNT_PID
333 echo "waiting for umount to finish"
335 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
339 # stop_mds is a no-op here, and should not fail
340 cleanup_nocli || return $?
341 # df may have lingering entry
343 # mtab may have lingering entry
347 while [ "$WAIT" -ne "$MAX_WAIT" ]; do
349 grep -q $MOUNT" " /etc/mtab || break
350 echo "Waiting /etc/mtab updated ... "
351 WAIT=$(( WAIT + sleep))
353 [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
354 echo "/etc/mtab updated in $WAIT secs"
356 run_test 5a "force cleanup mds, then cleanup"
364 grep " $MOUNT " /etc/mtab && \
365 error false "unexpected entry in mtab before mount" && return 10
369 if ! combined_mgs_mds ; then
370 trap cleanup_5b EXIT ERR
375 [ -d $MOUNT ] || mkdir -p $MOUNT
376 mount_client $MOUNT && rc=1
377 grep " $MOUNT " /etc/mtab && \
378 error "$MOUNT entry in mtab after failed mount" && rc=11
380 # stop_mds is a no-op here, and should not fail
381 cleanup_nocli || rc=$?
382 if ! combined_mgs_mds ; then
387 run_test 5b "Try to start a client with no MGS (should return errs)"
390 grep " $MOUNT " /etc/mtab && \
391 error false "unexpected entry in mtab before mount" && return 10
396 [ -d $MOUNT ] || mkdir -p $MOUNT
397 local oldfs="${FSNAME}"
398 FSNAME="wrong.${FSNAME}"
399 mount_client $MOUNT || :
401 grep " $MOUNT " /etc/mtab && \
402 error "$MOUNT entry in mtab after failed mount" && rc=11
404 cleanup_nocli || rc=$?
407 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
410 grep " $MOUNT " /etc/mtab && \
411 error false "unexpected entry in mtab before mount" && return 10
417 mount_client $MOUNT || rc=1
419 grep " $MOUNT " /etc/mtab && \
420 error "$MOUNT entry in mtab after unmount" && rc=11
423 run_test 5d "mount with ost down"
426 grep " $MOUNT " /etc/mtab && \
427 error false "unexpected entry in mtab before mount" && return 10
433 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
434 do_facet client "lctl set_param fail_loc=0x80000506"
435 mount_client $MOUNT || echo "mount failed (not fatal)"
437 grep " $MOUNT " /etc/mtab && \
438 error "$MOUNT entry in mtab after unmount" && rc=11
441 run_test 5e "delayed connect, don't crash (bug 10268)"
444 if combined_mgs_mds ; then
445 skip "combined mgs and mds"
449 grep " $MOUNT " /etc/mtab && \
450 error false "unexpected entry in mtab before mount" && return 10
454 [ -d $MOUNT ] || mkdir -p $MOUNT
455 mount_client $MOUNT &
457 echo client_mount pid is $pid
461 if ! ps -f -p $pid >/dev/null; then
464 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
465 error "mount returns $rc, expected to hang"
474 # mount should succeed after start mds
477 [ $rc -eq 0 ] || error "mount returned $rc"
478 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
482 run_test 5f "mds down, cleanup after failed mount (bug 2712)"
487 mount_client ${MOUNT} || return 87
488 touch $DIR/a || return 86
491 run_test 6 "manual umount, then mount again"
496 cleanup_nocli || return $?
498 run_test 7 "manual umount, then cleanup"
503 check_mount2 || return 45
504 umount_client $MOUNT2
507 run_test 8 "double mount setup"
512 do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
513 do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
515 CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
516 # interop 1.8 <-> 2.0: "trace inode warning error emerg console"
517 local lustre_version=$(get_lustre_version ost1)
518 echo ost1 running $lustre_version
519 if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ]; then
520 echo "lnet.debug success"
521 elif [[ $lustre_version != 1.8* ]] && \
522 [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ]; then
523 echo "lnet.debug success"
525 echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
528 CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
529 if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
530 echo "lnet.subsystem_debug success"
532 echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
535 stop_ost || return $?
537 run_test 9 "test ptldebug and subsystem for mkfs"
545 do_facet $facet "test -b $dev" || rc=1
546 if [[ "$size" ]]; then
547 local in=$(do_facet $facet "dd if=$dev of=/dev/null bs=1k count=1 skip=$size 2>&1" |\
548 awk '($3 == "in") { print $1 }')
549 [[ $in = "1+0" ]] || rc=1
556 # Skip this test if MDS is 2.0+, see bug 22944.
557 if [[ "$(get_mds_version_major)" != "1" ]]; then
558 skip "not running on 2.0 server"
563 check_mount || return 41
566 local TMPMTPT="${TMP}/conf16"
567 local files="{OBJECTS,PENDING,LOGS}"
569 is_blkdev mds $MDSDEV || LOOPOPT="-o loop"
571 log "change the mode of $MDSDEV/$files to 555"
572 do_facet mds "mkdir -p $TMPMTPT &&
573 mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
574 chmod 555 $TMPMTPT/$files &&
575 umount $TMPMTPT" || return $?
577 log "mount Lustre to change the mode of $files, then umount Lustre"
579 check_mount || return 41
582 log "read the mode of $files and check if they has been changed properly"
584 for file in ${files//[\{\},]/ }; do
585 expected=`do_facet mds "$DEBUGFS -R 'stat $file' $MDSDEV 2> /dev/null" | \
586 grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
588 if [ "$expected" = "0777" ]; then
589 log "Success:Lustre change the mode of $file correctly"
591 error "Lustre does not change mode of $file properly"
595 run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING"
599 check_mount || return 41
602 echo "Remove mds config log"
603 if ! combined_mgs_mds ; then
607 do_facet mgs "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MGSDEV || return \$?" || return $?
609 if ! combined_mgs_mds ; then
614 start_mds && return 42
617 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
620 [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return
625 # check if current MDSSIZE is large enough
626 [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
627 log "use MDSSIZE=$MDSSIZE"
629 # check if the global config has a large enough MDSSIZE
630 [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
631 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
632 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
634 # check if the block device is large enough
635 [ -z "$OK" ] && $(is_blkdev mds $MDSDEV $MIN) && OK=1 &&
636 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
638 # check if a loopback device has enough space for fs metadata (5%)
640 if [ -z "$OK" ]; then
641 local SPACE=$(do_facet mds "[ -f $MDSDEV -o ! -e $MDSDEV ] && df -P \\\$(dirname $MDSDEV)" |
642 awk '($1 != "Filesystem") {print $4}')
643 ! [ -z "$SPACE" ] && [ $SPACE -gt $((MIN / 20)) ] && \
644 OK=1 && myMDSSIZE=$MIN && \
645 log "use file $MDSDEV with MIN=$MIN"
648 [ -z "$OK" ] && skip_env "$MDSDEV too small for ${MIN}kB MDS" && return
651 echo "mount mds with large journal..."
652 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
654 local opts="--mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
656 if combined_mgs_mds ; then
657 MDS_MKFS_OPTS="--mgs $opts"
659 MDS_MKFS_OPTS="--mgsnode=$MGSNID $opts"
663 echo "mount lustre system..."
665 check_mount || return 41
667 echo "check journal size..."
668 local FOUNDSIZE=$(do_facet mds "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}')
669 if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
670 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
672 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
677 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
680 run_test 18 "check mkfs creates large journals"
683 start_mds || return 1
684 stop_mds -f || return 2
686 run_test 19a "start/stop MDS without OSTs"
689 start_ost || return 1
690 stop_ost -f || return 2
692 run_test 19b "start/stop OSTs without MDS"
695 # first format the ost/mdt
699 check_mount || return 43
701 remount_client ro $MOUNT || return 44
702 touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
703 [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
704 remount_client rw $MOUNT || return 47
706 [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
707 MCNT=`grep -c $MOUNT /etc/mtab`
708 [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
713 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
718 wait_osc_import_state mds ost FULL
722 run_test 21a "start mds before ost, stop ost first"
727 wait_osc_import_state mds ost FULL
731 run_test 21b "start ost before mds, stop mds first"
737 wait_osc_import_state mds ost2 FULL
742 #writeconf to remove all ost2 traces for subsequent tests
745 run_test 21c "start mds between two osts, stop mds last"
748 if combined_mgs_mds ; then
749 skip "need separate mgs device" && return 0
765 run_test 21d "start mgs then ost and then mds"
771 echo Client mount with ost in logs, but none running
773 wait_osc_import_state mds ost FULL
776 # check_mount will block trying to contact ost
777 mcreate $DIR/$tfile || return 40
778 rm -f $DIR/$tfile || return 42
782 echo Client mount with a running ost
785 check_mount || return 41
790 run_test 22 "start a client before osts (should return errs)"
792 test_23a() { # was test_23
796 # force down client so that recovering mds waits for reconnect
797 local running=$(grep -c $MOUNT /proc/mounts) || true
798 if [ $running -ne 0 ]; then
799 echo "Stopping client $MOUNT (opts: -f)"
803 # enter recovery on mds
805 # try to start a new client
806 mount_client $MOUNT &
808 MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
809 MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
810 echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
812 ps --ppid $MOUNT_LUSTRE_PID
813 # FIXME why o why can't I kill these? Manual "ctrl-c" works...
814 kill -TERM $MOUNT_LUSTRE_PID
815 echo "waiting for mount to finish"
817 # we can not wait $MOUNT_PID because it is not a child of this shell
823 while [ "$WAIT" -lt "$MAX_WAIT" ]; do
825 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
826 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
829 [ -z "$PID1" -a -z "$PID2" ] && break
830 echo "waiting for mount to finish ... "
831 WAIT=$(( WAIT + sleep))
833 if [ "$WAIT" -eq "$MAX_WAIT" ]; then
834 error "MOUNT_PID $MOUNT_PID and \
835 MOUNT__LUSTRE_PID $MOUNT__LUSTRE_PID still not killed in $WAIT secs"
841 run_test 23a "interrupt client during recovery mount delay"
846 test_23b() { # was test_23
849 # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
850 lctl set_param fail_loc=0x80000313
854 run_test 23b "Simulate -EINTR during mount"
856 fs2mds_HOST=$mds_HOST
857 fs2ost_HOST=$ost_HOST
861 echo "umount $MOUNT2 ..."
862 umount $MOUNT2 || true
863 echo "stopping fs2mds ..."
864 stop fs2mds -f || true
865 echo "stopping fs2ost ..."
866 stop fs2ost -f || true
870 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
871 is_blkdev mds $MDSDEV && \
872 skip_env "mixed loopback and real device not working" && return
875 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
877 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
878 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
880 # test 8-char fsname as well
881 local FSNAME2=test1234
882 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
884 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
887 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
888 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
890 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
892 check_mount || return 2
893 # files written on 1 should not show up on 2
894 cp /etc/passwd $DIR/$tfile
896 [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
898 cp /etc/passwd $MOUNT2/b || return 3
899 rm $MOUNT2/b || return 4
900 # 2 is actually mounted
901 grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
903 facet_failover fs2mds
904 facet_failover fs2ost
907 # the MDS must remain up until last MDT
910 local mdt_obdname=$(do_facet mds "lctl get_param -n devices" | \
911 awk '/ mdt / { print $4 }' | head -1)
912 [ -z "$mdt_obdname" ] && error "No MDT" && return 8
915 cleanup_nocli || return 6
917 run_test 24a "Multiple MDTs on a single node"
920 if [ -z "$fs2mds_DEV" ]; then
921 is_blkdev mds $MDSDEV && \
922 skip_env "mixed loopback and real device not working" && return
925 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
927 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10
929 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
932 run_test 24b "Multiple MGSs on a single node (should return err)"
936 check_mount || return 2
937 local MODULES=$($LCTL modules | awk '{ print $2 }')
938 rmmod $MODULES 2>/dev/null || true
941 run_test 25 "Verify modules are referenced"
945 # we need modules before mount for sysctl, so make sure...
946 do_facet mds "lsmod | grep -q lustre || modprobe lustre"
947 #define OBD_FAIL_MDS_FS_SETUP 0x135
948 do_facet mds "lctl set_param fail_loc=0x80000135"
949 start_mds && echo MDS started && return 1
950 lctl get_param -n devices
951 DEVS=$(lctl get_param -n devices | egrep -v MG | wc -l)
952 [ $DEVS -gt 0 ] && return 2
953 unload_modules_conf || return $?
955 run_test 26 "MDT startup failure cleans LOV (should return errs)"
961 local ORIG=$(do_facet $myfacet "$TEST")
962 if [ $# -gt 3 ]; then
968 echo "Setting $PARAM from $ORIG to $FINAL"
969 do_facet mds "$LCTL conf_param $PARAM=$FINAL" || error conf_param failed
971 wait_update $(facet_host $myfacet) "$TEST" $FINAL || error check failed!
975 start_ost || return 1
976 start_mds || return 2
977 echo "Requeue thread should have started: "
978 ps -e | grep ll_cfg_requeue
979 set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
982 run_test 27a "Reacquire MGS lock if OST started first"
987 # interop 1.8 <-> 2.0:
988 # 1.8: group_acquire_expire, 2.0: identity_acquire_expire
989 local acquire_expire=$(do_facet mds lctl get_param md*.$FSNAME-MDT0000.*acquire_expire | \
990 cut -d= -f1 | cut -d. -f3)
992 set_and_check mds "lctl get_param -n md*.$FSNAME-MDT0000.$acquire_expire" \
993 "$FSNAME-MDT0000.mdt.$acquire_expire" || return 3
994 set_and_check client "lctl get_param -n mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight" \
995 "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4
999 run_test 27b "Reacquire MGS lock after failover"
1003 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1004 PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
1006 FINAL=$(($ORIG + 1))
1007 set_and_check client "$TEST" "$PARAM" $FINAL || return 3
1008 FINAL=$(($FINAL + 1))
1009 set_and_check client "$TEST" "$PARAM" $FINAL || return 4
1010 umount_client $MOUNT || return 200
1013 if [ $RESULT -ne $FINAL ]; then
1014 echo "New config not seen: wanted $FINAL got $RESULT"
1017 echo "New config success: got $RESULT"
1019 set_and_check client "$TEST" "$PARAM" $ORIG || return 5
1022 run_test 28 "permanent parameter setting"
1025 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
1026 setup > /dev/null 2>&1
1030 local PARAM="$FSNAME-OST0001.osc.active"
1031 local PROC_ACT="osc.$FSNAME-OST0001-osc-*.active"
1032 local PROC_UUID="osc.$FSNAME-OST0001-osc-*.ost_server_uuid"
1034 ACTV=$(lctl get_param -n $PROC_ACT)
1036 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
1037 # also check ost_server_uuid status
1038 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
1039 if [ -z "$RESULT" ]; then
1040 echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
1043 echo "Live client success: got $RESULT"
1047 local MPROC="osc.$(get_mdtosc_proc_path $FSNAME-OST0001).active"
1052 RESULT=`do_facet mds " lctl get_param -n $MPROC"`
1053 [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
1054 if [ $RESULT -eq $DEAC ]; then
1055 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
1059 if [ $WAIT -eq $MAX ]; then
1060 echo "MDT not deactivated: wanted $DEAC got $RESULT"
1063 echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
1066 # test new client starts deactivated
1067 umount_client $MOUNT || return 200
1069 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
1070 if [ -z "$RESULT" ]; then
1071 echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
1074 echo "New client success: got $RESULT"
1077 # make sure it reactivates
1078 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
1080 umount_client $MOUNT
1083 #writeconf to remove all ost2 traces for subsequent tests
1086 run_test 29 "permanently remove an OST"
1091 echo Big config llog
1092 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1094 LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
1095 for i in ${LIST[@]}; do
1096 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
1098 # make sure client restart still works
1099 umount_client $MOUNT
1100 mount_client $MOUNT || return 4
1101 [ "$($TEST)" -ne "$i" ] && error "Param didn't stick across restart $($TEST) != $i"
1104 echo Erase parameter setting
1105 do_facet mgs "$LCTL conf_param -d $FSNAME.llite.max_read_ahead_whole_mb" || return 6
1106 umount_client $MOUNT
1107 mount_client $MOUNT || return 6
1109 echo "deleted (default) value=$FINAL, orig=$ORIG"
1110 # assumes this parameter started at the default value
1111 [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
1115 run_test 30a "Big config llog and conf_param deletion"
1120 # Make a fake nid. Use the OST nid, and add 20 to the least significant
1121 # numerical part of it. Hopefully that's not already a failover address for
1123 OSTNID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
1124 ORIGVAL=$(echo $OSTNID | egrep -oi "[0-9]*@")
1125 NEWVAL=$((($(echo $ORIGVAL | egrep -oi "[0-9]*") + 20) % 256))
1126 NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
1127 echo "Using fake nid $NEW"
1129 TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
1130 set_and_check client "$TEST" "$FSNAME-OST0000.failover.node" $NEW || error "didn't add failover nid $NEW"
1131 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1133 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1134 echo "should have 2 failover nids: $NIDCOUNT"
1135 [ $NIDCOUNT -eq 2 ] || error "Failover nid not added"
1136 do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed"
1137 umount_client $MOUNT
1138 mount_client $MOUNT || return 3
1140 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1142 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1143 echo "only 1 final nid should remain: $NIDCOUNT"
1144 [ $NIDCOUNT -eq 1 ] || error "Failover nids not removed"
1148 run_test 30b "Remove failover nids"
1150 test_31() { # bug 10734
1151 # ipaddr must not exist
1152 mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
1155 run_test 31 "Connect to non-existent node (returns errors, should not crash)"
1157 # Use these start32/stop32 fn instead of t-f start/stop fn,
1158 # for local devices, to skip global facet vars init
1162 echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
1163 umount -d $@ ${MOUNT%/*}/${facet}
1172 mkdir -p ${MOUNT%/*}/${facet}
1174 echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
1175 mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
1177 if [ $RC -ne 0 ]; then
1178 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
1179 echo "Start of ${device} of local ${facet} failed ${RC}"
1185 cleanup_nocli32 () {
1193 echo "Cleanup test_32 umount $MOUNT ..."
1194 umount -f $MOUNT || true
1195 echo "Cleanup local mds ost1 ..."
1197 combined_mgs_mds || start_mgs
1202 # this test is totally useless on a client-only system
1203 client_only && skip "client only testing" && return 0
1204 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1205 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
1207 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1208 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1210 local tmpdir=$TMP/conf32a
1213 tar xjvf $DISK1_6 -C $tmpdir ||
1214 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1216 lctl set_param debug=$PTLDEBUG
1218 $TUNEFS $tmpdir/mds || error "tunefs failed"
1220 combined_mgs_mds || stop mgs
1222 # nids are wrong, so client wont work, but server should start
1223 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1224 trap cleanup_32 EXIT INT || return 3
1226 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1228 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1230 $TUNEFS --mgsnode=`hostname` $tmpdir/ost1 || error "tunefs failed"
1231 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1232 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1234 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1236 local NID=$($LCTL list_nids | head -1)
1238 echo "OSC changes should succeed:"
1239 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1240 $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1242 echo "MDC changes should succeed:"
1243 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1244 $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1249 # mount a second time to make sure we didnt leave upgrade flag on
1251 $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1253 combined_mgs_mds || stop mgs
1255 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1256 trap cleanup_32 EXIT INT || return 12
1260 rm -rf $tmpdir || true # true is only for TMP on NFS
1262 run_test 32a "Upgrade from 1.6 (not live)"
1265 # this test is totally useless on a client-only system
1266 client_only && skip "client only testing" && return 0
1267 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1268 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return
1270 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1271 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1273 local tmpdir=$TMP/conf32b
1276 tar xjvf $DISK1_6 -C $tmpdir ||
1277 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1280 lctl set_param debug=$PTLDEBUG
1282 # Ugrade process in according to comment 2 bug 20246
1283 # writeconf will cause servers to register with their current nids
1284 $TUNEFS --mdt --writeconf --erase-param \
1285 --param="mdt.group_upcall=/usr/sbin/l_getgroups" $tmpdir/mds || \
1286 error "tunefs mds failed"
1288 combined_mgs_mds || stop mgs
1290 start32 mds $tmpdir/mds "-o loop,abort_recov" && \
1291 trap cleanup_32 EXIT INT || return 3
1294 start32 mds "-o loop" $tmpdir/mds || return 4
1295 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1297 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1299 $TUNEFS --ost --writeconf --erase-param --mgsnode=`hostname`@$NETTYPE $tmpdir/ost1 || \
1300 error "tunefs ost failed"
1301 start32 ost1 $tmpdir/ost1 "-o loop,abort_recov" || return 5
1303 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1305 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1307 local NID=$($LCTL list_nids | head -1)
1309 echo "OSC changes should succeed:"
1310 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || error "OSC conf_param failed"
1311 $LCTL conf_param lustre-OST0000.failover.node=$NID || error "add failover nid=$NID failed"
1313 echo "MDC changes should succeed:"
1314 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1317 # MDT and OST should have registered with new nids, so we should have
1318 # a fully-functioning client
1319 echo "Check client and old fs contents"
1321 local device=`h2$NETTYPE $HOSTNAME`:/lustre
1322 echo "Starting local client: $HOSTNAME: $device $MOUNT"
1323 mount -t lustre $device $MOUNT || return 1
1325 local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
1326 local new=$((old + 5))
1327 lctl conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=$new
1328 wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1330 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2940530074 2837" ] || return 12
1335 rm -rf $tmpdir || true # true is only for TMP on NFS
1337 run_test 32b "Upgrade from 1.6 with writeconf"
1339 test_33a() { # bug 12333, was test_33
1341 local FSNAME2=test-123
1342 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1344 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1345 is_blkdev mds $MDSDEV && \
1346 skip_env "mixed loopback and real device not working" && return
1349 # interop 1.8 <-> 2.0
1351 local major=$(get_mds_version_major)
1352 local minor=$(get_mds_version_minor)
1353 if [ $major -le 1 -a $minor -le 8 ]; then
1356 mkfs_opts="--mkfsoptions='-J size=8'" # bug 17931
1359 combined_mgs_mds || mkfs_opts="$mkfs_opts --nomgs"
1361 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1362 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1363 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} $mkfs_opts --reformat $fs2mdsdev || exit 10
1364 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1366 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1367 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1368 do_facet mds "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1370 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1371 cp /etc/hosts $MOUNT2/. || rc=3
1374 cp /etc/hosts $MOUNT2/ || rc=3
1375 $LFS getstripe $MOUNT2/hosts
1380 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1381 cleanup_nocli || rc=6
1384 run_test 33a "Mount ost with a large index number"
1386 test_33b() { # was test_33a
1389 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1390 # Drop lock cancelation reply during umount
1391 #define OBD_FAIL_LDLM_CANCEL 0x304
1392 do_facet client lctl set_param fail_loc=0x80000304
1393 #lctl set_param debug=-1
1394 umount_client $MOUNT
1397 run_test 33b "Drop cancel during umount"
1401 do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1402 manual_umount_client
1404 do_facet client killall -USR1 multiop
1405 if [ $rc -eq 0 ]; then
1406 error "umount not fail!"
1411 run_test 34a "umount with opened file should be fail"
1416 touch $DIR/$tfile || return 1
1417 stop_mds --force || return 2
1419 manual_umount_client --force
1421 if [ $rc -ne 0 ]; then
1422 error "mtab after failed umount - rc $rc"
1428 run_test 34b "force umount with failed mds should be normal"
1432 touch $DIR/$tfile || return 1
1433 stop_ost --force || return 2
1435 manual_umount_client --force
1437 if [ $rc -ne 0 ]; then
1438 error "mtab after failed umount - rc $rc"
1444 run_test 34c "force umount with failed ost should be normal"
1446 test_35a() { # bug 12459
1450 lctl set_param debug="ha"
1452 log "Set up a fake failnode for the MDS"
1454 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || return 4
1456 log "Wait for RECONNECT_INTERVAL seconds (10s)"
1459 MSG="conf-sanity.sh test_35a `date +%F%kh%Mm%Ss`"
1462 log "Stopping the MDT:"
1463 stop_mds || return 5
1465 df $MOUNT > /dev/null 2>&1 &
1467 log "Restarting the MDT:"
1468 start_mds || return 6
1469 log "Wait for df ($DFPID) ... "
1474 # retrieve from the log the first server that the client tried to
1475 # contact after the connection loss
1476 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1477 NEXTCONN=`awk "/${MSG}/ {start = 1;}
1478 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1480 if (\\\$NF ~ /$FAKENID/)
1486 }" $TMP/lustre-log-$TESTNAME.log`
1487 [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1489 # remove nid settings
1492 run_test 35a "Reconnect to the last active server first"
1494 test_35b() { # bug 18674
1495 remote_mds || { skip "local MDS" && return 0; }
1499 $LCTL set_param debug="ha"
1501 MSG="conf-sanity.sh test_35b `date +%F%kh%Mm%Ss`"
1504 log "Set up a fake failnode for the MDS"
1506 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || \
1509 local at_max_saved=0
1510 # adaptive timeouts may prevent seeing the issue
1511 if at_is_enabled; then
1512 at_max_saved=$(at_max_get mds)
1513 at_max_set 0 mds client
1516 mkdir -p $MOUNT/$tdir
1518 log "Injecting EBUSY on MDS"
1519 # Setting OBD_FAIL_MDS_RESEND=0x136
1520 do_facet mds "$LCTL set_param fail_loc=0x80000136" || return 2
1522 $LCTL set_param mdc.${FSNAME}*.stats=clear
1524 log "Creating a test file and stat it"
1525 touch $MOUNT/$tdir/$tfile
1526 stat $MOUNT/$tdir/$tfile
1528 log "Stop injecting EBUSY on MDS"
1529 do_facet mds "$LCTL set_param fail_loc=0" || return 3
1530 rm -f $MOUNT/$tdir/$tfile
1533 # restore adaptive timeout
1534 [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds client
1536 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1538 CONNCNT=`$LCTL get_param mdc.${FSNAME}*.stats | awk '/mds_connect/{print $2}'`
1540 # retrieve from the log if the client has ever tried to
1541 # contact the fake server after the loss of connection
1542 FAILCONN=`awk "BEGIN {ret = 0;}
1543 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1545 if (\\\$NF ~ /$FAKENID/) {
1550 END {print ret}" $TMP/lustre-log-$TESTNAME.log`
1552 [ "$FAILCONN" == "0" ] && \
1553 log "ERROR: The client reconnection has not been triggered" && \
1555 [ "$FAILCONN" == "2" ] && \
1556 log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
1559 # When OBD_FAIL_MDS_RESEND is hit, we sleep for 2 * obd_timeout
1560 # Reconnects are supposed to be rate limited to one every 5s
1561 [ $CONNCNT -gt $((2 * $TIMEOUT / 5 + 1)) ] && \
1562 log "ERROR: Too many reconnects $CONNCNT" && \
1566 # remove nid settings
1569 run_test 35b "Continue reconnection retries, if the active server is busy"
1572 [ $OSTCOUNT -lt 2 ] && skip_env "skipping test for single OST" && return
1574 [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1575 { skip "remote OST" && return 0; }
1578 local FSNAME2=test1234
1579 local fs3ost_HOST=$ost_HOST
1581 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1583 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1584 is_blkdev mds $MDSDEV && \
1585 skip_env "mixed loopback and real device not working" && return
1588 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1589 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1590 local fs3ostdev=${fs3ost_DEV:-$(ostdevname 2)_2}
1591 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1592 # XXX after we support non 4K disk blocksize, change following --mkfsoptions with
1594 add fs2ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1595 add fs3ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs3ostdev || exit 10
1597 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1598 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1599 start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1601 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1603 sleep 5 # until 11778 fixed
1605 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1607 BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1608 BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1609 BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1610 STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1611 DFTOTAL=`echo $STRING | cut -d, -f1`
1612 DFUSED=`echo $STRING | cut -d, -f2`
1613 DFAVAIL=`echo $STRING | cut -d, -f3`
1614 DFFREE=$(($DFTOTAL - $DFUSED))
1616 ALLOWANCE=$((64 * $OSTCOUNT))
1618 if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||
1619 [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1620 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1623 if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] ||
1624 [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1625 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1628 if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] ||
1629 [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1630 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1635 stop fs3ost -f || return 200
1636 stop fs2ost -f || return 201
1637 stop fs2mds -f || return 202
1638 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev $fs3ostdev
1639 unload_modules_conf || return 203
1642 run_test 36 "df report consistency on OSTs with different block size"
1645 local mntpt=$(facet_mntpt mds)
1646 local mdsdev=$MDSDEV
1647 local mdsdev_sym="$TMP/sym_mdt.img"
1649 echo "MDS : $mdsdev"
1650 echo "SYMLINK : $mdsdev_sym"
1651 do_facet mds rm -f $mdsdev_sym
1653 do_facet mds ln -s $mdsdev $mdsdev_sym
1655 echo "mount symlink device - $mdsdev_sym"
1658 mount_op=$(do_facet mds mount -v -t lustre $MDS_MOUNT_OPTS $mdsdev_sym $mntpt 2>&1 )
1661 echo mount_op=$mount_op
1663 do_facet mds "umount -d $mntpt && rm -f $mdsdev_sym"
1665 if $(echo $mount_op | grep -q "unable to set tunable"); then
1666 error "set tunables failed for symlink device"
1669 [ $rc -eq 0 ] || error "mount symlink $mdsdev_sym failed! rc=$rc"
1673 run_test 37 "verify set tunables works for symlink device"
1675 test_38() { # bug 14222
1680 FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1681 log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1683 tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1684 error "copying $SRC to $DIR/$tdir"
1686 umount_client $MOUNT
1688 log "rename lov_objid file on MDS"
1689 rm -f $TMP/lov_objid.orig
1690 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1691 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1693 do_facet mds "od -Ax -td8 $TMP/lov_objid.orig"
1694 # check create in mds_lov_connect
1698 [ $V ] && log "verifying $DIR/$tdir/$f"
1699 diff -q $f $DIR/$tdir/$f || ERROR=y
1701 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
1702 do_facet mds "od -Ax -td8 $TMP/lov_objid.new"
1703 [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1706 # check it's updates in sync
1707 umount_client $MOUNT
1710 do_facet mds dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1711 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1712 do_facet mds "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1717 [ $V ] && log "verifying $DIR/$tdir/$f"
1718 diff -q $f $DIR/$tdir/$f || ERROR=y
1720 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1721 do_facet mds "od -Ax -td8 $TMP/lov_objid.new1"
1722 umount_client $MOUNT
1724 [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1726 log "files compared the same"
1729 run_test 38 "MDS recreates missing lov_objid file from OST data"
1731 test_39() { #bug 14413
1735 perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' &&
1736 error "memory leak detected" || true
1738 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1740 test_40() { # bug 15759
1742 #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706
1743 do_facet mds "lctl set_param fail_loc=0x80000706"
1747 run_test 40 "race during service thread startup"
1749 test_41() { #bug 14134
1751 start mds $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1752 start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1753 start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1755 mount_client $MOUNT || return 1
1758 echo "blah blah" > $MOUNT/$tfile
1761 umount_client $MOUNT
1762 stop ost1 -f || return 201
1763 stop mds -f || return 202
1764 stop mds -f || return 203
1765 unload_modules_conf || return 204
1768 run_test 41 "mount mds with --nosvc and --nomgs"
1770 test_42() { #bug 14693
1772 check_mount || return 2
1773 do_facet client lctl conf_param lustre.llite.some_wrong_param=10
1774 umount_client $MOUNT
1775 mount_client $MOUNT || return 1
1779 run_test 42 "invalid config param should not prevent client from mounting"
1781 test_43() { #bug 15993
1783 VERSION_1_8=$(do_facet mds $LCTL get_param version | grep ^lustre.*1\.[78])
1784 if [ -z "$VERSION_1_8" ]; then
1785 skip "skipping test for non 1.8 MDS"
1790 check_mount || return 2
1791 testfile=$DIR/$tfile
1792 lma="this-should-be-removed-after-remount-and-accessed"
1794 echo "set/get trusted.lma"
1795 #define OBD_FAIL_MDS_ALLOW_COMMON_EA_SETTING 0x13f
1796 do_facet mds "lctl set_param fail_loc=0x13f"
1797 lctl set_param fail_loc=0x13f
1798 setfattr -n trusted.lma -v $lma $testfile || error "create common EA"
1799 do_facet mds "lctl set_param fail_loc=0"
1800 lctl set_param fail_loc=0
1801 ATTR=$(getfattr -n trusted.lma $testfile 2> /dev/null | grep trusted.lma)
1802 [ "$ATTR" = "trusted.lma=\"$lma\"" ] || error "check common EA"
1803 umount_client $MOUNT
1808 check_mount || return 3
1809 #define OBD_FAIL_MDS_REMOVE_COMMON_EA 0x13e
1810 do_facet mds "lctl set_param fail_loc=0x13e"
1812 do_facet mds "lctl set_param fail_loc=0"
1813 getfattr -d -m trusted $testfile 2> /dev/null | \
1814 grep "trusted.lma" && error "common EA not removed" || true
1818 run_test 43 "remove common EA if it exists"
1822 check_mount || return 2
1823 UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
1825 UUIDS=$(do_facet mds "$LCTL get_param $(get_mds_mdt_device_proc_path).${FSNAME}*.exports.*.uuid")
1826 for VAL in $UUIDS; do
1827 NID=$(echo $VAL | cut -d= -f1)
1828 CLUUID=$(echo $VAL | cut -d= -f2)
1829 [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
1831 [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
1835 run_test 44 "mounted client proc entry exists"
1839 check_mount || return 2
1844 #define OBD_FAIL_PTLRPC_LONG_UNLINK 0x50f
1845 do_facet client "lctl set_param fail_loc=0x50f"
1848 manual_umount_client --force || return 3
1849 do_facet client "lctl set_param fail_loc=0x0"
1851 mount_client $MOUNT || return 4
1855 run_test 45 "long unlink handling in ptlrpcd"
1862 umount_client $MOUNT2 || rc=$?
1863 umount_client $MOUNT || rc=$?
1864 while [ $count -gt 0 ]; do
1865 stop ost${count} -f || rc=$?
1869 cleanup_nocli || rc=$?
1870 #writeconf to remove all ost2 traces for subsequent tests
1876 echo "Testing with $OSTCOUNT OSTs"
1878 start_mds || return 1
1879 #first client should see only one ost
1880 start_ost || return 2
1881 wait_osc_import_state mds ost FULL
1883 mount_client $MOUNT || return 3
1884 trap "cleanup_46a $OSTCOUNT" EXIT ERR
1887 for (( i=2; i<=$OSTCOUNT; i++ )); do
1888 start ost$i `ostdevname $i` $OST_MOUNT_OPTS || return $((i+2))
1891 # wait until osts in sync
1892 for (( i=2; i<=$OSTCOUNT; i++ )); do
1893 wait_osc_import_state mds ost$i FULL
1896 #second client see all ost's
1898 mount_client $MOUNT2 || return 8
1899 $LFS setstripe $MOUNT2 -c -1 || return 9
1900 $LFS getstripe $MOUNT2 || return 10
1902 echo "ok" > $MOUNT2/widestripe
1903 $LFS getstripe $MOUNT2/widestripe || return 11
1904 # fill acl buffer for avoid expand lsm to them
1905 awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do
1906 setfacl -m $acl $MOUNT2/widestripe
1910 stat $MOUNT/widestripe || return 12
1912 cleanup_46a $OSTCOUNT || { echo "cleanup_46a failed!" && return 13; }
1915 run_test 46a "handle ost additional - wide striped file"
1920 check_mount || return 2
1921 $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
1925 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1926 lrs=$(echo $ns | sed 's/.*lru_size=//')
1927 lru_size[count]=$lrs
1933 client_up || return 3
1936 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1937 lrs=$(echo $ns | sed 's/.*lru_size=//')
1938 if ! test "$lrs" -eq "${lru_size[count]}"; then
1939 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
1940 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
1948 run_test 47 "server restart does not make client loss lru_resize settings"
1953 # reformat after this test is needed - if test will failed
1954 # we will have unkillable file at FS
1958 test_48() { # bug 17636
1961 check_mount || return 2
1963 $LFS setstripe $MOUNT -c -1 || return 9
1964 $LFS getstripe $MOUNT || return 10
1966 echo "ok" > $MOUNT/widestripe
1967 $LFS getstripe $MOUNT/widestripe || return 11
1969 trap cleanup_48 EXIT ERR
1971 # fill acl buffer for avoid expand lsm to them
1972 getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
1973 setfacl -m $acl $MOUNT/widestripe
1976 stat $MOUNT/widestripe || return 12
1981 run_test 48 "too many acls on file"
1983 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
1984 test_49() { # bug 17710
1985 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
1986 local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
1987 local LOCAL_TIMEOUT=20
1989 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
1993 check_mount || return 1
1995 echo "check ldlm_timout..."
1996 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1997 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1998 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
2000 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
2001 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2004 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
2005 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2008 umount_client $MOUNT
2009 stop_ost || return 2
2010 stop_mds || return 3
2012 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$((LOCAL_TIMEOUT - 1)) $MKFSOPT $OSTOPT"
2016 check_mount || return 7
2018 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
2019 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
2020 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
2022 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
2023 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2026 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
2027 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2030 cleanup || return $?
2032 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
2033 OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
2035 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
2038 # Test both statfs and lfs df and fail if either one fails
2039 multiop_bg_pause $1 f_
2042 killall -USR1 multiop
2043 [ $RC1 -ne 0 ] && log "lazystatfs multiop failed"
2044 wait $PID || { RC1=$?; log "multiop return error "; }
2051 if [ $RC2 -eq 0 ]; then
2053 log "lazystatfs df failed"
2057 [[ $RC1 -ne 0 || $RC2 -eq 0 ]] && RC=1
2063 lctl set_param llite.$FSNAME-*.lazystatfs=1
2066 lazystatfs $MOUNT || error "lazystatfs failed but no down servers"
2068 cleanup || return $?
2070 run_test 50a "lazystatfs all servers available =========================="
2074 lctl set_param llite.$FSNAME-*.lazystatfs=1
2077 # Wait for client to detect down OST
2078 stop_ost || error "Unable to stop OST1"
2079 wait_osc_import_state mds ost DISCONN
2081 lazystatfs $MOUNT || error "lazystatfs should don't have returned EIO"
2083 umount_client $MOUNT || error "Unable to unmount client"
2084 stop_mds || error "Unable to stop MDS"
2086 run_test 50b "lazystatfs all servers down =========================="
2089 start_mds || error "Unable to start MDS"
2090 start_ost || error "Unable to start OST1"
2091 start_ost2 || error "Unable to start OST2"
2092 mount_client $MOUNT || error "Unable to mount client"
2093 lctl set_param llite.$FSNAME-*.lazystatfs=1
2096 # Wait for client to detect down OST
2097 stop_ost || error "Unable to stop OST1"
2098 wait_osc_import_state mds ost DISCONN
2099 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2101 umount_client $MOUNT || error "Unable to unmount client"
2102 stop_ost2 || error "Unable to stop OST2"
2103 stop_mds || error "Unable to stop MDS"
2105 run_test 50c "lazystatfs one server down =========================="
2108 start_mds || error "Unable to start MDS"
2109 start_ost || error "Unable to start OST1"
2110 start_ost2 || error "Unable to start OST2"
2111 mount_client $MOUNT || error "Unable to mount client"
2112 lctl set_param llite.$FSNAME-*.lazystatfs=1
2115 # Issue the statfs during the window where the client still
2116 # belives the OST to be available but it is in fact down.
2117 # No failure just a statfs which hangs for a timeout interval.
2118 stop_ost || error "Unable to stop OST1"
2119 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2121 umount_client $MOUNT || error "Unable to unmount client"
2122 stop_ost2 || error "Unable to stop OST2"
2123 stop_mds || error "Unable to stop MDS"
2125 run_test 50d "lazystatfs client/server conn race =========================="
2132 start_mds || return 1
2133 #first client should see only one ost
2134 start_ost || return 2
2135 wait_osc_import_state mds ost FULL
2137 # Wait for client to detect down OST
2138 stop_ost || error "Unable to stop OST1"
2139 wait_osc_import_state mds ost DISCONN
2141 mount_client $MOUNT || error "Unable to mount client"
2142 lctl set_param llite.$FSNAME-*.lazystatfs=0
2144 multiop_bg_pause $MOUNT _f
2148 if [ $RC1 -ne 0 ]; then
2149 log "lazystatfs multiop failed $RC1"
2152 sleep $(( $TIMEOUT+1 ))
2154 [ $? -ne 0 ] && error "process isn't sleep"
2155 start_ost || error "Unable to start OST1"
2156 wait $pid || error "statfs failed"
2159 umount_client $MOUNT || error "Unable to unmount client"
2160 stop_ost || error "Unable to stop OST1"
2161 stop_mds || error "Unable to stop MDS"
2163 run_test 50e "normal statfs all servers down =========================="
2168 CONN_PROC="osc.$FSNAME-OST0001-osc.ost_server_uuid"
2170 start_mds || error "Unable to start mds"
2171 #first client should see only one ost
2172 start_ost || error "Unable to start OST1"
2173 wait_osc_import_state mds ost FULL
2175 start_ost2 || error "Unable to start OST2"
2176 wait_osc_import_state mds ost2 FULL
2178 # Wait for client to detect down OST
2179 stop_ost2 || error "Unable to stop OST2"
2180 wait_osc_import_state mds ost2 DISCONN
2182 mount_client $MOUNT || error "Unable to mount client"
2183 lctl set_param llite.$FSNAME-*.lazystatfs=0
2185 multiop_bg_pause $MOUNT _f
2189 if [ $RC1 -ne 0 ]; then
2190 log "lazystatfs multiop failed $RC1"
2193 sleep $(( $TIMEOUT+1 ))
2195 [ $? -ne 0 ] && error "process isn't sleep"
2196 start_ost2 || error "Unable to start OST2"
2197 wait $pid || error "statfs failed"
2198 stop_ost2 || error "Unable to stop OST2"
2201 umount_client $MOUNT || error "Unable to unmount client"
2202 stop_ost || error "Unable to stop OST1"
2203 stop_mds || error "Unable to stop MDS"
2204 #writeconf to remove all ost2 traces for subsequent tests
2207 run_test 50f "normal statfs one server in down =========================="
2210 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
2212 start_ost2 || error "Unable to start OST2"
2213 wait_osc_import_state mds ost2 FULL
2214 wait_osc_import_state client ost2 FULL
2216 local PARAM="${FSNAME}-OST0001.osc.active"
2218 $LFS setstripe -c -1 $DIR/$tfile || error "Unable to lfs setstripe"
2219 do_facet mgs $LCTL conf_param $PARAM=0 || error "Unable to deactivate OST"
2221 umount_client $MOUNT || error "Unable to unmount client"
2222 mount_client $MOUNT || error "Unable to mount client"
2223 # This df should not cause a panic
2226 do_facet mgs $LCTL conf_param $PARAM=1 || error "Unable to activate OST"
2228 umount_client $MOUNT || error "Unable to unmount client"
2229 stop_ost2 || error "Unable to stop OST2"
2230 stop_ost || error "Unable to stop OST1"
2231 stop_mds || error "Unable to stop MDS"
2232 #writeconf to remove all ost2 traces for subsequent tests
2235 run_test 50g "deactivated OST should not cause panic====================="
2239 local max_ost_index=$1
2240 echo -n $(($max_ost_index * 8 + 8))
2244 local saved_opts=$OST_MKFS_OPTS
2246 for i in 0 1023 2048
2248 OST_MKFS_OPTS="$saved_opts --index $i"
2252 cp /etc/passwd $DIR/1
2256 cp /etc/passwd $DIR/2
2259 echo checking size of lov_objid for ost index $i
2260 local file_size=`do_facet mds \
2261 "$DEBUGFS -R 'stat lov_objid' $MDSDEV 2>/dev/null" | \
2262 grep ^User | awk '{print $6}'`
2263 if [ "$file_size" != $(lov_objid_size $i) ]; then
2264 error "lov_objid size has to be $(lov_objid_size $i), \
2267 echo ok, lov_objid size is correct: $file_size
2272 OST_MKFS_OPTS=$saved_opts
2275 run_test 55 "check lov_objid size"
2278 add mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=16\"' --reformat $MDSDEV
2279 add ost1 $OST_MKFS_OPTS --index=1000 --reformat `ostdevname 1`
2280 add ost2 $OST_MKFS_OPTS --index=10000 --reformat `ostdevname 2`
2284 start_ost2 || error "Unable to start second ost"
2285 mount_client $MOUNT || error "Unable to mount client"
2286 [ -n "$ENABLE_QUOTA" ] && { $LFS quotacheck -ug $MOUNT || error "quotacheck has failed" ; }
2291 run_test 56 "check big indexes"
2293 test_57() { # bug 22656
2294 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
2296 do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
2299 start_ost && error "OST registration from failnode should fail"
2302 run_test 57 "initial registration from failnode should fail (should return errs)"
2304 test_58() { # bug 22658
2305 [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
2308 createmany -o $DIR/$tdir/$tfile-%d 100
2309 # make sure that OSTs do not cancel llog cookies before we unmount the MDS
2310 #define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
2311 do_facet mds "lctl set_param fail_loc=0x601"
2312 unlinkmany $DIR/$tdir/$tfile-%d 100
2314 local MNTDIR=$(facet_mntpt mds)
2315 # remove all files from the OBJECTS dir
2316 do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
2317 do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
2318 do_facet mds "umount $MNTDIR"
2319 # restart MDS with missing llog files
2321 do_facet mds "lctl set_param fail_loc=0"
2324 run_test 58 "missing llog files must not prevent MDT from mounting"
2327 do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
2331 start_mgsmds >> /dev/null
2332 local C1=$(count_osts)
2333 if [ $C1 -eq 0 ]; then
2334 start_ost >> /dev/null
2338 echo "original ost count: $C1 (expect > 0)"
2339 [ $C1 -gt 0 ] || error "No OSTs in $FSNAME log"
2340 start_mgsmds -o writeconf >> /dev/null || error "MDT start failed"
2341 local C2=$(count_osts)
2342 echo "after mdt writeconf count: $C2 (expect 0)"
2343 [ $C2 -gt 0 ] && error "MDT writeconf should erase OST logs"
2344 echo "OST start without writeconf should fail:"
2345 start_ost >> /dev/null && error "OST start without writeconf didn't fail"
2346 echo "OST start with writeconf should succeed:"
2347 start_ost -o writeconf >> /dev/null || error "OST1 start failed"
2348 local C3=$(count_osts)
2349 echo "after ost writeconf count: $C3 (expect 1)"
2350 [ $C3 -eq 1 ] || error "new OST writeconf should add:"
2351 start_ost2 -o writeconf >> /dev/null || error "OST2 start failed"
2352 local C4=$(count_osts)
2353 echo "after ost2 writeconf count: $C4 (expect 2)"
2354 [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
2355 stop_ost2 >> /dev/null
2356 cleanup_nocli >> /dev/null
2358 run_test 59 "writeconf mount option"
2360 if ! combined_mgs_mds ; then
2364 equals_msg `basename $0`: test complete
2365 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true