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 mountopt="-o remount,$1"
169 echo "remount '$1' lustre on ${MOUNTPATH}....."
170 zconf_mount `hostname` $MOUNTPATH "$mountopt" || return 96
175 echo "umount lustre on ${MOUNTPATH}....."
176 zconf_umount `hostname` $MOUNTPATH || return 97
179 manual_umount_client(){
182 echo "manual umount lustre on ${MOUNT}...."
183 do_facet client "umount -d ${FORCE} $MOUNT"
189 start_mds || error "MDT start failed"
190 start_ost || error "OST start failed"
191 mount_client $MOUNT || error "client start failed"
196 if ! combined_mgs_mds ; then
205 unload_modules_conf () {
206 if combined_mgs_mds || ! local_mode; then
207 unload_modules || return 1
212 stop_mds || return 201
213 stop_ost || return 202
214 unload_modules_conf || return 203
218 umount_client $MOUNT || return 200
219 cleanup_nocli || return $?
223 do_facet client "cp /etc/passwd $DIR/a" || return 71
224 do_facet client "rm $DIR/a" || return 72
225 # make sure lustre is actually mounted (touch will block,
226 # but grep won't, so do it after)
227 do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
228 echo "setup single mount lustre success"
232 do_facet client "touch $DIR/a" || return 71
233 do_facet client "rm $DIR/a" || return 72
234 do_facet client "touch $DIR2/a" || return 73
235 do_facet client "rm $DIR2/a" || return 74
236 echo "setup double mount lustre success"
241 if [ "$ONLY" == "setup" ]; then
246 if [ "$ONLY" == "cleanup" ]; then
251 #create single point mountpoint
257 check_mount || return 41
260 run_test 0 "single mount setup"
264 echo "start ost second time..."
265 start_ost && error "2nd OST start should fail"
266 start_mds || error "MDT start failed"
267 mount_client $MOUNT || error "client start failed"
268 check_mount || return 42
271 run_test 1 "start up ost twice (should return errors)"
276 echo "start mds second time.."
277 start_mds && error "2nd MDT start should fail"
279 check_mount || return 43
282 run_test 2 "start up mds twice (should return err)"
286 #mount.lustre returns an error if already in mtab
287 mount_client $MOUNT && error "2nd client mount should fail"
288 check_mount || return 44
291 run_test 3 "mount client twice (should return err)"
295 touch $DIR/$tfile || return 85
299 # ok for ost to fail shutdown
300 if [ 202 -ne $eno ]; then
305 run_test 4 "force cleanup ost, then cleanup"
307 test_5a() { # was test_5
309 touch $DIR/$tfile || return 1
310 fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
312 stop_mds -f || return 2
314 # cleanup may return an error from the failed
315 # disconnects; for now I'll consider this successful
316 # if all the modules have unloaded.
320 echo "killing umount"
321 kill -TERM $UMOUNT_PID
322 echo "waiting for umount to finish"
324 if grep " $MOUNT " /proc/mounts; then
325 echo "test 5: /proc/mounts after failed umount"
329 echo "killing umount"
330 kill -TERM $UMOUNT_PID
331 echo "waiting for umount to finish"
333 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
337 # stop_mds is a no-op here, and should not fail
338 cleanup_nocli || return $?
339 # df may have lingering entry
341 # mtab may have lingering entry
345 while [ "$WAIT" -ne "$MAX_WAIT" ]; do
347 grep -q $MOUNT" " /etc/mtab || break
348 echo "Waiting /etc/mtab updated ... "
349 WAIT=$(( WAIT + sleep))
351 [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
352 echo "/etc/mtab updated in $WAIT secs"
354 run_test 5a "force cleanup mds, then cleanup"
362 grep " $MOUNT " /etc/mtab && \
363 error false "unexpected entry in mtab before mount" && return 10
367 if ! combined_mgs_mds ; then
368 trap cleanup_5b EXIT ERR
373 [ -d $MOUNT ] || mkdir -p $MOUNT
374 mount_client $MOUNT && rc=1
375 grep " $MOUNT " /etc/mtab && \
376 error "$MOUNT entry in mtab after failed mount" && rc=11
378 # stop_mds is a no-op here, and should not fail
379 cleanup_nocli || rc=$?
380 if ! combined_mgs_mds ; then
385 run_test 5b "Try to start a client with no MGS (should return errs)"
388 grep " $MOUNT " /etc/mtab && \
389 error false "unexpected entry in mtab before mount" && return 10
394 [ -d $MOUNT ] || mkdir -p $MOUNT
395 local oldfs="${FSNAME}"
396 FSNAME="wrong.${FSNAME}"
397 mount_client $MOUNT || :
399 grep " $MOUNT " /etc/mtab && \
400 error "$MOUNT entry in mtab after failed mount" && rc=11
402 cleanup_nocli || rc=$?
405 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
408 grep " $MOUNT " /etc/mtab && \
409 error false "unexpected entry in mtab before mount" && return 10
415 mount_client $MOUNT || rc=1
417 grep " $MOUNT " /etc/mtab && \
418 error "$MOUNT entry in mtab after unmount" && rc=11
421 run_test 5d "mount with ost down"
424 grep " $MOUNT " /etc/mtab && \
425 error false "unexpected entry in mtab before mount" && return 10
431 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
432 do_facet client "lctl set_param fail_loc=0x80000506"
433 mount_client $MOUNT || echo "mount failed (not fatal)"
435 grep " $MOUNT " /etc/mtab && \
436 error "$MOUNT entry in mtab after unmount" && rc=11
439 run_test 5e "delayed connect, don't crash (bug 10268)"
442 if combined_mgs_mds ; then
443 skip "combined mgs and mds"
447 grep " $MOUNT " /etc/mtab && \
448 error false "unexpected entry in mtab before mount" && return 10
452 [ -d $MOUNT ] || mkdir -p $MOUNT
453 mount_client $MOUNT &
455 echo client_mount pid is $pid
459 if ! ps -f -p $pid >/dev/null; then
462 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
463 error "mount returns $rc, expected to hang"
472 # mount should succeed after start mds
475 [ $rc -eq 0 ] || error "mount returned $rc"
476 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
480 run_test 5f "mds down, cleanup after failed mount (bug 2712)"
485 mount_client ${MOUNT} || return 87
486 touch $DIR/a || return 86
489 run_test 6 "manual umount, then mount again"
494 cleanup_nocli || return $?
496 run_test 7 "manual umount, then cleanup"
501 check_mount2 || return 45
502 umount_client $MOUNT2
505 run_test 8 "double mount setup"
510 do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
511 do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
513 CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
514 # interop 1.8 <-> 2.0: "trace inode warning error emerg console"
515 local lustre_version=$(get_lustre_version ost1)
516 echo ost1 running $lustre_version
517 if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ]; then
518 echo "lnet.debug success"
519 elif [[ $lustre_version != 1.8* ]] && \
520 [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ]; then
521 echo "lnet.debug success"
523 echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
526 CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
527 if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
528 echo "lnet.subsystem_debug success"
530 echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
533 stop_ost || return $?
535 run_test 9 "test ptldebug and subsystem for mkfs"
543 do_facet $facet "test -b $dev" || rc=1
544 if [[ "$size" ]]; then
545 local in=$(do_facet $facet "dd if=$dev of=/dev/null bs=1k count=1 skip=$size 2>&1" |\
546 awk '($3 == "in") { print $1 }')
547 [[ $in = "1+0" ]] || rc=1
554 # Skip this test if MDS is 2.0+, see bug 22944.
555 if [[ "$(get_mds_version_major)" != "1" ]]; then
556 skip "not running on 2.0 server"
561 check_mount || return 41
564 local TMPMTPT="${TMP}/conf16"
565 local files="{OBJECTS,PENDING,LOGS}"
567 is_blkdev mds $MDSDEV || LOOPOPT="-o loop"
569 log "change the mode of $MDSDEV/$files to 555"
570 do_facet mds "mkdir -p $TMPMTPT &&
571 mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
572 chmod 555 $TMPMTPT/$files &&
573 umount $TMPMTPT" || return $?
575 log "mount Lustre to change the mode of $files, then umount Lustre"
577 check_mount || return 41
580 log "read the mode of $files and check if they has been changed properly"
582 for file in ${files//[\{\},]/ }; do
583 expected=`do_facet mds "$DEBUGFS -R 'stat $file' $MDSDEV 2> /dev/null" | \
584 grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
586 if [ "$expected" = "0777" ]; then
587 log "Success:Lustre change the mode of $file correctly"
589 error "Lustre does not change mode of $file properly"
593 run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING"
597 check_mount || return 41
600 echo "Remove mds config log"
601 if ! combined_mgs_mds ; then
605 do_facet mgs "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MGSDEV || return \$?" || return $?
607 if ! combined_mgs_mds ; then
612 start_mds && return 42
615 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
618 [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return
623 # check if current MDSSIZE is large enough
624 [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
625 log "use MDSSIZE=$MDSSIZE"
627 # check if the global config has a large enough MDSSIZE
628 [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
629 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
630 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
632 # check if the block device is large enough
633 [ -z "$OK" ] && $(is_blkdev mds $MDSDEV $MIN) && OK=1 &&
634 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
636 # check if a loopback device has enough space for fs metadata (5%)
638 if [ -z "$OK" ]; then
639 local SPACE=$(do_facet mds "[ -f $MDSDEV -o ! -e $MDSDEV ] && df -P \\\$(dirname $MDSDEV)" |
640 awk '($1 != "Filesystem") {print $4}')
641 ! [ -z "$SPACE" ] && [ $SPACE -gt $((MIN / 20)) ] && \
642 OK=1 && myMDSSIZE=$MIN && \
643 log "use file $MDSDEV with MIN=$MIN"
646 [ -z "$OK" ] && skip_env "$MDSDEV too small for ${MIN}kB MDS" && return
649 echo "mount mds with large journal..."
650 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
652 local opts="--mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
654 if combined_mgs_mds ; then
655 MDS_MKFS_OPTS="--mgs $opts"
657 MDS_MKFS_OPTS="--mgsnode=$MGSNID $opts"
661 echo "mount lustre system..."
663 check_mount || return 41
665 echo "check journal size..."
666 local FOUNDSIZE=$(do_facet mds "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}')
667 if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
668 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
670 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
675 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
678 run_test 18 "check mkfs creates large journals"
681 start_mds || return 1
682 stop_mds -f || return 2
684 run_test 19a "start/stop MDS without OSTs"
687 start_ost || return 1
688 stop_ost -f || return 2
690 run_test 19b "start/stop OSTs without MDS"
693 # first format the ost/mdt
697 check_mount || return 43
699 remount_client ro $MOUNT || return 44
700 touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
701 [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
702 remount_client rw $MOUNT || return 47
704 [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
705 MCNT=`grep -c $MOUNT /etc/mtab`
706 [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
711 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
716 wait_osc_import_state mds ost FULL
720 run_test 21a "start mds before ost, stop ost first"
725 wait_osc_import_state mds ost FULL
729 run_test 21b "start ost before mds, stop mds first"
735 wait_osc_import_state mds ost2 FULL
740 #writeconf to remove all ost2 traces for subsequent tests
743 run_test 21c "start mds between two osts, stop mds last"
746 if combined_mgs_mds ; then
747 skip "need separate mgs device" && return 0
763 run_test 21d "start mgs then ost and then mds"
769 echo Client mount with ost in logs, but none running
771 wait_osc_import_state mds ost FULL
774 # check_mount will block trying to contact ost
775 mcreate $DIR/$tfile || return 40
776 rm -f $DIR/$tfile || return 42
780 echo Client mount with a running ost
783 check_mount || return 41
788 run_test 22 "start a client before osts (should return errs)"
790 test_23a() { # was test_23
794 # force down client so that recovering mds waits for reconnect
795 local running=$(grep -c $MOUNT /proc/mounts) || true
796 if [ $running -ne 0 ]; then
797 echo "Stopping client $MOUNT (opts: -f)"
801 # enter recovery on mds
803 # try to start a new client
804 mount_client $MOUNT &
806 MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
807 MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
808 echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
810 ps --ppid $MOUNT_LUSTRE_PID
811 # FIXME why o why can't I kill these? Manual "ctrl-c" works...
812 kill -TERM $MOUNT_LUSTRE_PID
813 echo "waiting for mount to finish"
815 # we can not wait $MOUNT_PID because it is not a child of this shell
821 while [ "$WAIT" -lt "$MAX_WAIT" ]; do
823 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
824 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
827 [ -z "$PID1" -a -z "$PID2" ] && break
828 echo "waiting for mount to finish ... "
829 WAIT=$(( WAIT + sleep))
831 if [ "$WAIT" -eq "$MAX_WAIT" ]; then
832 error "MOUNT_PID $MOUNT_PID and \
833 MOUNT__LUSTRE_PID $MOUNT__LUSTRE_PID still not killed in $WAIT secs"
839 run_test 23a "interrupt client during recovery mount delay"
844 test_23b() { # was test_23
847 # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
848 lctl set_param fail_loc=0x80000313
852 run_test 23b "Simulate -EINTR during mount"
854 fs2mds_HOST=$mds_HOST
855 fs2ost_HOST=$ost_HOST
859 echo "umount $MOUNT2 ..."
860 umount $MOUNT2 || true
861 echo "stopping fs2mds ..."
862 stop fs2mds -f || true
863 echo "stopping fs2ost ..."
864 stop fs2ost -f || true
868 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
869 is_blkdev mds $MDSDEV && \
870 skip_env "mixed loopback and real device not working" && return
873 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
875 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
876 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
878 # test 8-char fsname as well
879 local FSNAME2=test1234
880 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
882 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
885 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
886 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
888 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
890 check_mount || return 2
891 # files written on 1 should not show up on 2
892 cp /etc/passwd $DIR/$tfile
894 [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
896 cp /etc/passwd $MOUNT2/b || return 3
897 rm $MOUNT2/b || return 4
898 # 2 is actually mounted
899 grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
901 facet_failover fs2mds
902 facet_failover fs2ost
905 # the MDS must remain up until last MDT
908 local mdt_obdname=$(do_facet mds "lctl get_param -n devices" | \
909 awk '/ mdt / { print $4 }' | head -1)
910 [ -z "$mdt_obdname" ] && error "No MDT" && return 8
913 cleanup_nocli || return 6
915 run_test 24a "Multiple MDTs on a single node"
918 if [ -z "$fs2mds_DEV" ]; then
919 is_blkdev mds $MDSDEV && \
920 skip_env "mixed loopback and real device not working" && return
923 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
925 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10
927 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
930 run_test 24b "Multiple MGSs on a single node (should return err)"
934 check_mount || return 2
935 local MODULES=$($LCTL modules | awk '{ print $2 }')
936 rmmod $MODULES 2>/dev/null || true
939 run_test 25 "Verify modules are referenced"
943 # we need modules before mount for sysctl, so make sure...
944 do_facet mds "lsmod | grep -q lustre || modprobe lustre"
945 #define OBD_FAIL_MDS_FS_SETUP 0x135
946 do_facet mds "lctl set_param fail_loc=0x80000135"
947 start_mds && echo MDS started && return 1
948 lctl get_param -n devices
949 DEVS=$(lctl get_param -n devices | egrep -v MG | wc -l)
950 [ $DEVS -gt 0 ] && return 2
951 unload_modules_conf || return $?
953 run_test 26 "MDT startup failure cleans LOV (should return errs)"
959 local ORIG=$(do_facet $myfacet "$TEST")
960 if [ $# -gt 3 ]; then
966 echo "Setting $PARAM from $ORIG to $FINAL"
967 do_facet mds "$LCTL conf_param $PARAM=$FINAL" || error conf_param failed
969 wait_update $(facet_host $myfacet) "$TEST" $FINAL || error check failed!
973 start_ost || return 1
974 start_mds || return 2
975 echo "Requeue thread should have started: "
976 ps -e | grep ll_cfg_requeue
977 set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
980 run_test 27a "Reacquire MGS lock if OST started first"
985 # interop 1.8 <-> 2.0:
986 # 1.8: group_acquire_expire, 2.0: identity_acquire_expire
987 local acquire_expire=$(do_facet mds lctl get_param md*.$FSNAME-MDT0000.*acquire_expire | \
988 cut -d= -f1 | cut -d. -f3)
990 set_and_check mds "lctl get_param -n md*.$FSNAME-MDT0000.$acquire_expire" \
991 "$FSNAME-MDT0000.mdt.$acquire_expire" || return 3
992 set_and_check client "lctl get_param -n mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight" \
993 "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4
997 run_test 27b "Reacquire MGS lock after failover"
1001 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1002 PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
1004 FINAL=$(($ORIG + 1))
1005 set_and_check client "$TEST" "$PARAM" $FINAL || return 3
1006 FINAL=$(($FINAL + 1))
1007 set_and_check client "$TEST" "$PARAM" $FINAL || return 4
1008 umount_client $MOUNT || return 200
1011 if [ $RESULT -ne $FINAL ]; then
1012 echo "New config not seen: wanted $FINAL got $RESULT"
1015 echo "New config success: got $RESULT"
1017 set_and_check client "$TEST" "$PARAM" $ORIG || return 5
1020 run_test 28 "permanent parameter setting"
1023 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
1024 setup > /dev/null 2>&1
1028 local PARAM="$FSNAME-OST0001.osc.active"
1029 local PROC_ACT="osc.$FSNAME-OST0001-osc-*.active"
1030 local PROC_UUID="osc.$FSNAME-OST0001-osc-*.ost_server_uuid"
1032 ACTV=$(lctl get_param -n $PROC_ACT)
1034 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
1035 # also check ost_server_uuid status
1036 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
1037 if [ -z "$RESULT" ]; then
1038 echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
1041 echo "Live client success: got $RESULT"
1045 local MPROC="osc.$(get_mdtosc_proc_path $FSNAME-OST0001).active"
1050 RESULT=`do_facet mds " lctl get_param -n $MPROC"`
1051 [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
1052 if [ $RESULT -eq $DEAC ]; then
1053 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
1057 if [ $WAIT -eq $MAX ]; then
1058 echo "MDT not deactivated: wanted $DEAC got $RESULT"
1061 echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
1064 # test new client starts deactivated
1065 umount_client $MOUNT || return 200
1067 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
1068 if [ -z "$RESULT" ]; then
1069 echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
1072 echo "New client success: got $RESULT"
1075 # make sure it reactivates
1076 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
1078 umount_client $MOUNT
1081 #writeconf to remove all ost2 traces for subsequent tests
1084 run_test 29 "permanently remove an OST"
1089 echo Big config llog
1090 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1092 LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
1093 for i in ${LIST[@]}; do
1094 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
1096 # make sure client restart still works
1097 umount_client $MOUNT
1098 mount_client $MOUNT || return 4
1099 [ "$($TEST)" -ne "$i" ] && error "Param didn't stick across restart $($TEST) != $i"
1102 echo Erase parameter setting
1103 do_facet mgs "$LCTL conf_param -d $FSNAME.llite.max_read_ahead_whole_mb" || return 6
1104 umount_client $MOUNT
1105 mount_client $MOUNT || return 6
1107 echo "deleted (default) value=$FINAL, orig=$ORIG"
1108 # assumes this parameter started at the default value
1109 [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
1113 run_test 30a "Big config llog and conf_param deletion"
1118 # Make a fake nid. Use the OST nid, and add 20 to the least significant
1119 # numerical part of it. Hopefully that's not already a failover address for
1121 OSTNID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
1122 ORIGVAL=$(echo $OSTNID | egrep -oi "[0-9]*@")
1123 NEWVAL=$((($(echo $ORIGVAL | egrep -oi "[0-9]*") + 20) % 256))
1124 NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
1125 echo "Using fake nid $NEW"
1127 TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
1128 set_and_check client "$TEST" "$FSNAME-OST0000.failover.node" $NEW || error "didn't add failover nid $NEW"
1129 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1131 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1132 echo "should have 2 failover nids: $NIDCOUNT"
1133 [ $NIDCOUNT -eq 2 ] || error "Failover nid not added"
1134 do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed"
1135 umount_client $MOUNT
1136 mount_client $MOUNT || return 3
1138 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1140 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1141 echo "only 1 final nid should remain: $NIDCOUNT"
1142 [ $NIDCOUNT -eq 1 ] || error "Failover nids not removed"
1146 run_test 30b "Remove failover nids"
1148 test_31() { # bug 10734
1149 # ipaddr must not exist
1150 mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
1153 run_test 31 "Connect to non-existent node (returns errors, should not crash)"
1155 # Use these start32/stop32 fn instead of t-f start/stop fn,
1156 # for local devices, to skip global facet vars init
1160 echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
1161 umount -d $@ ${MOUNT%/*}/${facet}
1170 mkdir -p ${MOUNT%/*}/${facet}
1172 echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
1173 mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
1175 if [ $RC -ne 0 ]; then
1176 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
1177 echo "Start of ${device} of local ${facet} failed ${RC}"
1183 cleanup_nocli32 () {
1191 echo "Cleanup test_32 umount $MOUNT ..."
1192 umount -f $MOUNT || true
1193 echo "Cleanup local mds ost1 ..."
1195 combined_mgs_mds || start_mgs
1200 # this test is totally useless on a client-only system
1201 client_only && skip "client only testing" && return 0
1202 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1203 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
1205 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1206 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1208 local tmpdir=$TMP/conf32a
1211 tar xjvf $DISK1_6 -C $tmpdir ||
1212 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1214 lctl set_param debug=$PTLDEBUG
1216 $TUNEFS $tmpdir/mds || error "tunefs failed"
1218 combined_mgs_mds || stop mgs
1220 # nids are wrong, so client wont work, but server should start
1221 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1222 trap cleanup_32 EXIT INT || return 3
1224 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1226 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1228 $TUNEFS --mgsnode=`hostname` $tmpdir/ost1 || error "tunefs failed"
1229 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1230 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1232 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1234 local NID=$($LCTL list_nids | head -1)
1236 echo "OSC changes should succeed:"
1237 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1238 $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1240 echo "MDC changes should succeed:"
1241 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1242 $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1247 # mount a second time to make sure we didnt leave upgrade flag on
1249 $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1251 combined_mgs_mds || stop mgs
1253 start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1254 trap cleanup_32 EXIT INT || return 12
1258 rm -rf $tmpdir || true # true is only for TMP on NFS
1260 run_test 32a "Upgrade from 1.6 (not live)"
1263 # this test is totally useless on a client-only system
1264 client_only && skip "client only testing" && return 0
1265 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1266 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return
1268 local DISK1_6=$LUSTRE/tests/disk1_6.tar.bz2
1269 [ ! -r $DISK1_6 ] && skip_env "Cant find $DISK1_6, skipping" && return
1271 local tmpdir=$TMP/conf32b
1274 tar xjvf $DISK1_6 -C $tmpdir ||
1275 { skip_env "Cant untar $DISK1_6, skipping" && return ; }
1278 lctl set_param debug=$PTLDEBUG
1280 # Ugrade process in according to comment 2 bug 20246
1281 # writeconf will cause servers to register with their current nids
1282 $TUNEFS --mdt --writeconf --erase-param \
1283 --param="mdt.group_upcall=/usr/sbin/l_getgroups" $tmpdir/mds || \
1284 error "tunefs mds failed"
1286 combined_mgs_mds || stop mgs
1288 start32 mds $tmpdir/mds "-o loop,abort_recov" && \
1289 trap cleanup_32 EXIT INT || return 3
1292 start32 mds "-o loop" $tmpdir/mds || return 4
1293 local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
1295 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1297 $TUNEFS --ost --writeconf --erase-param --mgsnode=`hostname`@$NETTYPE $tmpdir/ost1 || \
1298 error "tunefs ost failed"
1299 start32 ost1 $tmpdir/ost1 "-o loop,abort_recov" || return 5
1301 UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1303 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1305 local NID=$($LCTL list_nids | head -1)
1307 echo "OSC changes should succeed:"
1308 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || error "OSC conf_param failed"
1309 $LCTL conf_param lustre-OST0000.failover.node=$NID || error "add failover nid=$NID failed"
1311 echo "MDC changes should succeed:"
1312 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1315 # MDT and OST should have registered with new nids, so we should have
1316 # a fully-functioning client
1317 echo "Check client and old fs contents"
1319 local device=`h2$NETTYPE $HOSTNAME`:/lustre
1320 echo "Starting local client: $HOSTNAME: $device $MOUNT"
1321 mount -t lustre $device $MOUNT || return 1
1323 local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
1324 local new=$((old + 5))
1325 lctl conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=$new
1326 wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1328 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2940530074 2837" ] || return 12
1333 rm -rf $tmpdir || true # true is only for TMP on NFS
1335 run_test 32b "Upgrade from 1.6 with writeconf"
1337 test_33a() { # bug 12333, was test_33
1339 local FSNAME2=test-123
1340 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1342 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1343 is_blkdev mds $MDSDEV && \
1344 skip_env "mixed loopback and real device not working" && return
1347 # interop 1.8 <-> 2.0
1349 local major=$(get_mds_version_major)
1350 local minor=$(get_mds_version_minor)
1351 if [ $major -le 1 -a $minor -le 8 ]; then
1354 mkfs_opts="--mkfsoptions='-J size=8'" # bug 17931
1357 combined_mgs_mds || mkfs_opts="$mkfs_opts --nomgs"
1359 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1360 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1361 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} $mkfs_opts --reformat $fs2mdsdev || exit 10
1362 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1364 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1365 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1366 do_facet mds "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1368 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1369 cp /etc/hosts $MOUNT2/. || rc=3
1372 cp /etc/hosts $MOUNT2/ || rc=3
1373 $LFS getstripe $MOUNT2/hosts
1378 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1379 cleanup_nocli || rc=6
1382 run_test 33a "Mount ost with a large index number"
1384 test_33b() { # was test_33a
1387 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1388 # Drop lock cancelation reply during umount
1389 #define OBD_FAIL_LDLM_CANCEL 0x304
1390 do_facet client lctl set_param fail_loc=0x80000304
1391 #lctl set_param debug=-1
1392 umount_client $MOUNT
1395 run_test 33b "Drop cancel during umount"
1399 do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1400 manual_umount_client
1402 do_facet client killall -USR1 multiop
1403 if [ $rc -eq 0 ]; then
1404 error "umount not fail!"
1409 run_test 34a "umount with opened file should be fail"
1414 touch $DIR/$tfile || return 1
1415 stop_mds --force || return 2
1417 manual_umount_client --force
1419 if [ $rc -ne 0 ]; then
1420 error "mtab after failed umount - rc $rc"
1426 run_test 34b "force umount with failed mds should be normal"
1430 touch $DIR/$tfile || return 1
1431 stop_ost --force || return 2
1433 manual_umount_client --force
1435 if [ $rc -ne 0 ]; then
1436 error "mtab after failed umount - rc $rc"
1442 run_test 34c "force umount with failed ost should be normal"
1444 test_35a() { # bug 12459
1448 lctl set_param debug="ha"
1450 log "Set up a fake failnode for the MDS"
1452 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || return 4
1454 log "Wait for RECONNECT_INTERVAL seconds (10s)"
1457 MSG="conf-sanity.sh test_35a `date +%F%kh%Mm%Ss`"
1460 log "Stopping the MDT:"
1461 stop_mds || return 5
1463 df $MOUNT > /dev/null 2>&1 &
1465 log "Restarting the MDT:"
1466 start_mds || return 6
1467 log "Wait for df ($DFPID) ... "
1472 # retrieve from the log the first server that the client tried to
1473 # contact after the connection loss
1474 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1475 NEXTCONN=`awk "/${MSG}/ {start = 1;}
1476 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1478 if (\\\$NF ~ /$FAKENID/)
1484 }" $TMP/lustre-log-$TESTNAME.log`
1485 [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1487 # remove nid settings
1490 run_test 35a "Reconnect to the last active server first"
1492 test_35b() { # bug 18674
1493 remote_mds || { skip "local MDS" && return 0; }
1497 $LCTL set_param debug="ha"
1499 MSG="conf-sanity.sh test_35b `date +%F%kh%Mm%Ss`"
1502 log "Set up a fake failnode for the MDS"
1504 do_facet mds $LCTL conf_param ${FSNAME}-MDT0000.failover.node=$FAKENID || \
1507 local at_max_saved=0
1508 # adaptive timeouts may prevent seeing the issue
1509 if at_is_enabled; then
1510 at_max_saved=$(at_max_get mds)
1511 at_max_set 0 mds client
1514 mkdir -p $MOUNT/$tdir
1516 log "Injecting EBUSY on MDS"
1517 # Setting OBD_FAIL_MDS_RESEND=0x136
1518 do_facet mds "$LCTL set_param fail_loc=0x80000136" || return 2
1520 $LCTL set_param mdc.${FSNAME}*.stats=clear
1522 log "Creating a test file and stat it"
1523 touch $MOUNT/$tdir/$tfile
1524 stat $MOUNT/$tdir/$tfile
1526 log "Stop injecting EBUSY on MDS"
1527 do_facet mds "$LCTL set_param fail_loc=0" || return 3
1528 rm -f $MOUNT/$tdir/$tfile
1531 # restore adaptive timeout
1532 [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds client
1534 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1536 CONNCNT=`$LCTL get_param mdc.${FSNAME}*.stats | awk '/mds_connect/{print $2}'`
1538 # retrieve from the log if the client has ever tried to
1539 # contact the fake server after the loss of connection
1540 FAILCONN=`awk "BEGIN {ret = 0;}
1541 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1543 if (\\\$NF ~ /$FAKENID/) {
1548 END {print ret}" $TMP/lustre-log-$TESTNAME.log`
1550 [ "$FAILCONN" == "0" ] && \
1551 log "ERROR: The client reconnection has not been triggered" && \
1553 [ "$FAILCONN" == "2" ] && \
1554 log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
1557 # When OBD_FAIL_MDS_RESEND is hit, we sleep for 2 * obd_timeout
1558 # Reconnects are supposed to be rate limited to one every 5s
1559 [ $CONNCNT -gt $((2 * $TIMEOUT / 5 + 1)) ] && \
1560 log "ERROR: Too many reconnects $CONNCNT" && \
1564 # remove nid settings
1567 run_test 35b "Continue reconnection retries, if the active server is busy"
1570 [ $OSTCOUNT -lt 2 ] && skip_env "skipping test for single OST" && return
1572 [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1573 { skip "remote OST" && return 0; }
1576 local FSNAME2=test1234
1577 local fs3ost_HOST=$ost_HOST
1579 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1581 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1582 is_blkdev mds $MDSDEV && \
1583 skip_env "mixed loopback and real device not working" && return
1586 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1587 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1588 local fs3ostdev=${fs3ost_DEV:-$(ostdevname 2)_2}
1589 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1590 # XXX after we support non 4K disk blocksize, change following --mkfsoptions with
1592 add fs2ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1593 add fs3ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs3ostdev || exit 10
1595 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1596 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1597 start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1599 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1601 sleep 5 # until 11778 fixed
1603 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1605 BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1606 BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1607 BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1608 STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1609 DFTOTAL=`echo $STRING | cut -d, -f1`
1610 DFUSED=`echo $STRING | cut -d, -f2`
1611 DFAVAIL=`echo $STRING | cut -d, -f3`
1612 DFFREE=$(($DFTOTAL - $DFUSED))
1614 ALLOWANCE=$((64 * $OSTCOUNT))
1616 if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||
1617 [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1618 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1621 if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] ||
1622 [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1623 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1626 if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] ||
1627 [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1628 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1633 stop fs3ost -f || return 200
1634 stop fs2ost -f || return 201
1635 stop fs2mds -f || return 202
1636 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev $fs3ostdev
1637 unload_modules_conf || return 203
1640 run_test 36 "df report consistency on OSTs with different block size"
1643 local mntpt=$(facet_mntpt mds)
1644 local mdsdev=$MDSDEV
1645 local mdsdev_sym="$TMP/sym_mdt.img"
1647 echo "MDS : $mdsdev"
1648 echo "SYMLINK : $mdsdev_sym"
1649 do_facet mds rm -f $mdsdev_sym
1651 do_facet mds ln -s $mdsdev $mdsdev_sym
1653 echo "mount symlink device - $mdsdev_sym"
1656 mount_op=$(do_facet mds mount -v -t lustre $MDS_MOUNT_OPTS $mdsdev_sym $mntpt 2>&1 )
1659 echo mount_op=$mount_op
1661 do_facet mds "umount -d $mntpt && rm -f $mdsdev_sym"
1663 if $(echo $mount_op | grep -q "unable to set tunable"); then
1664 error "set tunables failed for symlink device"
1667 [ $rc -eq 0 ] || error "mount symlink $mdsdev_sym failed! rc=$rc"
1671 run_test 37 "verify set tunables works for symlink device"
1673 test_38() { # bug 14222
1678 FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1679 log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1681 tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1682 error "copying $SRC to $DIR/$tdir"
1684 umount_client $MOUNT
1686 log "rename lov_objid file on MDS"
1687 rm -f $TMP/lov_objid.orig
1688 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1689 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1691 do_facet mds "od -Ax -td8 $TMP/lov_objid.orig"
1692 # check create in mds_lov_connect
1696 [ $V ] && log "verifying $DIR/$tdir/$f"
1697 diff -q $f $DIR/$tdir/$f || ERROR=y
1699 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
1700 do_facet mds "od -Ax -td8 $TMP/lov_objid.new"
1701 [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1704 # check it's updates in sync
1705 umount_client $MOUNT
1708 do_facet mds dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1709 do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1710 do_facet mds "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1715 [ $V ] && log "verifying $DIR/$tdir/$f"
1716 diff -q $f $DIR/$tdir/$f || ERROR=y
1718 do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1719 do_facet mds "od -Ax -td8 $TMP/lov_objid.new1"
1720 umount_client $MOUNT
1722 [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1724 log "files compared the same"
1727 run_test 38 "MDS recreates missing lov_objid file from OST data"
1729 test_39() { #bug 14413
1733 perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' &&
1734 error "memory leak detected" || true
1736 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1738 test_40() { # bug 15759
1740 #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706
1741 do_facet mds "lctl set_param fail_loc=0x80000706"
1745 run_test 40 "race during service thread startup"
1747 test_41() { #bug 14134
1749 start mds $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1750 start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1751 start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1753 mount_client $MOUNT || return 1
1756 echo "blah blah" > $MOUNT/$tfile
1759 umount_client $MOUNT
1760 stop ost1 -f || return 201
1761 stop mds -f || return 202
1762 stop mds -f || return 203
1763 unload_modules_conf || return 204
1766 run_test 41 "mount mds with --nosvc and --nomgs"
1768 test_42() { #bug 14693
1770 check_mount || return 2
1771 do_facet client lctl conf_param lustre.llite.some_wrong_param=10
1772 umount_client $MOUNT
1773 mount_client $MOUNT || return 1
1777 run_test 42 "invalid config param should not prevent client from mounting"
1779 test_43() { #bug 15993
1781 VERSION_1_8=$(do_facet mds $LCTL get_param version | grep ^lustre.*1\.[78])
1782 if [ -z "$VERSION_1_8" ]; then
1783 skip "skipping test for non 1.8 MDS"
1788 check_mount || return 2
1789 testfile=$DIR/$tfile
1790 lma="this-should-be-removed-after-remount-and-accessed"
1792 echo "set/get trusted.lma"
1793 #define OBD_FAIL_MDS_ALLOW_COMMON_EA_SETTING 0x13f
1794 do_facet mds "lctl set_param fail_loc=0x13f"
1795 lctl set_param fail_loc=0x13f
1796 setfattr -n trusted.lma -v $lma $testfile || error "create common EA"
1797 do_facet mds "lctl set_param fail_loc=0"
1798 lctl set_param fail_loc=0
1799 ATTR=$(getfattr -n trusted.lma $testfile 2> /dev/null | grep trusted.lma)
1800 [ "$ATTR" = "trusted.lma=\"$lma\"" ] || error "check common EA"
1801 umount_client $MOUNT
1806 check_mount || return 3
1807 #define OBD_FAIL_MDS_REMOVE_COMMON_EA 0x13e
1808 do_facet mds "lctl set_param fail_loc=0x13e"
1810 do_facet mds "lctl set_param fail_loc=0"
1811 getfattr -d -m trusted $testfile 2> /dev/null | \
1812 grep "trusted.lma" && error "common EA not removed" || true
1816 run_test 43 "remove common EA if it exists"
1820 check_mount || return 2
1821 UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
1823 UUIDS=$(do_facet mds "$LCTL get_param $(get_mds_mdt_device_proc_path).${FSNAME}*.exports.*.uuid")
1824 for VAL in $UUIDS; do
1825 NID=$(echo $VAL | cut -d= -f1)
1826 CLUUID=$(echo $VAL | cut -d= -f2)
1827 [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
1829 [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
1833 run_test 44 "mounted client proc entry exists"
1837 check_mount || return 2
1842 #define OBD_FAIL_PTLRPC_LONG_UNLINK 0x50f
1843 do_facet client "lctl set_param fail_loc=0x50f"
1846 manual_umount_client --force || return 3
1847 do_facet client "lctl set_param fail_loc=0x0"
1849 mount_client $MOUNT || return 4
1853 run_test 45 "long unlink handling in ptlrpcd"
1860 umount_client $MOUNT2 || rc=$?
1861 umount_client $MOUNT || rc=$?
1862 while [ $count -gt 0 ]; do
1863 stop ost${count} -f || rc=$?
1867 cleanup_nocli || rc=$?
1868 #writeconf to remove all ost2 traces for subsequent tests
1874 echo "Testing with $OSTCOUNT OSTs"
1876 start_mds || return 1
1877 #first client should see only one ost
1878 start_ost || return 2
1879 wait_osc_import_state mds ost FULL
1881 mount_client $MOUNT || return 3
1882 trap "cleanup_46a $OSTCOUNT" EXIT ERR
1885 for (( i=2; i<=$OSTCOUNT; i++ )); do
1886 start ost$i `ostdevname $i` $OST_MOUNT_OPTS || return $((i+2))
1889 # wait until osts in sync
1890 for (( i=2; i<=$OSTCOUNT; i++ )); do
1891 wait_osc_import_state mds ost$i FULL
1894 #second client see all ost's
1896 mount_client $MOUNT2 || return 8
1897 $LFS setstripe $MOUNT2 -c -1 || return 9
1898 $LFS getstripe $MOUNT2 || return 10
1900 echo "ok" > $MOUNT2/widestripe
1901 $LFS getstripe $MOUNT2/widestripe || return 11
1902 # fill acl buffer for avoid expand lsm to them
1903 awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do
1904 setfacl -m $acl $MOUNT2/widestripe
1908 stat $MOUNT/widestripe || return 12
1910 cleanup_46a $OSTCOUNT || { echo "cleanup_46a failed!" && return 13; }
1913 run_test 46a "handle ost additional - wide striped file"
1918 check_mount || return 2
1919 $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
1923 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1924 lrs=$(echo $ns | sed 's/.*lru_size=//')
1925 lru_size[count]=$lrs
1931 client_up || return 3
1934 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1935 lrs=$(echo $ns | sed 's/.*lru_size=//')
1936 if ! test "$lrs" -eq "${lru_size[count]}"; then
1937 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
1938 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
1946 run_test 47 "server restart does not make client loss lru_resize settings"
1951 # reformat after this test is needed - if test will failed
1952 # we will have unkillable file at FS
1956 test_48() { # bug 17636
1959 check_mount || return 2
1961 $LFS setstripe $MOUNT -c -1 || return 9
1962 $LFS getstripe $MOUNT || return 10
1964 echo "ok" > $MOUNT/widestripe
1965 $LFS getstripe $MOUNT/widestripe || return 11
1967 trap cleanup_48 EXIT ERR
1969 # fill acl buffer for avoid expand lsm to them
1970 getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
1971 setfacl -m $acl $MOUNT/widestripe
1974 stat $MOUNT/widestripe || return 12
1979 run_test 48 "too many acls on file"
1981 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
1982 test_49() { # bug 17710
1983 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
1984 local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
1985 local LOCAL_TIMEOUT=20
1987 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
1991 check_mount || return 1
1993 echo "check ldlm_timout..."
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 / 3)) ]; then
2003 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2006 umount_client $MOUNT
2007 stop_ost || return 2
2008 stop_mds || return 3
2010 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"
2014 check_mount || return 7
2016 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
2017 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
2018 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
2020 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
2021 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2024 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
2025 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2028 cleanup || return $?
2030 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
2031 OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
2033 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
2036 # Test both statfs and lfs df and fail if either one fails
2037 multiop_bg_pause $1 f_
2040 killall -USR1 multiop
2041 [ $RC1 -ne 0 ] && log "lazystatfs multiop failed"
2042 wait $PID || { RC1=$?; log "multiop return error "; }
2049 if [ $RC2 -eq 0 ]; then
2051 log "lazystatfs df failed"
2055 [[ $RC1 -ne 0 || $RC2 -eq 0 ]] && RC=1
2061 lctl set_param llite.$FSNAME-*.lazystatfs=1
2064 lazystatfs $MOUNT || error "lazystatfs failed but no down servers"
2066 cleanup || return $?
2068 run_test 50a "lazystatfs all servers available =========================="
2072 lctl set_param llite.$FSNAME-*.lazystatfs=1
2075 # Wait for client to detect down OST
2076 stop_ost || error "Unable to stop OST1"
2077 wait_osc_import_state mds ost DISCONN
2079 lazystatfs $MOUNT || error "lazystatfs should don't have returned EIO"
2081 umount_client $MOUNT || error "Unable to unmount client"
2082 stop_mds || error "Unable to stop MDS"
2084 run_test 50b "lazystatfs all servers down =========================="
2087 start_mds || error "Unable to start MDS"
2088 start_ost || error "Unable to start OST1"
2089 start_ost2 || error "Unable to start OST2"
2090 mount_client $MOUNT || error "Unable to mount client"
2091 lctl set_param llite.$FSNAME-*.lazystatfs=1
2094 # Wait for client to detect down OST
2095 stop_ost || error "Unable to stop OST1"
2096 wait_osc_import_state mds ost DISCONN
2097 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2099 umount_client $MOUNT || error "Unable to unmount client"
2100 stop_ost2 || error "Unable to stop OST2"
2101 stop_mds || error "Unable to stop MDS"
2103 run_test 50c "lazystatfs one server down =========================="
2106 start_mds || error "Unable to start MDS"
2107 start_ost || error "Unable to start OST1"
2108 start_ost2 || error "Unable to start OST2"
2109 mount_client $MOUNT || error "Unable to mount client"
2110 lctl set_param llite.$FSNAME-*.lazystatfs=1
2113 # Issue the statfs during the window where the client still
2114 # belives the OST to be available but it is in fact down.
2115 # No failure just a statfs which hangs for a timeout interval.
2116 stop_ost || error "Unable to stop OST1"
2117 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2119 umount_client $MOUNT || error "Unable to unmount client"
2120 stop_ost2 || error "Unable to stop OST2"
2121 stop_mds || error "Unable to stop MDS"
2123 run_test 50d "lazystatfs client/server conn race =========================="
2130 start_mds || return 1
2131 #first client should see only one ost
2132 start_ost || return 2
2133 wait_osc_import_state mds ost FULL
2135 # Wait for client to detect down OST
2136 stop_ost || error "Unable to stop OST1"
2137 wait_osc_import_state mds ost DISCONN
2139 mount_client $MOUNT || error "Unable to mount client"
2140 lctl set_param llite.$FSNAME-*.lazystatfs=0
2142 multiop_bg_pause $MOUNT _f
2146 if [ $RC1 -ne 0 ]; then
2147 log "lazystatfs multiop failed $RC1"
2150 sleep $(( $TIMEOUT+1 ))
2152 [ $? -ne 0 ] && error "process isn't sleep"
2153 start_ost || error "Unable to start OST1"
2154 wait $pid || error "statfs failed"
2157 umount_client $MOUNT || error "Unable to unmount client"
2158 stop_ost || error "Unable to stop OST1"
2159 stop_mds || error "Unable to stop MDS"
2161 run_test 50e "normal statfs all servers down =========================="
2166 CONN_PROC="osc.$FSNAME-OST0001-osc.ost_server_uuid"
2168 start_mds || error "Unable to start mds"
2169 #first client should see only one ost
2170 start_ost || error "Unable to start OST1"
2171 wait_osc_import_state mds ost FULL
2173 start_ost2 || error "Unable to start OST2"
2174 wait_osc_import_state mds ost2 FULL
2176 # Wait for client to detect down OST
2177 stop_ost2 || error "Unable to stop OST2"
2178 wait_osc_import_state mds ost2 DISCONN
2180 mount_client $MOUNT || error "Unable to mount client"
2181 lctl set_param llite.$FSNAME-*.lazystatfs=0
2183 multiop_bg_pause $MOUNT _f
2187 if [ $RC1 -ne 0 ]; then
2188 log "lazystatfs multiop failed $RC1"
2191 sleep $(( $TIMEOUT+1 ))
2193 [ $? -ne 0 ] && error "process isn't sleep"
2194 start_ost2 || error "Unable to start OST2"
2195 wait $pid || error "statfs failed"
2196 stop_ost2 || error "Unable to stop OST2"
2199 umount_client $MOUNT || error "Unable to unmount client"
2200 stop_ost || error "Unable to stop OST1"
2201 stop_mds || error "Unable to stop MDS"
2202 #writeconf to remove all ost2 traces for subsequent tests
2205 run_test 50f "normal statfs one server in down =========================="
2208 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
2210 start_ost2 || error "Unable to start OST2"
2211 wait_osc_import_state mds ost2 FULL
2212 wait_osc_import_state client ost2 FULL
2214 local PARAM="${FSNAME}-OST0001.osc.active"
2216 $LFS setstripe -c -1 $DIR/$tfile || error "Unable to lfs setstripe"
2217 do_facet mgs $LCTL conf_param $PARAM=0 || error "Unable to deactivate OST"
2219 umount_client $MOUNT || error "Unable to unmount client"
2220 mount_client $MOUNT || error "Unable to mount client"
2221 # This df should not cause a panic
2224 do_facet mgs $LCTL conf_param $PARAM=1 || error "Unable to activate OST"
2226 umount_client $MOUNT || error "Unable to unmount client"
2227 stop_ost2 || error "Unable to stop OST2"
2228 stop_ost || error "Unable to stop OST1"
2229 stop_mds || error "Unable to stop MDS"
2230 #writeconf to remove all ost2 traces for subsequent tests
2233 run_test 50g "deactivated OST should not cause panic====================="
2237 local max_ost_index=$1
2238 echo -n $(($max_ost_index * 8 + 8))
2242 local saved_opts=$OST_MKFS_OPTS
2244 for i in 0 1023 2048
2246 OST_MKFS_OPTS="$saved_opts --index $i"
2250 cp /etc/passwd $DIR/1
2254 cp /etc/passwd $DIR/2
2257 echo checking size of lov_objid for ost index $i
2258 local file_size=`do_facet mds \
2259 "$DEBUGFS -R 'stat lov_objid' $MDSDEV 2>/dev/null" | \
2260 grep ^User | awk '{print $6}'`
2261 if [ "$file_size" != $(lov_objid_size $i) ]; then
2262 error "lov_objid size has to be $(lov_objid_size $i), \
2265 echo ok, lov_objid size is correct: $file_size
2270 OST_MKFS_OPTS=$saved_opts
2273 run_test 55 "check lov_objid size"
2276 add mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=16\"' --reformat $MDSDEV
2277 add ost1 $OST_MKFS_OPTS --index=1000 --reformat `ostdevname 1`
2278 add ost2 $OST_MKFS_OPTS --index=10000 --reformat `ostdevname 2`
2282 start_ost2 || error "Unable to start second ost"
2283 mount_client $MOUNT || error "Unable to mount client"
2284 [ -n "$ENABLE_QUOTA" ] && { $LFS quotacheck -ug $MOUNT || error "quotacheck has failed" ; }
2289 run_test 56 "check big indexes"
2291 test_57() { # bug 22656
2292 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
2294 do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
2297 start_ost && error "OST registration from failnode should fail"
2300 run_test 57 "initial registration from failnode should fail (should return errs)"
2302 test_58() { # bug 22658
2303 [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
2306 createmany -o $DIR/$tdir/$tfile-%d 100
2307 # make sure that OSTs do not cancel llog cookies before we unmount the MDS
2308 #define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
2309 do_facet mds "lctl set_param fail_loc=0x601"
2310 unlinkmany $DIR/$tdir/$tfile-%d 100
2312 local MNTDIR=$(facet_mntpt mds)
2313 # remove all files from the OBJECTS dir
2314 do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
2315 do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
2316 do_facet mds "umount $MNTDIR"
2317 # restart MDS with missing llog files
2319 do_facet mds "lctl set_param fail_loc=0"
2322 run_test 58 "missing llog files must not prevent MDT from mounting"
2325 do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
2329 start_mgsmds >> /dev/null
2330 local C1=$(count_osts)
2331 if [ $C1 -eq 0 ]; then
2332 start_ost >> /dev/null
2336 echo "original ost count: $C1 (expect > 0)"
2337 [ $C1 -gt 0 ] || error "No OSTs in $FSNAME log"
2338 start_mgsmds -o writeconf >> /dev/null || error "MDT start failed"
2339 local C2=$(count_osts)
2340 echo "after mdt writeconf count: $C2 (expect 0)"
2341 [ $C2 -gt 0 ] && error "MDT writeconf should erase OST logs"
2342 echo "OST start without writeconf should fail:"
2343 start_ost >> /dev/null && error "OST start without writeconf didn't fail"
2344 echo "OST start with writeconf should succeed:"
2345 start_ost -o writeconf >> /dev/null || error "OST1 start failed"
2346 local C3=$(count_osts)
2347 echo "after ost writeconf count: $C3 (expect 1)"
2348 [ $C3 -eq 1 ] || error "new OST writeconf should add:"
2349 start_ost2 -o writeconf >> /dev/null || error "OST2 start failed"
2350 local C4=$(count_osts)
2351 echo "after ost2 writeconf count: $C4 (expect 2)"
2352 [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
2353 stop_ost2 >> /dev/null
2354 cleanup_nocli >> /dev/null
2356 run_test 59 "writeconf mount option"
2358 if ! combined_mgs_mds ; then
2362 complete $(basename $0) $SECONDS