2 # -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
3 # vim:autoindent:shiftwidth=4:tabstop=4:
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:
16 ALWAYS_EXCEPT=" 39 $CONF_SANITY_EXCEPT"
17 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
20 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
22 PTLDEBUG=${PTLDEBUG:--1}
24 LUSTRE=${LUSTRE:-`dirname $0`/..}
25 RLUSTRE=${RLUSTRE:-$LUSTRE}
27 . $LUSTRE/tests/test-framework.sh
29 # STORED_MDSSIZE is used in test_18
30 if [ -n "$MDSSIZE" ]; then
31 STORED_MDSSIZE=$MDSSIZE
33 # use small MDS + OST size to speed formatting time
36 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
38 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
39 remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
42 [ "$SLOW" = "no" ] && EXCEPT_SLOW="0 1 2 3 6 7 15 18 24b 25 30 31 32 33 34a 45"
51 local facet=$SINGLEMDS
52 local dev=${facet}_dev
56 # who knows if/where $TUNEFS is installed? Better reformat if it fails...
57 do_facet ${facet} "$TUNEFS --writeconf ${!dev}" || echo "tunefs failed, reformatting instead" && reformat
63 # The MGS must be started before the OSTs for a new fs, so start
64 # and stop to generate the startup logs.
67 wait_osc_import_state mds ost FULL
72 reformat_and_config() {
78 local facet=$SINGLEMDS
79 # we can not use MDSDEV1 here because SINGLEMDS could be set not to mds1 only
80 local num=$(echo $facet | tr -d "mds")
81 local dev=$(mdsdevname $num)
82 echo "start mds service on `facet_active_host $facet`"
83 start $facet ${dev} $MDS_MOUNT_OPTS || return 94
87 echo "stop mds service on `facet_active_host $SINGLEMDS`"
88 # These tests all use non-failover stop
89 stop $SINGLEMDS -f || return 97
93 echo "start ost1 service on `facet_active_host ost1`"
94 start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
98 echo "stop ost1 service on `facet_active_host ost1`"
99 # These tests all use non-failover stop
100 stop ost1 -f || return 98
104 echo "start ost2 service on `facet_active_host ost2`"
105 start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
109 echo "stop ost2 service on `facet_active_host ost2`"
110 # These tests all use non-failover stop
111 stop ost2 -f || return 93
116 echo "mount $FSNAME on ${MOUNTPATH}....."
117 zconf_mount `hostname` $MOUNTPATH || return 96
121 local SAVEMOUNTOPT=$MOUNTOPT
122 MOUNTOPT="remount,$1"
124 echo "remount '$1' lustre on ${MOUNTPATH}....."
125 zconf_mount `hostname` $MOUNTPATH || return 96
126 MOUNTOPT=$SAVEMOUNTOPT
131 echo "umount lustre on ${MOUNTPATH}....."
132 zconf_umount `hostname` $MOUNTPATH || return 97
135 manual_umount_client(){
138 echo "manual umount lustre on ${MOUNT}...."
139 do_facet client "umount -d ${FORCE} $MOUNT"
157 stop_mds || return 201
158 stop_ost || return 202
159 unload_modules || return 203
163 umount_client $MOUNT || return 200
164 cleanup_nocli || return $?
168 do_facet client "cp /etc/passwd $DIR/a" || return 71
169 do_facet client "rm $DIR/a" || return 72
170 # make sure lustre is actually mounted (touch will block,
171 # but grep won't, so do it after)
172 do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
173 echo "setup single mount lustre success"
177 do_facet client "touch $DIR/a" || return 71
178 do_facet client "rm $DIR/a" || return 72
179 do_facet client "touch $DIR2/a" || return 73
180 do_facet client "rm $DIR2/a" || return 74
181 echo "setup double mount lustre success"
186 if [ "$ONLY" == "setup" ]; then
191 if [ "$ONLY" == "cleanup" ]; then
198 #create single point mountpoint
204 check_mount || return 41
207 run_test 0 "single mount setup"
211 echo "start ost second time..."
213 check_mount || return 42
216 run_test 1 "start up ost twice (should return errors)"
221 echo "start mds second time.."
224 check_mount || return 43
227 run_test 2 "start up mds twice (should return err)"
231 #mount.lustre returns an error if already in mtab
232 mount_client $MOUNT && return $?
233 check_mount || return 44
236 run_test 3 "mount client twice (should return err)"
240 touch $DIR/$tfile || return 85
244 # ok for ost to fail shutdown
245 if [ 202 -ne $eno ]; then
250 run_test 4 "force cleanup ost, then cleanup"
252 test_5a() { # was test_5
254 touch $DIR/$tfile || return 1
255 fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
257 stop_mds -f || return 2
259 # cleanup may return an error from the failed
260 # disconnects; for now I'll consider this successful
261 # if all the modules have unloaded.
265 echo "killing umount"
266 kill -TERM $UMOUNT_PID
267 echo "waiting for umount to finish"
269 if grep " $MOUNT " /proc/mounts; then
270 echo "test 5: /proc/mounts after failed umount"
274 echo "killing umount"
275 kill -TERM $UMOUNT_PID
276 echo "waiting for umount to finish"
278 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
282 # stop_mds is a no-op here, and should not fail
283 cleanup_nocli || return $?
284 # df may have lingering entry
286 # mtab may have lingering entry
290 while [ "$WAIT" -ne "$MAX_WAIT" ]; do
292 grep -q $MOUNT" " /etc/mtab || break
293 echo "Waiting /etc/mtab updated ... "
294 WAIT=$(( WAIT + sleep))
296 [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
297 echo "/etc/mtab updated in $WAIT secs"
299 run_test 5a "force cleanup mds, then cleanup"
303 [ -d $MOUNT ] || mkdir -p $MOUNT
304 grep " $MOUNT " /etc/mtab && echo "test 5b: mtab before mount" && return 10
305 mount_client $MOUNT && return 1
306 grep " $MOUNT " /etc/mtab && echo "test 5b: mtab after failed mount" && return 11
308 # stop_mds is a no-op here, and should not fail
309 cleanup_nocli || return $?
312 run_test 5b "mds down, cleanup after failed mount (bug 2712) (should return errs)"
317 [ -d $MOUNT ] || mkdir -p $MOUNT
318 grep " $MOUNT " /etc/mtab && echo "test 5c: mtab before mount" && return 10
319 local oldfs="${FSNAME}"
320 FSNAME="wrong.${FSNAME}"
321 mount_client $MOUNT || :
323 grep " $MOUNT " /etc/mtab && echo "test 5c: mtab after failed mount" && return 11
325 cleanup_nocli || return $?
327 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
333 grep " $MOUNT " /etc/mtab && echo "test 5d: mtab before mount" && return 10
334 mount_client $MOUNT || return 1
336 grep " $MOUNT " /etc/mtab && echo "test 5d: mtab after unmount" && return 11
339 run_test 5d "mount with ost down"
345 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
346 do_facet client "lctl set_param fail_loc=0x80000506"
347 grep " $MOUNT " /etc/mtab && echo "test 5e: mtab before mount" && return 10
348 mount_client $MOUNT || echo "mount failed (not fatal)"
350 grep " $MOUNT " /etc/mtab && echo "test 5e: mtab after unmount" && return 11
353 run_test 5e "delayed connect, don't crash (bug 10268)"
358 mount_client ${MOUNT} || return 87
359 touch $DIR/a || return 86
362 run_test 6 "manual umount, then mount again"
367 cleanup_nocli || return $?
369 run_test 7 "manual umount, then cleanup"
374 check_mount2 || return 45
375 umount_client $MOUNT2
378 run_test 8 "double mount setup"
383 do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
384 do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
386 CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
387 if [ "$CHECK_PTLDEBUG" ] && { \
388 [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ] ||
389 [ "$CHECK_PTLDEBUG" = "trace inode" ]; }; then
390 echo "lnet.debug success"
392 echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
395 CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
396 if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
397 echo "lnet.subsystem_debug success"
399 echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
402 stop_ost || return $?
405 run_test 9 "test ptldebug and subsystem for mkfs"
407 # LOGS/PENDING do not exist anymore since CMD3
409 local TMPMTPT="${TMP}/conf16"
410 local dev=${SINGLEMDS}_dev
412 if [ ! -e "$MDSDEV" ]; then
413 log "no $MDSDEV existing, so mount Lustre to create one"
415 check_mount || return 41
419 [ -f "$MDSDEV" ] && LOOPOPT="-o loop"
421 log "change the mode of $MDSDEV/OBJECTS to 555"
422 do_facet $SINGLEMDS "mkdir -p $TMPMTPT &&
423 mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
424 chmod 555 $TMPMTPT/OBJECTS &&
425 umount $TMPMTPT" || return $?
427 log "mount Lustre to change the mode of OBJECTS, then umount Lustre"
429 check_mount || return 41
432 log "read the mode of OBJECTS and check if they has been changed properly"
433 EXPECTEDOBJECTSMODE=`do_facet $SINGLEMDS "$DEBUGFS -R 'stat OBJECTS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
435 if [ "$EXPECTEDOBJECTSMODE" = "0777" ]; then
436 log "Success:Lustre change the mode of OBJECTS correctly"
438 error "Lustre does not change mode of OBJECTS properly"
441 run_test 16 "verify that lustre will correct the mode of OBJECTS"
444 local dev=${SINGLEMDS}_dev
447 if [ ! -e "$MDSDEV" ]; then
448 echo "no $MDSDEV existing, so mount Lustre to create one"
450 check_mount || return 41
454 echo "Remove mds config log"
455 do_facet $SINGLEMDS "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MDSDEV || return \$?" || return $?
458 start_mds && return 42
461 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
464 [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return
466 local dev=${SINGLEMDS}_dev
472 # check if current MDSSIZE is large enough
473 [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
474 log "use MDSSIZE=$MDSSIZE"
476 # check if the global config has a large enough MDSSIZE
477 [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
478 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
479 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
481 # check if the block device is large enough
482 [ -z "$OK" -a -b $MDSDEV ] && \
483 [ "$(dd if=$MDSDEV of=/dev/null bs=1k count=1 skip=$MIN 2>&1 |
484 awk '($3 == "in") { print $1 }')" = "1+0" ] && OK=1 && \
485 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
487 # check if a loopback device has enough space for fs metadata (5%)
488 [ -z "$OK" ] && [ -f $MDSDEV -o ! -e $MDSDEV ] &&
489 SPACE=$(df -P $(dirname $MDSDEV) |
490 awk '($1 != "Filesystem") {print $4}') &&
491 [ $SPACE -gt $((MIN / 20)) ] && OK=1 && myMDSSIZE=$MIN && \
492 log "use file $MDSDEV with MIN=$MIN"
494 [ -z "$OK" ] && skip_env "$MDSDEV too small for ${MIN}kB MDS" && return
497 echo "mount mds with large journal..."
498 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
500 MDS_MKFS_OPTS="--mgs --mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
503 echo "mount lustre system..."
505 check_mount || return 41
507 echo "check journal size..."
508 local FOUNDSIZE=`do_facet mds "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}'`
509 if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
510 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
512 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
517 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
520 run_test 18 "check mkfs creates large journals"
523 start_mds || return 1
524 stop_mds -f || return 2
526 run_test 19a "start/stop MDS without OSTs"
529 start_ost || return 1
530 stop_ost -f || return 2
532 run_test 19b "start/stop OSTs without MDS"
535 # first format the ost/mdt
539 check_mount || return 43
541 remount_client ro $MOUNT || return 44
542 touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
543 [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
544 remount_client rw $MOUNT || return 47
546 [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
547 MCNT=`grep -c $MOUNT /etc/mtab`
548 [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
553 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
558 wait_osc_import_state mds ost FULL
562 run_test 21a "start mds before ost, stop ost first"
567 wait_osc_import_state mds ost FULL
571 run_test 21b "start ost before mds, stop mds first"
577 wait_osc_import_state mds ost2 FULL
581 #writeconf to remove all ost2 traces for subsequent tests
584 run_test 21c "start mds between two osts, stop mds last"
589 echo Client mount with ost in logs, but none running
591 # wait until mds connected to ost and open client connection
592 wait_osc_import_state mds ost FULL
595 # check_mount will block trying to contact ost
596 mcreate $DIR/$tfile || return 40
597 rm -f $DIR/$tfile || return 42
601 echo Client mount with a running ost
604 # if gss enabled, wait full time to let connection from
605 # mds to ost be established, due to the mismatch between
606 # initial connect timeout and gss context negotiation timeout.
607 # This perhaps could be remove after AT landed.
608 echo "sleep $((TIMEOUT + TIMEOUT + TIMEOUT))s"
609 sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
612 check_mount || return 41
617 run_test 22 "start a client before osts (should return errs)"
619 test_23a() { # was test_23
623 # force down client so that recovering mds waits for reconnect
624 local running=$(grep -c $MOUNT /proc/mounts) || true
625 if [ $running -ne 0 ]; then
626 echo "Stopping client $MOUNT (opts: -f)"
630 # enter recovery on mds
632 # try to start a new client
633 mount_client $MOUNT &
635 MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
636 MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
637 echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
639 ps --ppid $MOUNT_LUSTRE_PID
640 # FIXME why o why can't I kill these? Manual "ctrl-c" works...
641 kill -TERM $MOUNT_LUSTRE_PID
642 echo "waiting for mount to finish"
644 # we can not wait $MOUNT_PID because it is not a child of this shell
650 while [ "$WAIT" -lt "$MAX_WAIT" ]; do
652 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
653 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
656 [ -z "$PID1" -a -z "$PID2" ] && break
657 echo "waiting for mount to finish ... "
658 WAIT=$(( WAIT + sleep))
660 [ "$WAIT" -eq "$MAX_WAIT" ] && error "MOUNT_PID $MOUNT_PID and "\
661 "MOUNT_LUSTRE_PID $MOUNT_LUSTRE_PID still not killed in $WAIT secs"
666 run_test 23a "interrupt client during recovery mount delay"
671 test_23b() { # was test_23
674 # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
675 lctl set_param fail_loc=0x80000313
679 run_test 23b "Simulate -EINTR during mount"
681 fs2mds_HOST=$mds_HOST
682 fs2ost_HOST=$ost_HOST
686 echo "umount $MOUNT2 ..."
687 umount $MOUNT2 || true
688 echo "stopping fs2mds ..."
689 stop fs2mds -f || true
690 echo "stopping fs2ost ..."
691 stop fs2ost -f || true
698 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
699 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
700 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
701 skip_env "mixed loopback and real device not working" && return
704 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
705 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
707 # test 8-char fsname as well
708 local FSNAME2=test1234
709 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
711 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
714 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
715 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
717 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
719 check_mount || return 2
720 # files written on 1 should not show up on 2
721 cp /etc/passwd $DIR/$tfile
723 [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
726 cp /etc/passwd $MOUNT2/b || return 3
727 rm $MOUNT2/b || return 4
728 # 2 is actually mounted
729 grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
731 facet_failover fs2mds
732 facet_failover fs2ost
735 # the MDS must remain up until last MDT
737 MDS=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
738 [ -z "$MDS" ] && error "No MDT" && return 8
740 cleanup_nocli || return 6
742 run_test 24a "Multiple MDTs on a single node"
745 if [ -z "$fs2mds_DEV" ]; then
746 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
747 skip_env "mixed loopback and real device not working" && return
750 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
752 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10
754 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
757 run_test 24b "Multiple MGSs on a single node (should return err)"
761 check_mount || return 2
762 local MODULES=$($LCTL modules | awk '{ print $2 }')
763 rmmod $MODULES 2>/dev/null || true
766 run_test 25 "Verify modules are referenced"
770 # we need modules before mount for sysctl, so make sure...
771 do_facet $SINGLEMDS "lsmod | grep -q lustre || modprobe lustre"
772 #define OBD_FAIL_MDS_FS_SETUP 0x135
773 do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000135"
774 start_mds && echo MDS started && return 1
775 lctl get_param -n devices
776 DEVS=$(lctl get_param -n devices | wc -l)
777 [ $DEVS -gt 0 ] && return 2
778 unload_modules || return 203
780 run_test 26 "MDT startup failure cleans LOV (should return errs)"
786 local ORIG=$(do_facet $myfacet "$TEST")
787 if [ $# -gt 3 ]; then
793 echo "Setting $PARAM from $ORIG to $FINAL"
794 do_facet $SINGLEMDS "$LCTL conf_param $PARAM='$FINAL'" || error conf_param failed
796 wait_update $(facet_host $myfacet) "$TEST" "$FINAL" || error check failed!
800 start_ost || return 1
801 start_mds || return 2
802 echo "Requeue thread should have started: "
803 ps -e | grep ll_cfg_requeue
804 set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
807 run_test 27a "Reacquire MGS lock if OST started first"
812 local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
814 facet_failover $SINGLEMDS
815 set_and_check $SINGLEMDS "lctl get_param -n mdt.$device.identity_acquire_expire" "$device.mdt.identity_acquire_expire" || return 3
816 set_and_check client "lctl get_param -n mdc.$device-mdc-*.max_rpcs_in_flight" "$device.mdc.max_rpcs_in_flight" || return 4
820 run_test 27b "Reacquire MGS lock after failover"
824 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
825 PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
828 set_and_check client "$TEST" "$PARAM" $FINAL || return 3
829 FINAL=$(($FINAL + 1))
830 set_and_check client "$TEST" "$PARAM" $FINAL || return 4
831 umount_client $MOUNT || return 200
834 if [ $RESULT -ne $FINAL ]; then
835 echo "New config not seen: wanted $FINAL got $RESULT"
838 echo "New config success: got $RESULT"
840 set_and_check client "$TEST" "$PARAM" $ORIG || return 5
843 run_test 28 "permanent parameter setting"
846 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
847 setup > /dev/null 2>&1
851 local PARAM="$FSNAME-OST0001.osc.active"
852 local PROC_ACT="osc.$FSNAME-OST0001-osc-[^M]*.active"
853 local PROC_UUID="osc.$FSNAME-OST0001-osc-[^M]*.ost_server_uuid"
855 ACTV=$(lctl get_param -n $PROC_ACT)
857 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
858 # also check ost_server_uuid status
859 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
860 if [ -z "$RESULT" ]; then
861 echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
864 echo "Live client success: got $RESULT"
868 local MPROC="osc.$FSNAME-OST0001-osc-[M]*.active"
873 RESULT=`do_facet $SINGLEMDS " lctl get_param -n $MPROC"`
874 [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
875 if [ $RESULT -eq $DEAC ]; then
876 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
880 if [ $WAIT -eq $MAX ]; then
881 echo "MDT not deactivated: wanted $DEAC got $RESULT"
884 echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
887 # test new client starts deactivated
888 umount_client $MOUNT || return 200
890 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
891 if [ -z "$RESULT" ]; then
892 echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
895 echo "New client success: got $RESULT"
898 # make sure it reactivates
899 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
904 #writeconf to remove all ost2 traces for subsequent tests
907 run_test 29 "permanently remove an OST"
912 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
914 LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
915 for i in ${LIST[@]}; do
916 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
918 # make sure client restart still works
920 mount_client $MOUNT || return 4
921 [ "$($TEST)" -ne "$i" ] && return 5
922 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $ORIG || return 6
925 run_test 30 "Big config llog"
927 test_31() { # bug 10734
928 # ipaddr must not exist
929 mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
932 run_test 31 "Connect to non-existent node (shouldn't crash)"
934 # Use these start32/stop32 fn instead of t-f start/stop fn,
935 # for local devices, to skip global facet vars init
939 echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
940 umount -d $@ ${MOUNT%/*}/${facet}
949 mkdir -p ${MOUNT%/*}/${facet}
951 echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
952 mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
954 if [ $RC -ne 0 ]; then
955 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
956 echo "Start of ${device} of local ${facet} failed ${RC}"
970 echo "Cleanup test_32 umount $MOUNT ..."
971 umount -f $MOUNT || true
972 echo "Cleanup local mds ost1 ..."
978 client_only && skip "client only testing" && return 0
979 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
980 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
982 local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
983 [ ! -r $DISK1_8 ] && skip_env "Cannot find $DISK1_8" && return 0
984 local tmpdir=$TMP/conf32a
986 tar xjvf $DISK1_8 -C $tmpdir || \
987 { skip_env "Cannot untar $DISK1_8" && return 0; }
990 $LCTL set_param debug=$PTLDEBUG
992 $TUNEFS $tmpdir/mds || error "tunefs failed"
994 # nids are wrong, so client wont work, but server should start
995 start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
996 trap cleanup_32 EXIT INT || return 3
998 local UUID=$($LCTL get_param -n mdt.lustre-MDT0000.uuid)
1000 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1002 $TUNEFS --mgsnode=$HOSTNAME $tmpdir/ost1 || error "tunefs failed"
1003 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1004 UUID=$($LCTL get_param -n obdfilter.lustre-OST0000.uuid)
1006 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1008 local NID=$($LCTL list_nids | head -1)
1010 echo "OSC changes should succeed:"
1011 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1012 $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1015 echo "MDC changes should succeed:"
1016 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1017 $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1020 echo "LOV changes should succeed:"
1021 $LCTL pool_new lustre.interop || return 11
1022 $LCTL conf_param lustre-MDT0000.lov.stripesize=4M || return 12
1027 # mount a second time to make sure we didnt leave upgrade flag on
1029 $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1030 start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1031 trap cleanup_32 EXIT INT || return 12
1035 rm -rf $tmpdir || true # true is only for TMP on NFS
1037 run_test 32a "Upgrade from 1.8 (not live)"
1040 client_only && skip "client only testing" && return 0
1041 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1042 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return
1044 local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
1045 [ ! -r $DISK1_8 ] && skip_env "Cannot find $DISK1_8" && return 0
1046 local tmpdir=$TMP/conf32b
1048 tar xjvf $DISK1_8 -C $tmpdir || \
1049 { skip_env "Cannot untar $DISK1_8" && return ; }
1052 $LCTL set_param debug="config"
1053 local NEWNAME=lustre
1055 # writeconf will cause servers to register with their current nids
1056 $TUNEFS --writeconf --fsname=$NEWNAME $tmpdir/mds || error "tunefs failed"
1057 start32 mds1 $tmpdir/mds "-o loop" && \
1058 trap cleanup_32 EXIT INT || return 3
1060 local UUID=$($LCTL get_param -n mdt.${NEWNAME}-MDT0000.uuid)
1062 [ "$UUID" == "${NEWNAME}-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1064 $TUNEFS --mgsnode=$HOSTNAME --writeconf --fsname=$NEWNAME $tmpdir/ost1 ||\
1065 error "tunefs failed"
1066 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1067 UUID=$($LCTL get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
1069 [ "$UUID" == "${NEWNAME}-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1071 local NID=$($LCTL list_nids | head -1)
1073 echo "OSC changes should succeed:"
1074 $LCTL conf_param ${NEWNAME}-OST0000.osc.max_dirty_mb=15 || return 7
1075 $LCTL conf_param ${NEWNAME}-OST0000.failover.node=$NID || return 8
1078 echo "MDC changes should succeed:"
1079 $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1080 $LCTL conf_param ${NEWNAME}-MDT0000.failover.node=$NID || return 10
1083 echo "LOV changes should succeed:"
1084 $LCTL pool_new ${NEWNAME}.interop || return 11
1085 $LCTL conf_param ${NEWNAME}-MDT0000.lov.stripesize=4M || return 12
1088 # MDT and OST should have registered with new nids, so we should have
1089 # a fully-functioning client
1090 echo "Check client and old fs contents"
1092 local device=`h2$NETTYPE $HOSTNAME`:/$NEWNAME
1093 echo "Starting local client: $HOSTNAME: $device $MOUNT"
1094 mount -t lustre $device $MOUNT || return 1
1096 local old=$($LCTL get_param -n mdc.*.max_rpcs_in_flight)
1097 local new=$((old + 5))
1098 $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=$new
1099 wait_update $HOSTNAME "$LCTL get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1101 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "94306271 1478" ] || return 12
1106 rm -rf $tmpdir || true # true is only for TMP on NFS
1108 run_test 32b "Upgrade from 1.8 with writeconf"
1110 test_33a() { # bug 12333, was test_33
1112 local FSNAME2=test-123
1113 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1115 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1116 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
1117 skip_env "mixed loopback and real device not working" && return
1120 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1121 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1122 add fs2mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=8\"' --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1123 add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1125 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1126 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1127 do_facet $SINGLEMDS "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1129 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1132 cp /etc/hosts $MOUNT2/ || rc=3
1133 $LFS getstripe $MOUNT2/hosts
1138 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1139 cleanup_nocli || rc=6
1142 run_test 33a "Mount ost with a large index number"
1144 test_33b() { # was test_34
1147 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1148 # Drop lock cancelation reply during umount
1149 #define OBD_FAIL_LDLM_CANCEL 0x304
1150 do_facet client lctl set_param fail_loc=0x80000304
1151 #lctl set_param debug=-1
1152 umount_client $MOUNT
1155 run_test 33b "Drop cancel during umount"
1159 do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1160 manual_umount_client
1162 do_facet client killall -USR1 multiop
1163 if [ $rc -eq 0 ]; then
1164 error "umount not fail!"
1169 run_test 34a "umount with opened file should be fail"
1174 touch $DIR/$tfile || return 1
1175 stop_mds --force || return 2
1177 manual_umount_client --force
1179 if [ $rc -ne 0 ]; then
1180 error "mtab after failed umount - rc $rc"
1186 run_test 34b "force umount with failed mds should be normal"
1190 touch $DIR/$tfile || return 1
1191 stop_ost --force || return 2
1193 manual_umount_client --force
1195 if [ $rc -ne 0 ]; then
1196 error "mtab after failed umount - rc $rc"
1202 run_test 34c "force umount with failed ost should be normal"
1204 test_35a() { # bug 12459
1207 DBG_SAVE="`lctl get_param -n debug`"
1208 lctl set_param debug="ha"
1210 log "Set up a fake failnode for the MDS"
1212 local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
1213 do_facet $SINGLEMDS $LCTL conf_param ${device}.failover.node=$FAKENID || return 4
1215 log "Wait for RECONNECT_INTERVAL seconds (10s)"
1218 MSG="conf-sanity.sh test_35a `date +%F%kh%Mm%Ss`"
1221 log "Stopping the MDT:"
1222 stop_mds || return 5
1224 df $MOUNT > /dev/null 2>&1 &
1226 log "Restarting the MDT:"
1227 start_mds || return 6
1228 log "Wait for df ($DFPID) ... "
1231 lctl set_param debug="$DBG_SAVE"
1233 # retrieve from the log the first server that the client tried to
1234 # contact after the connection loss
1235 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1236 NEXTCONN=`awk "/${MSG}/ {start = 1;}
1237 /import_select_connection.*$device-mdc.* using connection/ {
1239 if (\\\$NF ~ /$FAKENID/)
1245 }" $TMP/lustre-log-$TESTNAME.log`
1246 [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1249 run_test 35a "Reconnect to the last active server first"
1251 test_35b() { # bug 18674
1252 remote_mds || { skip "local MDS" && return 0; }
1256 $LCTL set_param debug="ha"
1258 MSG="conf-sanity.sh test_35b `date +%F%kh%Mm%Ss`"
1261 log "Set up a fake failnode for the MDS"
1263 local device=$(do_facet mds "$LCTL get_param -n devices" | \
1264 awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
1265 do_facet mds "$LCTL conf_param ${device}.failover.node=$FAKENID" || \
1268 local at_max_saved=0
1269 # adaptive timeouts may prevent seeing the issue
1270 if at_is_enabled; then
1271 at_max_saved=$(at_max_get mds)
1272 at_max_set 0 mds client
1275 mkdir -p $MOUNT/testdir
1276 touch $MOUNT/testdir/test
1278 log "Injecting EBUSY on MDS"
1279 # Setting OBD_FAIL_MDS_RESEND=0x136
1280 do_facet mds "$LCTL set_param fail_loc=0x80000136" || return 2
1282 log "Stat on a test file"
1283 stat $MOUNT/testdir/test
1285 log "Stop injecting EBUSY on MDS"
1286 do_facet mds "$LCTL set_param fail_loc=0" || return 3
1287 rm -f $MOUNT/testdir/test
1290 # restore adaptive timeout
1291 [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds client
1293 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1295 # retrieve from the log if the client has ever tried to
1296 # contact the fake server after the loss of connection
1297 FAILCONN=`awk "BEGIN {ret = 0;}
1298 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1300 if (\\\$NF ~ /$FAKENID/) {
1305 END {print ret}" $TMP/lustre-log-$TESTNAME.log`
1307 [ "$FAILCONN" == "0" ] && \
1308 log "ERROR: The client reconnection has not been triggered" && \
1310 [ "$FAILCONN" == "2" ] && \
1311 log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
1316 run_test 35b "Continue reconnection retries, if the active server is busy"
1320 local FSNAME2=test1234
1321 local fs3ost_HOST=$ost_HOST
1323 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1326 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1327 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
1328 skip_env "mixed loopback and real device not working" && return
1330 [ $OSTCOUNT -lt 2 ] && skip_env "skipping test for single OST" && return
1332 [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1333 { skip "remote OST" && return 0; }
1335 local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1336 local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1337 local fs3ostdev=${fs3ost_DEV:-$(ostdevname 2)_2}
1338 add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1339 # XXX after we support non 4K disk blocksize, change following --mkfsoptions with
1341 add fs2ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1342 add fs3ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs3ostdev || exit 10
1344 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1345 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1346 start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1348 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1350 sleep 5 # until 11778 fixed
1352 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1354 BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1355 BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1356 BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1357 STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1358 DFTOTAL=`echo $STRING | cut -d, -f1`
1359 DFUSED=`echo $STRING | cut -d, -f2`
1360 DFAVAIL=`echo $STRING | cut -d, -f3`
1361 DFFREE=$(($DFTOTAL - $DFUSED))
1363 ALLOWANCE=$((64 * $OSTCOUNT))
1365 if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||
1366 [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1367 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1370 if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] ||
1371 [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1372 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1375 if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] ||
1376 [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1377 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1382 stop fs3ost -f || return 200
1383 stop fs2ost -f || return 201
1384 stop fs2mds -f || return 202
1385 rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev $fs3ostdev
1386 unload_modules || return 203
1389 run_test 36 "df report consistency on OSTs with different block size"
1392 client_only && skip "client only testing" && return 0
1393 LOCAL_MDSDEV="$TMP/mdt.img"
1394 SYM_MDSDEV="$TMP/sym_mdt.img"
1396 echo "MDS : $LOCAL_MDSDEV"
1397 echo "SYMLINK : $SYM_MDSDEV"
1401 mkfs.lustre --reformat --fsname=lustre --mdt --mgs --device-size=9000 $LOCAL_MDSDEV ||
1402 error "mkfs.lustre $LOCAL_MDSDEV failed"
1403 ln -s $LOCAL_MDSDEV $SYM_MDSDEV
1405 echo "mount symlink device - $SYM_MDSDEV"
1407 mount_op=`mount -v -t lustre -o loop $SYM_MDSDEV ${MOUNT%/*}/mds 2>&1 | grep "unable to set tunable"`
1408 umount -d ${MOUNT%/*}/mds
1409 rm -f $LOCAL_MDSDEV $SYM_MDSDEV
1411 if [ -n "$mount_op" ]; then
1412 error "**** FAIL: set tunables failed for symlink device"
1416 run_test 37 "verify set tunables works for symlink device"
1418 test_38() { # bug 14222
1423 FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1424 log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1426 tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1427 error "copying $SRC to $DIR/$tdir"
1429 umount_client $MOUNT
1431 log "rename lov_objid file on MDS"
1432 rm -f $TMP/lov_objid.orig
1434 local dev=${SINGLEMDS}_dev
1435 local MDSDEV=${!dev}
1436 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1437 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1439 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.orig"
1440 # check create in mds_lov_connect
1444 [ $V ] && log "verifying $DIR/$tdir/$f"
1445 diff -q $f $DIR/$tdir/$f || ERROR=y
1447 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
1448 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new"
1449 [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1451 # check it's updates in sync
1452 umount_client $MOUNT
1455 do_facet $SINGLEMDS dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1456 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1457 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1462 [ $V ] && log "verifying $DIR/$tdir/$f"
1463 diff -q $f $DIR/$tdir/$f || ERROR=y
1465 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1466 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new1"
1467 umount_client $MOUNT
1469 [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1471 log "files compared the same"
1474 run_test 38 "MDS recreates missing lov_objid file from OST data"
1480 perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' &&
1481 error "memory leak detected" || true
1483 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1485 test_40() { # bug 15759
1487 #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706
1488 do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000706"
1492 run_test 40 "race during service thread startup"
1494 test_41() { #bug 14134
1496 local dev=${SINGLEMDS}_dev
1497 local MDSDEV=${!dev}
1499 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1500 start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1501 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1503 mount_client $MOUNT || return 1
1506 echo "blah blah" > $MOUNT/$tfile
1509 umount_client $MOUNT
1510 stop ost1 -f || return 201
1511 stop_mds -f || return 202
1512 stop_mds -f || return 203
1513 unload_modules || return 204
1516 run_test 41 "mount mds with --nosvc and --nomgs"
1518 test_42() { #bug 14693
1520 check_mount || return 2
1521 do_facet client lctl conf_param lustre.llite.some_wrong_param=10
1522 umount_client $MOUNT
1523 mount_client $MOUNT || return 1
1527 run_test 42 "invalid config param should not prevent client from mounting"
1530 [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"
1532 chmod ugo+x $DIR || error "chmod 0 failed"
1534 "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
1535 "$FSNAME.mdt.root_squash" \
1538 "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1539 "$FSNAME.mdt.nosquash_nids" \
1543 # create set of test files
1545 echo "111" > $DIR/$tfile-userfile || error "write 1 failed"
1546 chmod go-rw $DIR/$tfile-userfile || error "chmod 1 failed"
1547 chown $RUNAS_ID.$RUNAS_ID $DIR/$tfile-userfile || error "chown failed"
1549 echo "222" > $DIR/$tfile-rootfile || error "write 2 failed"
1550 chmod go-rw $DIR/$tfile-rootfile || error "chmod 2 faield"
1552 mkdir $DIR/$tdir-rootdir -p || error "mkdir failed"
1553 chmod go-rwx $DIR/$tdir-rootdir || error "chmod 3 failed"
1554 touch $DIR/$tdir-rootdir/tfile-1 || error "touch failed"
1557 # check root_squash:
1558 # set root squash UID:GID to RUNAS_ID
1559 # root should be able to access only files owned by RUNAS_ID
1562 "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
1563 "$FSNAME.mdt.root_squash" \
1564 "$RUNAS_ID:$RUNAS_ID"
1566 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-userfile)
1567 dd if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1568 error "$ST: root read permission is denied"
1569 echo "$ST: root read permission is granted - ok"
1572 dd conv=notrunc if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1573 error "$ST: root write permission is denied"
1574 echo "$ST: root write permission is granted - ok"
1576 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1577 dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1578 error "$ST: root read permission is granted"
1579 echo "$ST: root read permission is denied - ok"
1582 dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1583 error "$ST: root write permission is granted"
1584 echo "$ST: root write permission is denied - ok"
1586 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1587 rm $DIR/$tdir-rootdir/tfile-1 1>/dev/null 2>/dev/null && \
1588 error "$ST: root unlink permission is granted"
1589 echo "$ST: root unlink permission is denied - ok"
1591 touch $DIR/tdir-rootdir/tfile-2 1>/dev/null 2>/dev/null && \
1592 error "$ST: root create permission is granted"
1593 echo "$ST: root create permission is denied - ok"
1596 # check nosquash_nids:
1597 # put client's NID into nosquash_nids list,
1598 # root should be able to access root file after that
1600 local NIDLIST=$(lctl list_nids all | tr '\n' ' ')
1601 NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
1602 NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
1604 "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1605 "$FSNAME-MDTall.mdt.nosquash_nids" \
1608 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1609 dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1610 error "$ST: root read permission is denied"
1611 echo "$ST: root read permission is granted - ok"
1614 dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1615 error "$ST: root write permission is denied"
1616 echo "$ST: root write permission is granted - ok"
1618 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1619 rm $DIR/$tdir-rootdir/tfile-1 || \
1620 error "$ST: root unlink permission is denied"
1621 echo "$ST: root unlink permission is granted - ok"
1622 touch $DIR/$tdir-rootdir/tfile-2 || \
1623 error "$ST: root create permission is denied"
1624 echo "$ST: root create permission is granted - ok"
1628 run_test 43 "check root_squash and nosquash_nids"
1630 umount_client $MOUNT
1635 check_mount || return 2
1636 UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
1638 UUIDS=$(do_facet mds "$LCTL get_param mdt.${FSNAME}*.exports.*.uuid")
1639 for VAL in $UUIDS; do
1640 NID=$(echo $VAL | cut -d= -f1)
1641 CLUUID=$(echo $VAL | cut -d= -f2)
1642 [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
1644 [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
1648 run_test 44 "mounted client proc entry exists"
1652 check_mount || return 2
1657 #define OBD_FAIL_PTLRPC_LONG_UNLINK 0x50f
1658 do_facet client "lctl set_param fail_loc=0x50f"
1661 manual_umount_client --force || return 3
1662 do_facet client "lctl set_param fail_loc=0x0"
1664 mount_client $MOUNT || return 4
1668 run_test 45 "long unlink handling in ptlrpcd"
1675 umount_client $MOUNT2 || rc=$?
1676 umount_client $MOUNT || rc=$?
1677 while [ $count -gt 0 ]; do
1678 stop ost${count} -f || rc=$?
1682 # writeconf is needed after the test, otherwise,
1683 # we might end up with extra OSTs
1685 cleanup_nocli || rc=$?
1690 echo "Testing with $OSTCOUNT OSTs"
1692 start_mds || return 1
1693 #first client should see only one ost
1694 start_ost || return 2
1695 wait_osc_import_state mds ost FULL
1697 mount_client $MOUNT || return 3
1698 trap "cleanup_46a $OSTCOUNT" EXIT ERR
1701 for (( i=2; i<=$OSTCOUNT; i++ )); do
1702 start ost$i `ostdevname $i` $OST_MOUNT_OPTS || return $((i+2))
1705 # wait until osts in sync
1706 for (( i=2; i<=$OSTCOUNT; i++ )); do
1707 wait_osc_import_state mds ost$i FULL
1711 #second client see all ost's
1713 mount_client $MOUNT2 || return 8
1714 $LFS setstripe $MOUNT2 -c -1 || return 9
1715 $LFS getstripe $MOUNT2 || return 10
1717 echo "ok" > $MOUNT2/widestripe
1718 $LFS getstripe $MOUNT2/widestripe || return 11
1719 # fill acl buffer for avoid expand lsm to them
1720 awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do
1721 setfacl -m $acl $MOUNT2/widestripe
1725 stat $MOUNT/widestripe || return 12
1727 cleanup_46a $OSTCOUNT || { echo "cleanup_46a failed!" && return 13; }
1730 run_test 46a "handle ost additional - wide striped file"
1735 check_mount || return 2
1736 $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
1740 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1741 if echo $ns | grep "MDT[[:digit:]]*"; then
1744 lrs=$(echo $ns | sed 's/.*lru_size=//')
1745 lru_size[count]=$lrs
1750 facet_failover $SINGLEMDS
1751 client_up || return 3
1754 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1755 if echo $ns | grep "MDT[[:digit:]]*"; then
1758 lrs=$(echo $ns | sed 's/.*lru_size=//')
1759 if ! test "$lrs" -eq "${lru_size[count]}"; then
1760 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
1761 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
1769 run_test 47 "server restart does not make client loss lru_resize settings"
1774 # reformat after this test is needed - if test will failed
1775 # we will have unkillable file at FS
1779 test_48() { # bug 17636
1782 check_mount || return 2
1784 $LFS setstripe $MOUNT -c -1 || return 9
1785 $LFS getstripe $MOUNT || return 10
1787 echo "ok" > $MOUNT/widestripe
1788 $LFS getstripe $MOUNT/widestripe || return 11
1790 trap cleanup_48 EXIT ERR
1792 # fill acl buffer for avoid expand lsm to them
1793 getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
1794 setfacl -m $acl $MOUNT/widestripe
1797 stat $MOUNT/widestripe || return 12
1802 run_test 48 "too many acls on file"
1804 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
1805 test_49() { # bug 17710
1806 local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
1807 local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
1808 local LOCAL_TIMEOUT=20
1811 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
1817 check_mount || return 1
1819 echo "check ldlm_timout..."
1820 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1821 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1822 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1824 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1825 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
1828 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
1829 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
1832 umount_client $MOUNT
1833 stop_ost || return 2
1834 stop_mds || return 3
1836 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"
1839 start_mds || return 4
1840 start_ost || return 5
1841 mount_client $MOUNT || return 6
1842 check_mount || return 7
1844 LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1845 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1846 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1848 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1849 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
1852 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
1853 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
1856 cleanup || return $?
1858 MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
1859 OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
1861 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
1864 # Test both statfs and lfs df and fail if either one fails
1865 multiop_bg_pause $1 f_
1868 killall -USR1 multiop
1869 [ $RC1 -ne 0 ] && log "lazystatfs multiop failed"
1870 wait $PID || { RC1=$?; log "multiop return error "; }
1877 if [ $RC2 -eq 0 ]; then
1879 log "lazystatfs df failed"
1883 [[ $RC1 -ne 0 || $RC2 -eq 0 ]] && RC=1
1889 lctl set_param llite.$FSNAME-*.lazystatfs=1
1892 lazystatfs $MOUNT || error "lazystatfs failed but no down servers"
1894 cleanup || return $?
1896 run_test 50a "lazystatfs all servers available =========================="
1900 lctl set_param llite.$FSNAME-*.lazystatfs=1
1903 # Wait for client to detect down OST
1904 stop_ost || error "Unable to stop OST1"
1905 wait_osc_import_state mds ost DISCONN
1907 lazystatfs $MOUNT || error "lazystatfs should don't have returned EIO"
1909 umount_client $MOUNT || error "Unable to unmount client"
1910 stop_mds || error "Unable to stop MDS"
1912 run_test 50b "lazystatfs all servers down =========================="
1915 start_mds || error "Unable to start MDS"
1916 start_ost || error "Unable to start OST1"
1917 start_ost2 || error "Unable to start OST2"
1918 mount_client $MOUNT || error "Unable to mount client"
1919 lctl set_param llite.$FSNAME-*.lazystatfs=1
1922 # Wait for client to detect down OST
1923 stop_ost || error "Unable to stop OST1"
1924 wait_osc_import_state mds ost DISCONN
1925 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
1927 umount_client $MOUNT || error "Unable to unmount client"
1928 stop_ost2 || error "Unable to stop OST2"
1929 stop_mds || error "Unable to stop MDS"
1931 run_test 50c "lazystatfs one server down =========================="
1934 start_mds || error "Unable to start MDS"
1935 start_ost || error "Unable to start OST1"
1936 start_ost2 || error "Unable to start OST2"
1937 mount_client $MOUNT || error "Unable to mount client"
1938 lctl set_param llite.$FSNAME-*.lazystatfs=1
1941 # Issue the statfs during the window where the client still
1942 # belives the OST to be available but it is in fact down.
1943 # No failure just a statfs which hangs for a timeout interval.
1944 stop_ost || error "Unable to stop OST1"
1945 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
1947 umount_client $MOUNT || error "Unable to unmount client"
1948 stop_ost2 || error "Unable to stop OST2"
1949 stop_mds || error "Unable to stop MDS"
1951 run_test 50d "lazystatfs client/server conn race =========================="
1958 start_mds || return 1
1959 #first client should see only one ost
1960 start_ost || return 2
1961 wait_osc_import_state mds ost FULL
1963 # Wait for client to detect down OST
1964 stop_ost || error "Unable to stop OST1"
1965 wait_osc_import_state mds ost DISCONN
1967 mount_client $MOUNT || error "Unable to mount client"
1968 lctl set_param llite.$FSNAME-*.lazystatfs=0
1970 multiop_bg_pause $MOUNT _f
1974 if [ $RC1 -ne 0 ]; then
1975 log "multiop failed $RC1"
1978 sleep $(( $TIMEOUT+1 ))
1980 [ $? -ne 0 ] && error "process isn't sleep"
1981 start_ost || error "Unable to start OST1"
1982 wait $pid || error "statfs failed"
1985 umount_client $MOUNT || error "Unable to unmount client"
1986 stop_ost || error "Unable to stop OST1"
1987 stop_mds || error "Unable to stop MDS"
1989 run_test 50e "normal statfs all servers down =========================="
1994 CONN_PROC="osc.$FSNAME-OST0001-osc-[M]*.ost_server_uuid"
1996 start_mds || error "Unable to start mds"
1997 #first client should see only one ost
1998 start_ost || error "Unable to start OST1"
1999 wait_osc_import_state mds ost FULL
2001 start_ost2 || error "Unable to start OST2"
2002 wait_osc_import_state mds ost2 FULL
2004 # Wait for client to detect down OST
2005 stop_ost2 || error "Unable to stop OST2"
2007 wait_osc_import_state mds ost2 DISCONN
2008 mount_client $MOUNT || error "Unable to mount client"
2009 lctl set_param llite.$FSNAME-*.lazystatfs=0
2011 multiop_bg_pause $MOUNT _f
2015 if [ $RC1 -ne 0 ]; then
2016 log "lazystatfs multiop failed $RC1"
2019 sleep $(( $TIMEOUT+1 ))
2021 [ $? -ne 0 ] && error "process isn't sleep"
2022 start_ost2 || error "Unable to start OST2"
2023 wait $pid || error "statfs failed"
2024 stop_ost2 || error "Unable to stop OST2"
2027 umount_client $MOUNT || error "Unable to unmount client"
2028 stop_ost || error "Unable to stop OST1"
2029 stop_mds || error "Unable to stop MDS"
2032 run_test 50f "normal statfs one server in down =========================="
2035 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
2037 start_ost2 || error "Unable to start OST2"
2039 local PARAM="${FSNAME}-OST0001.osc.active"
2041 $LFS setstripe -c -1 $DIR/$tfile || error "Unable to lfs setstripe"
2042 do_facet mgs $LCTL conf_param $PARAM=0 || error "Unable to deactivate OST"
2044 umount_client $MOUNT || error "Unable to unmount client"
2045 mount_client $MOUNT || error "Unable to mount client"
2046 # This df should not cause a panic
2049 do_facet mgs $LCTL conf_param $PARAM=1 || error "Unable to activate OST"
2051 umount_client $MOUNT || error "Unable to unmount client"
2052 stop_ost2 || error "Unable to stop OST2"
2053 stop_ost || error "Unable to stop OST1"
2054 stop_mds || error "Unable to stop MDS"
2057 run_test 50g "deactivated OST should not cause panic====================="
2060 local LOCAL_TIMEOUT=20
2066 check_mount || return 1
2069 $LFS setstripe -c -1 $MOUNT/d1
2070 #define OBD_FAIL_MDS_REINT_DELAY 0x142
2071 do_facet $SINGLEMDS "lctl set_param fail_loc=0x142"
2072 touch $MOUNT/d1/f1 &
2075 start_ost2 || return 2
2077 stop_ost2 || return 3
2080 run_test 51 "Verify that mdt_reint handles RMF_MDT_MD correctly when an OST is added"
2089 do_node $node mkdir -p $dest
2090 [ $? -eq 0 ] || { error "Unable to create directory"; return 1; }
2092 do_node $node 'tar cf - '$@' | tar xf - -C '$dest';
2093 [ \"\${PIPESTATUS[*]}\" = \"0 0\" ] || exit 1'
2094 [ $? -eq 0 ] || { error "Unable to tar files"; return 2; }
2096 do_node $node 'getfattr -d -m "[a-z]*\\." '$@' > '$xattrs
2097 [ $? -eq 0 ] || { error "Unable to read xattrs"; return 3; }
2107 local backup2=${TMP}/backup2
2109 do_node $node mkdir -p $backup2
2110 [ $? -eq 0 ] || { error "Unable to create directory"; return 1; }
2112 do_node $node 'tar cf - '$@' | tar xf - -C '$backup2';
2113 [ \"\${PIPESTATUS[*]}\" = \"0 0\" ] || exit 1'
2114 [ $? -eq 0 ] || { error "Unable to tar files to diff"; return 2; }
2116 do_node $node "diff -rq $backup $backup2"
2117 [ $? -eq 0 ] || { error "contents differ"; return 3; }
2119 local xattrs2=${TMP}/xattrs2
2120 do_node $node 'getfattr -d -m "[a-z]*\\." '$@' > '$xattrs2
2121 [ $? -eq 0 ] || { error "Unable to read xattrs to diff"; return 4; }
2123 do_node $node "diff $xattrs $xattrs2"
2124 [ $? -eq 0 ] || { error "xattrs differ"; return 5; }
2126 do_node $node "rm -rf $backup2 $xattrs2"
2127 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 6; }
2132 [ $? -eq 0 ] || { error "Unable to start MDS"; return 1; }
2134 [ $? -eq 0 ] || { error "Unable to start OST1"; return 2; }
2136 [ $? -eq 0 ] || { error "Unable to mount client"; return 3; }
2139 local ost1mnt=${MOUNT%/*}/ost1
2140 local ost1node=$(facet_active_host ost1)
2141 local ost1tmp=$TMP/conf52
2144 [ $? -eq 0 ] || { error "Unable to create tdir"; return 4; }
2145 touch $TMP/modified_first
2146 [ $? -eq 0 ] || { error "Unable to create temporary file"; return 5; }
2147 do_node $ost1node "mkdir -p $ost1tmp && touch $ost1tmp/modified_first"
2148 [ $? -eq 0 ] || { error "Unable to create temporary file"; return 6; }
2151 $LFS setstripe $DIR/$tdir -c -1 -s 1M
2152 [ $? -eq 0 ] || { error "lfs setstripe failed"; return 7; }
2154 for (( i=0; i < nrfiles; i++ )); do
2155 multiop $DIR/$tdir/$tfile-$i Ow1048576w1048576w524288c
2156 [ $? -eq 0 ] || { error "multiop failed"; return 8; }
2162 echo backup files to $TMP/files
2163 local files=$(find $DIR/$tdir -type f -newer $TMP/modified_first)
2164 copy_files_xattrs `hostname` $TMP/files $TMP/file_xattrs $files
2165 [ $? -eq 0 ] || { error "Unable to copy files"; return 9; }
2167 umount_client $MOUNT
2168 [ $? -eq 0 ] || { error "Unable to umount client"; return 10; }
2170 [ $? -eq 0 ] || { error "Unable to stop ost1"; return 11; }
2172 echo mount ost1 as ldiskfs
2173 do_node $ost1node mount -t $FSTYPE $ost1_dev $ost1mnt $OST_MOUNT_OPTS
2174 [ $? -eq 0 ] || { error "Unable to mount ost1 as ldiskfs"; return 12; }
2177 echo backup objects to $ost1tmp/objects
2178 local objects=$(do_node $ost1node 'find '$ost1mnt'/O/0 -type f -size +0'\
2179 '-newer '$ost1tmp'/modified_first -regex ".*\/[0-9]+"')
2180 copy_files_xattrs $ost1node $ost1tmp/objects $ost1tmp/object_xattrs $objects
2181 [ $? -eq 0 ] || { error "Unable to copy objects"; return 13; }
2183 # move objects to lost+found
2184 do_node $ost1node 'mv '$objects' '${ost1mnt}'/lost+found'
2185 [ $? -eq 0 ] || { error "Unable to move objects"; return 14; }
2188 do_node $ost1node "ll_recover_lost_found_objs -d $ost1mnt/lost+found"
2189 [ $? -eq 0 ] || { error "ll_recover_lost_found_objs failed"; return 15; }
2191 # compare restored objects against saved ones
2192 diff_files_xattrs $ost1node $ost1tmp/objects $ost1tmp/object_xattrs $objects
2193 [ $? -eq 0 ] || { error "Unable to diff objects"; return 16; }
2195 do_node $ost1node "umount $ost1_dev"
2196 [ $? -eq 0 ] || { error "Unable to umount ost1 as ldiskfs"; return 17; }
2199 [ $? -eq 0 ] || { error "Unable to start ost1"; return 18; }
2201 [ $? -eq 0 ] || { error "Unable to mount client"; return 19; }
2204 diff_files_xattrs `hostname` $TMP/files $TMP/file_xattrs $files
2205 [ $? -eq 0 ] || { error "Unable to diff files"; return 20; }
2207 rm -rf $TMP/files $TMP/file_xattrs
2208 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 21; }
2209 do_node $ost1node "rm -rf $ost1tmp"
2210 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 22; }
2213 run_test 52 "check recovering objects from lost+found"
2216 equals_msg `basename $0`: test complete
2217 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true