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 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
44 remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
47 [ "$SLOW" = "no" ] && EXCEPT_SLOW="30 31 45"
61 # who knows if/where $TUNEFS is installed? Better reformat if it fails...
62 do_facet ${facet} "$TUNEFS --quiet --writeconf $dev" ||
63 { echo "tunefs failed, reformatting instead" && reformat_and_config && return 1; }
70 # if writeconf fails anywhere, we reformat everything
71 writeconf1 mds $MDSDEV || return 0
72 writeconf1 ost1 `ostdevname 1` || return 0
73 writeconf1 ost2 `ostdevname 2` || return 0
77 # The MGS must be started before the OSTs for a new fs, so start
78 # and stop to generate the startup logs.
81 wait_osc_import_state mds ost FULL
86 reformat_and_config() {
88 if ! combined_mgs_mds ; then
96 start mgs $MGSDEV $MGS_MOUNT_OPTS
100 echo "start mds service on `facet_active_host mds`"
101 start mds $MDSDEV $MDS_MOUNT_OPTS $@ || return 94
105 echo "stop mgs service on `facet_active_host mgs`"
106 # These tests all use non-failover stop
107 stop mgs -f || return 97
111 if ! combined_mgs_mds ; then
118 echo "stop mds service on `facet_active_host mds`"
119 # These tests all use non-failover stop
120 stop mds -f || return 97
124 echo "start ost1 service on `facet_active_host ost1`"
125 start ost1 `ostdevname 1` $OST_MOUNT_OPTS $@ || return 95
129 echo "stop ost1 service on `facet_active_host ost1`"
130 # These tests all use non-failover stop
131 stop ost1 -f || return 98
135 echo "start ost2 service on `facet_active_host ost2`"
136 start ost2 `ostdevname 2` $OST_MOUNT_OPTS $@ || return 92
140 echo "stop ost2 service on `facet_active_host ost2`"
141 # These tests all use non-failover stop
142 stop ost2 -f || return 93
146 echo "start client on `facet_active_host client`"
147 start client || return 99
151 echo "stop client on `facet_active_host client`"
152 stop client || return 100
157 echo "mount $FSNAME on ${MOUNTPATH}....."
158 zconf_mount `hostname` $MOUNTPATH || return 96
162 local SAVEMOUNTOPT=$MOUNTOPT
163 MOUNTOPT="remount,$1"
165 echo "remount '$1' lustre on ${MOUNTPATH}....."
166 zconf_mount `hostname` $MOUNTPATH || return 96
167 MOUNTOPT=$SAVEMOUNTOPT
172 echo "umount lustre on ${MOUNTPATH}....."
173 zconf_umount `hostname` $MOUNTPATH || return 97
176 manual_umount_client(){
179 echo "manual umount lustre on ${MOUNT}...."
180 do_facet client "umount -d ${FORCE} $MOUNT"
186 start_mds || error "MDT start failed"
187 start_ost || error "OST start failed"
188 mount_client $MOUNT || error "client start failed"
193 if ! combined_mgs_mds ; then
203 stop_mds || return 201
204 stop_ost || return 202
205 unload_modules || return 203
209 umount_client $MOUNT || return 200
210 cleanup_nocli || return $?
214 do_facet client "cp /etc/passwd $DIR/a" || return 71
215 do_facet client "rm $DIR/a" || return 72
216 # make sure lustre is actually mounted (touch will block,
217 # but grep won't, so do it after)
218 do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
219 echo "setup single mount lustre success"
223 do_facet client "touch $DIR/a" || return 71
224 do_facet client "rm $DIR/a" || return 72
225 do_facet client "touch $DIR2/a" || return 73
226 do_facet client "rm $DIR2/a" || return 74
227 echo "setup double mount lustre success"
232 if [ "$ONLY" == "setup" ]; then
237 if [ "$ONLY" == "cleanup" ]; then
242 #create single point mountpoint
248 check_mount || return 41
251 run_test 0 "single mount setup"
255 echo "start ost second time..."
256 start_ost && error "2nd OST start should fail"
257 start_mds || error "MDT start failed"
258 mount_client $MOUNT || error "client start failed"
259 check_mount || return 42
262 run_test 1 "start up ost twice (should return errors)"
267 echo "start mds second time.."
268 start_mds && error "2nd MDT start should fail"
270 check_mount || return 43
273 run_test 2 "start up mds twice (should return err)"
277 #mount.lustre returns an error if already in mtab
278 mount_client $MOUNT && error "2nd client mount should fail"
279 check_mount || return 44
282 run_test 3 "mount client twice (should return err)"
286 touch $DIR/$tfile || return 85
290 # ok for ost to fail shutdown
291 if [ 202 -ne $eno ]; then
296 run_test 4 "force cleanup ost, then cleanup"
298 test_5a() { # was test_5
300 touch $DIR/$tfile || return 1
301 fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
303 stop_mds -f || return 2
305 # cleanup may return an error from the failed
306 # disconnects; for now I'll consider this successful
307 # if all the modules have unloaded.
311 echo "killing umount"
312 kill -TERM $UMOUNT_PID
313 echo "waiting for umount to finish"
315 if grep " $MOUNT " /proc/mounts; then
316 echo "test 5: /proc/mounts after failed umount"
320 echo "killing umount"
321 kill -TERM $UMOUNT_PID
322 echo "waiting for umount to finish"
324 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
328 # stop_mds is a no-op here, and should not fail
329 cleanup_nocli || return $?
330 # df may have lingering entry
332 # mtab may have lingering entry
336 while [ "$WAIT" -ne "$MAX_WAIT" ]; do
338 grep -q $MOUNT" " /etc/mtab || break
339 echo "Waiting /etc/mtab updated ... "
340 WAIT=$(( WAIT + sleep))
342 [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
343 echo "/etc/mtab updated in $WAIT secs"
345 run_test 5a "force cleanup mds, then cleanup"
353 grep " $MOUNT " /etc/mtab && \
354 error false "unexpected entry in mtab before mount" && return 10
358 if ! combined_mgs_mds ; then
359 trap cleanup_5b EXIT ERR
364 [ -d $MOUNT ] || mkdir -p $MOUNT
365 mount_client $MOUNT && rc=1
366 grep " $MOUNT " /etc/mtab && \
367 error "$MOUNT entry in mtab after failed mount" && rc=11
369 # stop_mds is a no-op here, and should not fail
370 cleanup_nocli || rc=$?
371 if ! combined_mgs_mds ; then
376 run_test 5b "Try to start a client with no MGS (should return errs)"
379 grep " $MOUNT " /etc/mtab && \
380 error false "unexpected entry in mtab before mount" && return 10
385 [ -d $MOUNT ] || mkdir -p $MOUNT
386 local oldfs="${FSNAME}"
387 FSNAME="wrong.${FSNAME}"
388 mount_client $MOUNT || :
390 grep " $MOUNT " /etc/mtab && \
391 error "$MOUNT entry in mtab after failed mount" && rc=11
393 cleanup_nocli || rc=$?
396 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
399 grep " $MOUNT " /etc/mtab && \
400 error false "unexpected entry in mtab before mount" && return 10
406 mount_client $MOUNT || rc=1
408 grep " $MOUNT " /etc/mtab && \
409 error "$MOUNT entry in mtab after unmount" && rc=11
412 run_test 5d "mount with ost down"
415 grep " $MOUNT " /etc/mtab && \
416 error false "unexpected entry in mtab before mount" && return 10
422 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
423 do_facet client "lctl set_param fail_loc=0x80000506"
424 mount_client $MOUNT || echo "mount failed (not fatal)"
426 grep " $MOUNT " /etc/mtab && \
427 error "$MOUNT entry in mtab after unmount" && rc=11
430 run_test 5e "delayed connect, don't crash (bug 10268)"
433 if combined_mgs_mds ; then
434 skip "combined mgs and mds"
438 grep " $MOUNT " /etc/mtab && \
439 error false "unexpected entry in mtab before mount" && return 10
443 [ -d $MOUNT ] || mkdir -p $MOUNT
444 mount_client $MOUNT &
446 echo client_mount pid is $pid
450 if ! ps -f -p $pid >/dev/null; then
453 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
454 error "mount returns $rc, expected to hang"
463 # mount should succeed after start mds
466 [ $rc -eq 0 ] || error "mount returned $rc"
467 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
471 run_test 5f "mds down, cleanup after failed mount (bug 2712)"
476 mount_client ${MOUNT} || return 87
477 touch $DIR/a || return 86
480 run_test 6 "manual umount, then mount again"
485 cleanup_nocli || return $?
487 run_test 7 "manual umount, then cleanup"
492 check_mount2 || return 45
493 umount_client $MOUNT2
496 run_test 8 "double mount setup"
501 do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
502 do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
504 CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
505 # interop 1.8 <-> 2.0: "trace inode warning error emerg console"
506 local lustre_version=$(get_lustre_version ost1)
507 echo ost1 running $lustre_version
508 if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ]; then
509 echo "lnet.debug success"
510 elif [[ $lustre_version != 1.8* ]] && \
511 [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ]; then
512 echo "lnet.debug success"
514 echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
517 CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
518 if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
519 echo "lnet.subsystem_debug success"
521 echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
524 stop_ost || return $?
526 run_test 9 "test ptldebug and subsystem for mkfs"
534 do_facet $facet "test -b $dev" || rc=1
535 if [[ "$size" ]]; then
536 local in=$(do_facet $facet "dd if=$dev of=/dev/null bs=1k count=1 skip=$size 2>&1" |\
537 awk '($3 == "in") { print $1 }')
538 [[ $in = "1+0" ]] || rc=1
545 # Skip this test if MDS is 2.0+, see bug 22944.
546 if [[ "$(get_mds_version_major)" != "1" ]]; then
547 skip "not running on 2.0 server"
552 check_mount || return 41
555 local TMPMTPT="${TMP}/conf16"
556 local files="{OBJECTS,PENDING,LOGS}"
558 is_blkdev mds $MDSDEV || LOOPOPT="-o loop"
560 log "change the mode of $MDSDEV/$files to 555"
561 do_facet mds "mkdir -p $TMPMTPT &&
562 mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
563 chmod 555 $TMPMTPT/$files &&
564 umount $TMPMTPT" || return $?
566 log "mount Lustre to change the mode of $files, then umount Lustre"
568 check_mount || return 41
571 log "read the mode of $files and check if they has been changed properly"
573 for file in ${files//[\{\},]/ }; do
574 expected=`do_facet mds "$DEBUGFS -R 'stat $file' $MDSDEV 2> /dev/null" | \
575 grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
577 if [ "$expected" = "0777" ]; then
578 log "Success:Lustre change the mode of $file correctly"
580 error "Lustre does not change mode of $file properly"
584 run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING"
588 check_mount || return 41
591 echo "Remove mds config log"
592 if ! combined_mgs_mds ; then
596 do_facet mgs "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MGSDEV || return \$?" || return $?
598 if ! combined_mgs_mds ; then
603 start_mds && return 42
606 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
609 [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return
614 # check if current MDSSIZE is large enough
615 [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
616 log "use MDSSIZE=$MDSSIZE"
618 # check if the global config has a large enough MDSSIZE
619 [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
620 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
621 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
623 # check if the block device is large enough
624 [ -z "$OK" ] && $(is_blkdev mds $MDSDEV $MIN) && OK=1 &&
625 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
627 # check if a loopback device has enough space for fs metadata (5%)
629 if [ -z "$OK" ]; then
630 local SPACE=$(do_facet mds "[ -f $MDSDEV -o ! -e $MDSDEV ] && df -P \\\$(dirname $MDSDEV)" |
631 awk '($1 != "Filesystem") {print $4}')
632 ! [ -z "$SPACE" ] && [ $SPACE -gt $((MIN / 20)) ] && \
633 OK=1 && myMDSSIZE=$MIN && \
634 log "use file $MDSDEV with MIN=$MIN"
637 [ -z "$OK" ] && skip_env "$MDSDEV too small for ${MIN}kB MDS" && return
640 echo "mount mds with large journal..."
641 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
643 local opts="--mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
645 if combined_mgs_mds ; then
646 MDS_MKFS_OPTS="--mgs $opts"
648 MDS_MKFS_OPTS="--mgsnode=$MGSNID $opts"
652 echo "mount lustre system..."
654 check_mount || return 41
656 echo "check journal size..."
657 local FOUNDSIZE=$(do_facet mds "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}')
658 if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
659 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
661 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
666 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
669 run_test 18 "check mkfs creates large journals"
672 start_mds || return 1
673 stop_mds -f || return 2
675 run_test 19a "start/stop MDS without OSTs"
678 start_ost || return 1
679 stop_ost -f || return 2
681 run_test 19b "start/stop OSTs without MDS"
684 # first format the ost/mdt
688 check_mount || return 43
690 remount_client ro $MOUNT || return 44
691 touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
692 [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
693 remount_client rw $MOUNT || return 47
695 [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
696 MCNT=`grep -c $MOUNT /etc/mtab`
697 [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
702 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
707 wait_osc_import_state mds ost FULL
711 run_test 21a "start mds before ost, stop ost first"
716 wait_osc_import_state mds ost FULL
720 run_test 21b "start ost before mds, stop mds first"
726 wait_osc_import_state mds ost2 FULL
731 #writeconf to remove all ost2 traces for subsequent tests
734 run_test 21c "start mds between two osts, stop mds last"
737 if combined_mgs_mds ; then
738 skip "need separate mgs device" && return 0
748 wait_osc_import_state mds ost2 FULL
755 run_test 21d "start mgs then ost and then mds"
761 echo Client mount with ost in logs, but none running
763 wait_osc_import_state mds ost FULL
766 # check_mount will block trying to contact ost
767 mcreate $DIR/$tfile || return 40
768 rm -f $DIR/$tfile || return 42
772 echo Client mount with a running ost
775 check_mount || return 41
780 run_test 22 "start a client before osts (should return errs)"
782 test_23a() { # was test_23
786 # force down client so that recovering mds waits for reconnect
787 local running=$(grep -c $MOUNT /proc/mounts) || true
788 if [ $running -ne 0 ]; then
789 echo "Stopping client $MOUNT (opts: -f)"
793 # enter recovery on mds
795 # try to start a new client
796 mount_client $MOUNT &
798 MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
799 MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
800 echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
802 ps --ppid $MOUNT_LUSTRE_PID
803 # FIXME why o why can't I kill these? Manual "ctrl-c" works...
804 kill -TERM $MOUNT_LUSTRE_PID
805 echo "waiting for mount to finish"
807 # we can not wait $MOUNT_PID because it is not a child of this shell
813 while [ "$WAIT" -lt "$MAX_WAIT" ]; do
815 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
816 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
819 [ -z "$PID1" -a -z "$PID2" ] && break
820 echo "waiting for mount to finish ... "
821 WAIT=$(( WAIT + sleep))
823 if [ "$WAIT" -eq "$MAX_WAIT" ]; then
824 error "MOUNT_PID $MOUNT_PID and \
825 MOUNT__LUSTRE_PID $MOUNT__LUSTRE_PID still not killed in $WAIT secs"
831 run_test 23a "interrupt client during recovery mount delay"
836 test_23b() { # was test_23
839 # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
840 lctl set_param fail_loc=0x80000313
844 run_test 23b "Simulate -EINTR during mount"
846 fs2mds_HOST=$mds_HOST
847 fs2ost_HOST=$ost_HOST
851 echo "umount $MOUNT2 ..."
852 umount $MOUNT2 || true
853 echo "stopping fs2mds ..."
854 stop fs2mds -f || true
855 echo "stopping fs2ost ..."
856 stop fs2ost -f || true
860 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
861 is_blkdev mds $MDSDEV && \
862 skip_env "mixed loopback and real device not working" && return
865 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
867 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
868 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
870 # test 8-char fsname as well
871 local FSNAME2=test1234
872 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
874 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
877 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
878 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
880 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
882 check_mount || return 2
883 # files written on 1 should not show up on 2
884 cp /etc/passwd $DIR/$tfile
886 [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
888 cp /etc/passwd $MOUNT2/b || return 3
889 rm $MOUNT2/b || return 4
890 # 2 is actually mounted
891 grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
893 facet_failover fs2mds
894 facet_failover fs2ost
897 # the MDS must remain up until last MDT
900 local mdt_obdname=$(do_facet mds "lctl get_param -n devices" | \
901 awk '/ mdt / { print $4 }' | head -1)
902 [ -z "$mdt_obdname" ] && error "No MDT" && return 8
905 cleanup_nocli || return 6
907 run_test 24a "Multiple MDTs on a single node"
910 if [ -z "$fs2mds_DEV" ]; then
911 is_blkdev mds $MDSDEV && \
912 skip_env "mixed loopback and real device not working" && return
915 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
917 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10
919 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
922 run_test 24b "Multiple MGSs on a single node (should return err)"
926 check_mount || return 2
927 local MODULES=$($LCTL modules | awk '{ print $2 }')
928 rmmod $MODULES 2>/dev/null || true
931 run_test 25 "Verify modules are referenced"
935 # we need modules before mount for sysctl, so make sure...
936 do_facet mds "lsmod | grep -q lustre || modprobe lustre"
937 #define OBD_FAIL_MDS_FS_SETUP 0x135
938 do_facet mds "lctl set_param fail_loc=0x80000135"
939 start_mds && echo MDS started && return 1
940 lctl get_param -n devices
941 DEVS=$(lctl get_param -n devices | wc -l)
942 [ $DEVS -gt 0 ] && return 2
943 unload_modules || return 203
945 run_test 26 "MDT startup failure cleans LOV (should return errs)"
951 local ORIG=$(do_facet $myfacet "$TEST")
952 if [ $# -gt 3 ]; then
958 echo "Setting $PARAM from $ORIG to $FINAL"
959 do_facet mds "$LCTL conf_param $PARAM=$FINAL" || error conf_param failed
961 wait_update $(facet_host $myfacet) "$TEST" $FINAL || error check failed!
965 start_ost || return 1
966 start_mds || return 2
967 echo "Requeue thread should have started: "
968 ps -e | grep ll_cfg_requeue
969 set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
972 run_test 27a "Reacquire MGS lock if OST started first"
977 # interop 1.8 <-> 2.0:
978 # 1.8: group_acquire_expire, 2.0: identity_acquire_expire
979 local acquire_expire=$(do_facet mds lctl get_param md*.$FSNAME-MDT0000.*acquire_expire | \
980 cut -d= -f1 | cut -d. -f3)
982 set_and_check mds "lctl get_param -n md*.$FSNAME-MDT0000.$acquire_expire" \
983 "$FSNAME-MDT0000.mdt.$acquire_expire" || return 3
984 set_and_check client "lctl get_param -n mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight" \
985 "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4
989 run_test 27b "Reacquire MGS lock after failover"
993 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
994 PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
997 set_and_check client "$TEST" "$PARAM" $FINAL || return 3
998 FINAL=$(($FINAL + 1))
999 set_and_check client "$TEST" "$PARAM" $FINAL || return 4
1000 umount_client $MOUNT || return 200
1003 if [ $RESULT -ne $FINAL ]; then
1004 echo "New config not seen: wanted $FINAL got $RESULT"
1007 echo "New config success: got $RESULT"
1009 set_and_check client "$TEST" "$PARAM" $ORIG || return 5
1012 run_test 28 "permanent parameter setting"
1015 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
1016 setup > /dev/null 2>&1
1020 local PARAM="$FSNAME-OST0001.osc.active"
1021 local PROC_ACT="osc.$FSNAME-OST0001-osc-*.active"
1022 local PROC_UUID="osc.$FSNAME-OST0001-osc-*.ost_server_uuid"
1024 ACTV=$(lctl get_param -n $PROC_ACT)
1026 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
1027 # also check ost_server_uuid status
1028 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
1029 if [ -z "$RESULT" ]; then
1030 echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
1033 echo "Live client success: got $RESULT"
1037 local MPROC="osc.$(get_mdtosc_proc_path $FSNAME-OST0001).active"
1042 RESULT=`do_facet mds " lctl get_param -n $MPROC"`
1043 [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
1044 if [ $RESULT -eq $DEAC ]; then
1045 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
1049 if [ $WAIT -eq $MAX ]; then
1050 echo "MDT not deactivated: wanted $DEAC got $RESULT"
1053 echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
1056 # test new client starts deactivated
1057 umount_client $MOUNT || return 200
1059 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
1060 if [ -z "$RESULT" ]; then
1061 echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
1064 echo "New client success: got $RESULT"
1067 # make sure it reactivates
1068 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
1070 umount_client $MOUNT
1073 #writeconf to remove all ost2 traces for subsequent tests
1076 run_test 29 "permanently remove an OST"
1081 echo Big config llog
1082 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1084 LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
1085 for i in ${LIST[@]}; do
1086 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
1088 # make sure client restart still works
1089 umount_client $MOUNT
1090 mount_client $MOUNT || return 4
1091 [ "$($TEST)" -ne "$i" ] && error "Param didn't stick across restart $($TEST) != $i"
1094 echo Erase parameter setting
1095 do_facet mgs "$LCTL conf_param -d $FSNAME.llite.max_read_ahead_whole_mb" || return 6
1096 umount_client $MOUNT
1097 mount_client $MOUNT || return 6
1099 echo "deleted (default) value=$FINAL, orig=$ORIG"
1100 # assumes this parameter started at the default value
1101 [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
1105 run_test 30a "Big config llog and conf_param deletion"
1110 # Make a fake nid. Use the OST nid, and add 20 to the least significant
1111 # numerical part of it. Hopefully that's not already a failover address for
1113 OSTNID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
1114 ORIGVAL=$(echo $OSTNID | egrep -oi "[0-9]*@")
1115 NEWVAL=$((($(echo $ORIGVAL | egrep -oi "[0-9]*") + 20) % 256))
1116 NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
1117 echo "Using fake nid $NEW"
1119 TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
1120 set_and_check client "$TEST" "$FSNAME-OST0000.failover.node" $NEW || error "didn't add failover nid $NEW"
1121 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1123 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1124 echo "should have 2 failover nids: $NIDCOUNT"
1125 [ $NIDCOUNT -eq 2 ] || error "Failover nid not added"
1126 do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed"
1127 umount_client $MOUNT
1128 mount_client $MOUNT || return 3
1130 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1132 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1133 echo "only 1 final nid should remain: $NIDCOUNT"
1134 [ $NIDCOUNT -eq 1 ] || error "Failover nids not removed"
1138 run_test 30b "Remove failover nids"
1140 test_31() { # bug 10734
1141 # ipaddr must not exist
1142 mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
1145 run_test 31 "Connect to non-existent node (returns errors, should not crash)"
1147 # Use these start32/stop32 fn instead of t-f start/stop fn,
1148 # for local devices, to skip global facet vars init
1152 echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
1153 umount -d $@ ${MOUNT%/*}/${facet}
1162 mkdir -p ${MOUNT%/*}/${facet}
1164 echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
1165 mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
1167 if [ $RC -ne 0 ]; then
1168 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
1169 echo "Start of ${device} of local ${facet} failed ${RC}"
1175 cleanup_nocli32 () {
1183 echo "Cleanup test_32 umount $MOUNT ..."
1184 umount -f $MOUNT || true
1185 echo "Cleanup local mds ost1 ..."
1191 # this test is totally useless on a client-only system
1192 client_only && skip "client only testing" && return 0
1193 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1194 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
1196 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1197 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1199 local tmpdir=$TMP/conf32a
1202 tar xjvf $DISK1_6 -C $tmpdir ||
1203 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1205 lctl set_param debug=$PTLDEBUG
1207 $TUNEFS $tmpdir/mds || error "tunefs failed"
1209 # nids are wrong, so client wont work, but server should start
1210 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1211 trap cleanup_32 EXIT INT || return 3
1213 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1215 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1217 $TUNEFS --mgsnode=`hostname` $tmpdir/ost1 || error "tunefs failed"
1218 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1219 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1221 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1223 local NID=$($LCTL list_nids | head -1)
1225 echo "OSC changes should succeed:"
1226 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1227 $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1229 echo "MDC changes should succeed:"
1230 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1231 $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1236 # mount a second time to make sure we didnt leave upgrade flag on
1238 $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1239 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1240 trap cleanup_32 EXIT INT || return 12
1244 rm -rf $tmpdir || true # true is only for TMP on NFS
1246 run_test 32a "Upgrade from 1.6 (not live)"
1249 # this test is totally useless on a client-only system
1250 client_only && skip "client only testing" && return 0
1251 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1252 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return
1254 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1255 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1257 local tmpdir=$TMP/conf32b
1260 tar xjvf $DISK1_6 -C $tmpdir ||
1261 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1264 lctl set_param debug=$PTLDEBUG
1266 # Ugrade process in according to comment 2 bug 20246
1267 # writeconf will cause servers to register with their current nids
1268 $TUNEFS --mdt --writeconf --erase-param \
1269 --param="mdt.group_upcall=/usr/sbin/l_getgroups" $tmpdir/mds || \
1270 error "tunefs mds failed"
1272 start32 mds $tmpdir/mds "-o loop,abort_recov" && \
1273 trap cleanup_32 EXIT INT || return 3
1276 start32 mds "-o loop" $tmpdir/mds || return 4
1277 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1279 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1281 $TUNEFS --ost --writeconf --erase-param --mgsnode=`hostname`@$NETTYPE $tmpdir/ost1 || \
1282 error "tunefs ost failed"
1283 start32 ost1 $tmpdir/ost1 "-o loop,abort_recov" || return 5
1285 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1287 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1289 local NID=$($LCTL list_nids | head -1)
1291 echo "OSC changes should succeed:"
1292 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || error "OSC conf_param failed"
1293 $LCTL conf_param lustre-OST0000.failover.node=$NID || error "add failover nid=$NID failed"
1295 echo "MDC changes should succeed:"
1296 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1299 # MDT and OST should have registered with new nids, so we should have
1300 # a fully-functioning client
1301 echo "Check client and old fs contents"
1303 local device=`h2$NETTYPE $HOSTNAME`:/lustre
1304 echo "Starting local client: $HOSTNAME: $device $MOUNT"
1305 mount -t lustre $device $MOUNT || return 1
1307 local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
1308 local new=$((old + 5))
1309 lctl conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=$new
1310 wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1312 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2940530074 2837" ] || return 12
1317 rm -rf $tmpdir || true # true is only for TMP on NFS
1319 run_test 32b "Upgrade from 1.6 with writeconf"
1321 test_33a() { # bug 12333, was test_33
1323 local FSNAME2=test-123
1324 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1326 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1327 is_blkdev mds $MDSDEV && \
1328 skip_env "mixed loopback and real device not working" && return
1331 # interop 1.8 <-> 2.0
1333 local major=$(get_mds_version_major)
1334 local minor=$(get_mds_version_minor)
1335 if [ $major -le 1 -a $minor -le 8 ]; then
1338 mkfs_opts="--mkfsoptions='-J size=8'" # bug 17931
1341 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1342 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1343 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} $mkfs_opts --reformat $fs2mdsdev || exit 10
1344 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1346 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1347 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1348 do_facet mds "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1350 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1351 cp /etc/hosts $MOUNT2/. || rc=3
1354 cp /etc/hosts $MOUNT2/ || rc=3
1355 $LFS getstripe $MOUNT2/hosts
1360 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1361 cleanup_nocli || rc=6
1364 run_test 33a "Mount ost with a large index number"
1366 test_33b() { # was test_33a
1369 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1370 # Drop lock cancelation reply during umount
1371 #define OBD_FAIL_LDLM_CANCEL 0x304
1372 do_facet client lctl set_param fail_loc=0x80000304
1373 #lctl set_param debug=-1
1374 umount_client $MOUNT
1377 run_test 33b "Drop cancel during umount"
1381 do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1382 manual_umount_client
1384 do_facet client killall -USR1 multiop
1385 if [ $rc -eq 0 ]; then
1386 error "umount not fail!"
1391 run_test 34a "umount with opened file should be fail"
1396 touch $DIR/$tfile || return 1
1397 stop_mds --force || return 2
1399 manual_umount_client --force
1401 if [ $rc -ne 0 ]; then
1402 error "mtab after failed umount - rc $rc"
1408 run_test 34b "force umount with failed mds should be normal"
1412 touch $DIR/$tfile || return 1
1413 stop_ost --force || return 2
1415 manual_umount_client --force
1417 if [ $rc -ne 0 ]; then
1418 error "mtab after failed umount - rc $rc"
1424 run_test 34c "force umount with failed ost should be normal"
1426 test_35a() { # bug 12459
1430 lctl set_param debug="ha"
1432 log "Set up a fake failnode for the MDS"
1434 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || return 4
1436 log "Wait for RECONNECT_INTERVAL seconds (10s)"
1439 MSG="conf-sanity.sh test_35a `date +%F%kh%Mm%Ss`"
1442 log "Stopping the MDT:"
1443 stop_mds || return 5
1445 df $MOUNT > /dev/null 2>&1 &
1447 log "Restarting the MDT:"
1448 start_mds || return 6
1449 log "Wait for df ($DFPID) ... "
1454 # retrieve from the log the first server that the client tried to
1455 # contact after the connection loss
1456 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1457 NEXTCONN=`awk "/${MSG}/ {start = 1;}
1458 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1460 if (\\\$NF ~ /$FAKENID/)
1466 }" $TMP/lustre-log-$TESTNAME.log`
1467 [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1469 # remove nid settings
1472 run_test 35a "Reconnect to the last active server first"
1474 test_35b() { # bug 18674
1475 remote_mds || { skip "local MDS" && return 0; }
1479 $LCTL set_param debug="ha"
1481 MSG="conf-sanity.sh test_35b `date +%F%kh%Mm%Ss`"
1484 log "Set up a fake failnode for the MDS"
1486 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || \
1489 local at_max_saved=0
1490 # adaptive timeouts may prevent seeing the issue
1491 if at_is_enabled; then
1492 at_max_saved=$(at_max_get mds)
1493 at_max_set 0 mds client
1496 mkdir -p $MOUNT/$tdir
1498 log "Injecting EBUSY on MDS"
1499 # Setting OBD_FAIL_MDS_RESEND=0x136
1500 do_facet mds "$LCTL set_param fail_loc=0x80000136" || return 2
1502 $LCTL set_param mdc.${FSNAME}*.stats=clear
1504 log "Creating a test file and stat it"
1505 touch $MOUNT/$tdir/$tfile
1506 stat $MOUNT/$tdir/$tfile
1508 log "Stop injecting EBUSY on MDS"
1509 do_facet mds "$LCTL set_param fail_loc=0" || return 3
1510 rm -f $MOUNT/$tdir/$tfile
1513 # restore adaptive timeout
1514 [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds client
1516 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1518 CONNCNT=`$LCTL get_param mdc.${FSNAME}*.stats | awk '/mds_connect/{print $2}'`
1520 # retrieve from the log if the client has ever tried to
1521 # contact the fake server after the loss of connection
1522 FAILCONN=`awk "BEGIN {ret = 0;}
1523 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1525 if (\\\$NF ~ /$FAKENID/) {
1530 END {print ret}" $TMP/lustre-log-$TESTNAME.log`
1532 [ "$FAILCONN" == "0" ] && \
1533 log "ERROR: The client reconnection has not been triggered" && \
1535 [ "$FAILCONN" == "2" ] && \
1536 log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
1539 # When OBD_FAIL_MDS_RESEND is hit, we sleep for 2 * obd_timeout
1540 # Reconnects are supposed to be rate limited to one every 5s
1541 [ $CONNCNT -gt $((2 * $TIMEOUT / 5 + 1)) ] && \
1542 log "ERROR: Too many reconnects $CONNCNT" && \
1546 # remove nid settings
1549 run_test 35b "Continue reconnection retries, if the active server is busy"
1552 [ $OSTCOUNT -lt 2 ] && skip_env "skipping test for single OST" && return
1554 [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1555 { skip "remote OST" && return 0; }
1558 local FSNAME2=test1234
1559 local fs3ost_HOST=$ost_HOST
1561 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1563 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1564 is_blkdev mds $MDSDEV && \
1565 skip_env "mixed loopback and real device not working" && return
1568 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1569 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1570 local fs3ostdev=${fs3ost_DEV:-$(ostdevname 2)_2}
1571 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1572 # XXX after we support non 4K disk blocksize, change following --mkfsoptions with
1574 add fs2ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1575 add fs3ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs3ostdev || exit 10
1577 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1578 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1579 start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1581 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1583 sleep 5 # until 11778 fixed
1585 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1587 BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1588 BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1589 BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1590 STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1591 DFTOTAL=`echo $STRING | cut -d, -f1`
1592 DFUSED=`echo $STRING | cut -d, -f2`
1593 DFAVAIL=`echo $STRING | cut -d, -f3`
1594 DFFREE=$(($DFTOTAL - $DFUSED))
1596 ALLOWANCE=$((64 * $OSTCOUNT))
1598 if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||
1599 [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1600 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1603 if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] ||
1604 [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1605 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1608 if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] ||
1609 [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1610 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1615 stop fs3ost -f || return 200
1616 stop fs2ost -f || return 201
1617 stop fs2mds -f || return 202
1618 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev $fs3ostdev
1619 unload_modules || return 203
1622 run_test 36 "df report consistency on OSTs with different block size"
1625 client_only && skip "client only testing" && return 0
1626 LOCAL_MDSDEV="$TMP/mdt.img"
1627 SYM_MDSDEV="$TMP/sym_mdt.img"
1629 echo "MDS : $LOCAL_MDSDEV"
1630 echo "SYMLINK : $SYM_MDSDEV"
1634 mkfs.lustre --reformat --fsname=lustre --mdt --mgs --device-size=9000 $LOCAL_MDSDEV ||
1635 error "mkfs.lustre $LOCAL_MDSDEV failed"
1636 ln -s $LOCAL_MDSDEV $SYM_MDSDEV
1638 echo "mount symlink device - $SYM_MDSDEV"
1640 mount_op=`mount -v -t lustre -o loop $SYM_MDSDEV ${MOUNT%/*}/mds 2>&1 | grep "unable to set tunable"`
1641 umount -d ${MOUNT%/*}/mds
1642 rm -f $LOCAL_MDSDEV $SYM_MDSDEV
1644 if [ -n "$mount_op" ]; then
1645 error "**** FAIL: set tunables failed for symlink device"
1649 run_test 37 "verify set tunables works for symlink device"
1651 test_38() { # bug 14222
1656 FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1657 log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1659 tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1660 error "copying $SRC to $DIR/$tdir"
1662 umount_client $MOUNT
1664 log "rename lov_objid file on MDS"
1665 rm -f $TMP/lov_objid.orig
1666 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1667 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1669 do_facet mds "od -Ax -td8 $TMP/lov_objid.orig"
1670 # check create in mds_lov_connect
1674 [ $V ] && log "verifying $DIR/$tdir/$f"
1675 diff -q $f $DIR/$tdir/$f || ERROR=y
1677 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
1678 do_facet mds "od -Ax -td8 $TMP/lov_objid.new"
1679 [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1682 # check it's updates in sync
1683 umount_client $MOUNT
1686 do_facet mds dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1687 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1688 do_facet mds "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1693 [ $V ] && log "verifying $DIR/$tdir/$f"
1694 diff -q $f $DIR/$tdir/$f || ERROR=y
1696 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1697 do_facet mds "od -Ax -td8 $TMP/lov_objid.new1"
1698 umount_client $MOUNT
1700 [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1702 log "files compared the same"
1705 run_test 38 "MDS recreates missing lov_objid file from OST data"
1707 test_39() { #bug 14413
1711 perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' &&
1712 error "memory leak detected" || true
1714 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1716 test_40() { # bug 15759
1718 #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706
1719 do_facet mds "lctl set_param fail_loc=0x80000706"
1723 run_test 40 "race during service thread startup"
1725 test_41() { #bug 14134
1727 start mds $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1728 start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1729 start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1731 mount_client $MOUNT || return 1
1734 echo "blah blah" > $MOUNT/$tfile
1737 umount_client $MOUNT
1738 stop ost1 -f || return 201
1739 stop mds -f || return 202
1740 stop mds -f || return 203
1741 unload_modules || return 204
1744 run_test 41 "mount mds with --nosvc and --nomgs"
1746 test_42() { #bug 14693
1748 check_mount || return 2
1749 do_facet client lctl conf_param lustre.llite.some_wrong_param=10
1750 umount_client $MOUNT
1751 mount_client $MOUNT || return 1
1755 run_test 42 "invalid config param should not prevent client from mounting"
1757 test_43() { #bug 15993
1759 VERSION_1_8=$(do_facet mds $LCTL get_param version | grep ^lustre.*1\.[78])
1760 if [ -z "$VERSION_1_8" ]; then
1761 skip "skipping test for non 1.8 MDS"
1766 check_mount || return 2
1767 testfile=$DIR/$tfile
1768 lma="this-should-be-removed-after-remount-and-accessed"
1770 echo "set/get trusted.lma"
1771 #define OBD_FAIL_MDS_ALLOW_COMMON_EA_SETTING 0x13f
1772 do_facet mds "lctl set_param fail_loc=0x13f"
1773 lctl set_param fail_loc=0x13f
1774 setfattr -n trusted.lma -v $lma $testfile || error "create common EA"
1775 do_facet mds "lctl set_param fail_loc=0"
1776 lctl set_param fail_loc=0
1777 ATTR=$(getfattr -n trusted.lma $testfile 2> /dev/null | grep trusted.lma)
1778 [ "$ATTR" = "trusted.lma=\"$lma\"" ] || error "check common EA"
1779 umount_client $MOUNT
1784 check_mount || return 3
1785 #define OBD_FAIL_MDS_REMOVE_COMMON_EA 0x13e
1786 do_facet mds "lctl set_param fail_loc=0x13e"
1788 do_facet mds "lctl set_param fail_loc=0"
1789 getfattr -d -m trusted $testfile 2> /dev/null | \
1790 grep "trusted.lma" && error "common EA not removed" || true
1794 run_test 43 "remove common EA if it exists"
1798 check_mount || return 2
1799 UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
1801 UUIDS=$(do_facet mds "$LCTL get_param $(get_mds_mdt_device_proc_path).${FSNAME}*.exports.*.uuid")
1802 for VAL in $UUIDS; do
1803 NID=$(echo $VAL | cut -d= -f1)
1804 CLUUID=$(echo $VAL | cut -d= -f2)
1805 [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
1807 [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
1811 run_test 44 "mounted client proc entry exists"
1815 check_mount || return 2
1820 #define OBD_FAIL_PTLRPC_LONG_UNLINK 0x50f
1821 do_facet client "lctl set_param fail_loc=0x50f"
1824 manual_umount_client --force || return 3
1825 do_facet client "lctl set_param fail_loc=0x0"
1827 mount_client $MOUNT || return 4
1831 run_test 45 "long unlink handling in ptlrpcd"
1838 umount_client $MOUNT2 || rc=$?
1839 umount_client $MOUNT || rc=$?
1840 while [ $count -gt 0 ]; do
1841 stop ost${count} -f || rc=$?
1845 cleanup_nocli || rc=$?
1846 #writeconf to remove all ost2 traces for subsequent tests
1852 echo "Testing with $OSTCOUNT OSTs"
1854 start_mds || return 1
1855 #first client should see only one ost
1856 start_ost || return 2
1857 wait_osc_import_state mds ost FULL
1859 mount_client $MOUNT || return 3
1860 trap "cleanup_46a $OSTCOUNT" EXIT ERR
1863 for (( i=2; i<=$OSTCOUNT; i++ )); do
1864 start ost$i `ostdevname $i` $OST_MOUNT_OPTS || return $((i+2))
1867 # wait until osts in sync
1868 for (( i=2; i<=$OSTCOUNT; i++ )); do
1869 wait_osc_import_state mds ost$i FULL
1872 #second client see all ost's
1874 mount_client $MOUNT2 || return 8
1875 $LFS setstripe $MOUNT2 -c -1 || return 9
1876 $LFS getstripe $MOUNT2 || return 10
1878 echo "ok" > $MOUNT2/widestripe
1879 $LFS getstripe $MOUNT2/widestripe || return 11
1880 # fill acl buffer for avoid expand lsm to them
1881 awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do
1882 setfacl -m $acl $MOUNT2/widestripe
1886 stat $MOUNT/widestripe || return 12
1888 cleanup_46a $OSTCOUNT || { echo "cleanup_46a failed!" && return 13; }
1891 run_test 46a "handle ost additional - wide striped file"
1896 check_mount || return 2
1897 $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
1901 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1902 lrs=$(echo $ns | sed 's/.*lru_size=//')
1903 lru_size[count]=$lrs
1909 client_up || return 3
1912 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1913 lrs=$(echo $ns | sed 's/.*lru_size=//')
1914 if ! test "$lrs" -eq "${lru_size[count]}"; then
1915 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
1916 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
1924 run_test 47 "server restart does not make client loss lru_resize settings"
1929 # reformat after this test is needed - if test will failed
1930 # we will have unkillable file at FS
1934 test_48() { # bug 17636
1937 check_mount || return 2
1939 $LFS setstripe $MOUNT -c -1 || return 9
1940 $LFS getstripe $MOUNT || return 10
1942 echo "ok" > $MOUNT/widestripe
1943 $LFS getstripe $MOUNT/widestripe || return 11
1945 trap cleanup_48 EXIT ERR
1947 # fill acl buffer for avoid expand lsm to them
1948 getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
1949 setfacl -m $acl $MOUNT/widestripe
1952 stat $MOUNT/widestripe || return 12
1957 run_test 48 "too many acls on file"
1959 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
1960 test_49() { # bug 17710
1961 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
1962 local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
1963 local LOCAL_TIMEOUT=20
1965 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
1969 check_mount || return 1
1971 echo "check ldlm_timout..."
1972 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1973 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1974 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1976 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1977 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
1980 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
1981 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
1984 umount_client $MOUNT
1985 stop_ost || return 2
1986 stop_mds || return 3
1988 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"
1992 check_mount || return 7
1994 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1995 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1996 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1998 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1999 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2002 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
2003 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2006 cleanup || return $?
2008 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
2009 OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
2011 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
2014 # Test both statfs and lfs df and fail if either one fails
2015 multiop_bg_pause $1 f_
2018 killall -USR1 multiop
2019 [ $RC1 -ne 0 ] && log "lazystatfs multiop failed"
2020 wait $PID || { RC1=$?; log "multiop return error "; }
2027 if [ $RC2 -eq 0 ]; then
2029 log "lazystatfs df failed"
2033 [[ $RC1 -ne 0 || $RC2 -eq 0 ]] && RC=1
2039 lctl set_param llite.$FSNAME-*.lazystatfs=1
2042 lazystatfs $MOUNT || error "lazystatfs failed but no down servers"
2044 cleanup || return $?
2046 run_test 50a "lazystatfs all servers available =========================="
2050 lctl set_param llite.$FSNAME-*.lazystatfs=1
2053 # Wait for client to detect down OST
2054 stop_ost || error "Unable to stop OST1"
2055 wait_osc_import_state mds ost DISCONN
2057 lazystatfs $MOUNT || error "lazystatfs should don't have returned EIO"
2059 umount_client $MOUNT || error "Unable to unmount client"
2060 stop_mds || error "Unable to stop MDS"
2062 run_test 50b "lazystatfs all servers down =========================="
2065 start_mds || error "Unable to start MDS"
2066 start_ost || error "Unable to start OST1"
2067 start_ost2 || error "Unable to start OST2"
2068 mount_client $MOUNT || error "Unable to mount client"
2069 lctl set_param llite.$FSNAME-*.lazystatfs=1
2072 # Wait for client to detect down OST
2073 stop_ost || error "Unable to stop OST1"
2074 wait_osc_import_state mds ost DISCONN
2075 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2077 umount_client $MOUNT || error "Unable to unmount client"
2078 stop_ost2 || error "Unable to stop OST2"
2079 stop_mds || error "Unable to stop MDS"
2081 run_test 50c "lazystatfs one server down =========================="
2084 start_mds || error "Unable to start MDS"
2085 start_ost || error "Unable to start OST1"
2086 start_ost2 || error "Unable to start OST2"
2087 mount_client $MOUNT || error "Unable to mount client"
2088 lctl set_param llite.$FSNAME-*.lazystatfs=1
2091 # Issue the statfs during the window where the client still
2092 # belives the OST to be available but it is in fact down.
2093 # No failure just a statfs which hangs for a timeout interval.
2094 stop_ost || error "Unable to stop OST1"
2095 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2097 umount_client $MOUNT || error "Unable to unmount client"
2098 stop_ost2 || error "Unable to stop OST2"
2099 stop_mds || error "Unable to stop MDS"
2101 run_test 50d "lazystatfs client/server conn race =========================="
2108 start_mds || return 1
2109 #first client should see only one ost
2110 start_ost || return 2
2111 wait_osc_import_state mds ost FULL
2113 # Wait for client to detect down OST
2114 stop_ost || error "Unable to stop OST1"
2115 wait_osc_import_state mds ost DISCONN
2117 mount_client $MOUNT || error "Unable to mount client"
2118 lctl set_param llite.$FSNAME-*.lazystatfs=0
2120 multiop_bg_pause $MOUNT _f
2124 if [ $RC1 -ne 0 ]; then
2125 log "lazystatfs multiop failed $RC1"
2128 sleep $(( $TIMEOUT+1 ))
2130 [ $? -ne 0 ] && error "process isn't sleep"
2131 start_ost || error "Unable to start OST1"
2132 wait $pid || error "statfs failed"
2135 umount_client $MOUNT || error "Unable to unmount client"
2136 stop_ost || error "Unable to stop OST1"
2137 stop_mds || error "Unable to stop MDS"
2139 run_test 50e "normal statfs all servers down =========================="
2144 CONN_PROC="osc.$FSNAME-OST0001-osc.ost_server_uuid"
2146 start_mds || error "Unable to start mds"
2147 #first client should see only one ost
2148 start_ost || error "Unable to start OST1"
2149 wait_osc_import_state mds ost FULL
2151 start_ost2 || error "Unable to start OST2"
2152 wait_osc_import_state mds ost2 FULL
2154 # Wait for client to detect down OST
2155 stop_ost2 || error "Unable to stop OST2"
2156 wait_osc_import_state mds ost2 DISCONN
2158 mount_client $MOUNT || error "Unable to mount client"
2159 lctl set_param llite.$FSNAME-*.lazystatfs=0
2161 multiop_bg_pause $MOUNT _f
2165 if [ $RC1 -ne 0 ]; then
2166 log "lazystatfs multiop failed $RC1"
2169 sleep $(( $TIMEOUT+1 ))
2171 [ $? -ne 0 ] && error "process isn't sleep"
2172 start_ost2 || error "Unable to start OST2"
2173 wait $pid || error "statfs failed"
2174 stop_ost2 || error "Unable to stop OST2"
2177 umount_client $MOUNT || error "Unable to unmount client"
2178 stop_ost || error "Unable to stop OST1"
2179 stop_mds || error "Unable to stop MDS"
2180 #writeconf to remove all ost2 traces for subsequent tests
2183 run_test 50f "normal statfs one server in down =========================="
2186 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
2188 start_ost2 || error "Unable to start OST2"
2189 wait_osc_import_state mds ost2 FULL
2190 wait_osc_import_state client ost2 FULL
2192 local PARAM="${FSNAME}-OST0001.osc.active"
2194 $LFS setstripe -c -1 $DIR/$tfile || error "Unable to lfs setstripe"
2195 do_facet mgs $LCTL conf_param $PARAM=0 || error "Unable to deactivate OST"
2197 umount_client $MOUNT || error "Unable to unmount client"
2198 mount_client $MOUNT || error "Unable to mount client"
2199 # This df should not cause a panic
2202 do_facet mgs $LCTL conf_param $PARAM=1 || error "Unable to activate OST"
2204 umount_client $MOUNT || error "Unable to unmount client"
2205 stop_ost2 || error "Unable to stop OST2"
2206 stop_ost || error "Unable to stop OST1"
2207 stop_mds || error "Unable to stop MDS"
2208 #writeconf to remove all ost2 traces for subsequent tests
2211 run_test 50g "deactivated OST should not cause panic====================="
2215 local max_ost_index=$1
2216 echo -n $(($max_ost_index * 8 + 8))
2220 local saved_opts=$OST_MKFS_OPTS
2222 for i in 0 1023 2048
2224 OST_MKFS_OPTS="$saved_opts --index $i"
2228 cp /etc/passwd $DIR/1
2232 cp /etc/passwd $DIR/2
2235 echo checking size of lov_objid for ost index $i
2236 local file_size=`do_facet mds \
2237 "$DEBUGFS -R 'stat lov_objid' $MDSDEV 2>/dev/null" | \
2238 grep ^User | awk '{print $6}'`
2239 if [ "$file_size" != $(lov_objid_size $i) ]; then
2240 error "lov_objid size has to be $(lov_objid_size $i), \
2243 echo ok, lov_objid size is correct: $file_size
2248 OST_MKFS_OPTS=$saved_opts
2251 run_test 55 "check lov_objid size"
2254 add mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=16\"' --reformat $MDSDEV
2255 add ost1 $OST_MKFS_OPTS --index=1000 --reformat `ostdevname 1`
2256 add ost2 $OST_MKFS_OPTS --index=10000 --reformat `ostdevname 2`
2260 start_ost2 || error "Unable to start second ost"
2261 mount_client $MOUNT || error "Unable to mount client"
2262 [ -n "$ENABLE_QUOTA" ] && { $LFS quotacheck -ug $MOUNT || error "quotacheck has failed" ; }
2267 run_test 56 "check big indexes"
2269 test_57() { # bug 22656
2270 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
2272 do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
2275 start_ost && error "OST registration from failnode should fail"
2278 run_test 57 "initial registration from failnode should fail (should return errs)"
2280 test_58() { # bug 22658
2281 [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
2284 createmany -o $DIR/$tdir/$tfile-%d 100
2285 # make sure that OSTs do not cancel llog cookies before we unmount the MDS
2286 #define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
2287 do_facet mds "lctl set_param fail_loc=0x601"
2288 unlinkmany $DIR/$tdir/$tfile-%d 100
2290 local MNTDIR=$(facet_mntpt mds)
2291 # remove all files from the OBJECTS dir
2292 do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
2293 do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
2294 do_facet mds "umount $MNTDIR"
2295 # restart MDS with missing llog files
2297 do_facet mds "lctl set_param fail_loc=0"
2300 run_test 58 "missing llog files must not prevent MDT from mounting"
2303 do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
2307 start_mgsmds >> /dev/null
2308 local C1=$(count_osts)
2309 if [ $C1 -eq 0 ]; then
2310 start_ost >> /dev/null
2314 echo "original ost count: $C1 (expect > 0)"
2315 [ $C1 -gt 0 ] || error "No OSTs in $FSNAME log"
2316 start_mgsmds -o writeconf >> /dev/null || error "MDT start failed"
2317 local C2=$(count_osts)
2318 echo "after mdt writeconf count: $C2 (expect 0)"
2319 [ $C2 -gt 0 ] && error "MDT writeconf should erase OST logs"
2320 echo "OST start without writeconf should fail:"
2321 start_ost >> /dev/null && error "OST start without writeconf didn't fail"
2322 echo "OST start with writeconf should succeed:"
2323 start_ost -o writeconf >> /dev/null || error "OST1 start failed"
2324 local C3=$(count_osts)
2325 echo "after ost writeconf count: $C3 (expect 1)"
2326 [ $C3 -eq 1 ] || error "new OST writeconf should add:"
2327 start_ost2 -o writeconf >> /dev/null || error "OST2 start failed"
2328 local C4=$(count_osts)
2329 echo "after ost2 writeconf count: $C4 (expect 2)"
2330 [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
2331 stop_ost2 >> /dev/null
2332 cleanup_nocli >> /dev/null
2334 run_test 59 "writeconf mount option"
2336 if ! combined_mgs_mds ; then
2340 equals_msg `basename $0`: test complete
2341 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true