Whamcloud - gitweb
0649fcc7ff755fd7651241cecb90cd6f2ff84535
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
1 #!/bin/bash
2 # requirement:
3 #       add uml1 uml2 uml3 in your /etc/hosts
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.
9
10 set -e
11
12 ONLY=${ONLY:-"$*"}
13
14 # bug number for skipped test: 13739
15 HEAD_EXCEPT="                  32a"
16
17 # bug number for skipped test:                                 
18 ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $HEAD_EXCEPT"
19 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
20
21 SRCDIR=`dirname $0`
22 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
23
24 PTLDEBUG=${PTLDEBUG:--1}
25 SAVE_PWD=$PWD
26 LUSTRE=${LUSTRE:-`dirname $0`/..}
27 RLUSTRE=${RLUSTRE:-$LUSTRE}
28
29 . $LUSTRE/tests/test-framework.sh
30 init_test_env $@
31 # STORED_MDSSIZE is used in test_18
32 if [ -n "$MDSSIZE" ]; then
33     STORED_MDSSIZE=$MDSSIZE
34 fi
35 # use small MDS + OST size to speed formatting time
36 MDSSIZE=40000
37 OSTSIZE=40000
38 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
39
40 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
41 remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
42
43 #
44 [ "$SLOW" = "no" ] && EXCEPT_SLOW="0 1 2 3 6 7 15 18 24b 25 30 31 32 33 34a 45"
45
46 assert_DIR
47
48 reformat() {
49         formatall
50 }
51
52 writeconf() {
53         local facet=$SINGLEMDS
54         local dev=${facet}_dev
55         shift
56         stop ${facet} -f
57         rm -f ${facet}active
58         # who knows if/where $TUNEFS is installed?  Better reformat if it fails...
59         do_facet ${facet} "$TUNEFS --writeconf ${!dev}" || echo "tunefs failed, reformatting instead" && reformat
60
61         gen_config
62 }
63
64 gen_config() {
65         # The MGS must be started before the OSTs for a new fs, so start
66         # and stop to generate the startup logs. 
67         start_mds
68         start_ost
69         sleep 5
70         stop_ost
71         stop_mds
72 }
73
74 reformat_and_config() {
75         reformat
76         gen_config
77 }
78
79 start_mds() {
80         local facet=$SINGLEMDS
81         # we can not use MDSDEV1 here because SINGLEMDS could be set not to mds1 only
82         local num=$(echo $facet | tr -d "mds")
83         local dev=$(mdsdevname $num)
84         echo "start mds service on `facet_active_host $facet`"
85         start $facet ${dev} $MDS_MOUNT_OPTS || return 94
86 }
87
88 stop_mds() {
89         echo "stop mds service on `facet_active_host $SINGLEMDS`"
90         # These tests all use non-failover stop
91         stop $SINGLEMDS -f  || return 97
92 }
93
94 start_ost() {
95         echo "start ost1 service on `facet_active_host ost1`"
96         start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
97 }
98
99 stop_ost() {
100         echo "stop ost1 service on `facet_active_host ost1`"
101         # These tests all use non-failover stop
102         stop ost1 -f  || return 98
103 }
104
105 start_ost2() {
106         echo "start ost2 service on `facet_active_host ost2`"
107         start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
108 }
109
110 stop_ost2() {
111         echo "stop ost2 service on `facet_active_host ost2`"
112         # These tests all use non-failover stop
113         stop ost2 -f  || return 93
114 }
115
116 mount_client() {
117         local MOUNTPATH=$1
118         echo "mount $FSNAME on ${MOUNTPATH}....."
119         zconf_mount `hostname` $MOUNTPATH  || return 96
120 }
121
122 remount_client() {
123         local SAVEMOUNTOPT=$MOUNTOPT
124         MOUNTOPT="remount,$1"
125         local MOUNTPATH=$2
126         echo "remount '$1' lustre on ${MOUNTPATH}....."
127         zconf_mount `hostname`  $MOUNTPATH  || return 96
128         MOUNTOPT=$SAVEMOUNTOPT
129 }
130
131 umount_client() {
132         local MOUNTPATH=$1
133         echo "umount lustre on ${MOUNTPATH}....."
134         zconf_umount `hostname` $MOUNTPATH || return 97
135 }
136
137 manual_umount_client(){
138         local rc
139         local FORCE=$1
140         echo "manual umount lustre on ${MOUNT}...."
141         do_facet client "umount -d ${FORCE} $MOUNT"
142         rc=$?
143         return $rc
144 }
145
146 setup() {
147         start_ost
148         start_mds
149         mount_client $MOUNT
150 }
151
152 setup_noconfig() {
153         start_mds
154         start_ost
155         mount_client $MOUNT
156 }
157
158 cleanup_nocli() {
159         stop_mds || return 201
160         stop_ost || return 202
161         unload_modules || return 203
162 }
163
164 cleanup() {
165         umount_client $MOUNT || return 200
166         cleanup_nocli || return $?
167 }
168
169 check_mount() {
170         do_facet client "cp /etc/passwd $DIR/a" || return 71
171         do_facet client "rm $DIR/a" || return 72
172         # make sure lustre is actually mounted (touch will block, 
173         # but grep won't, so do it after) 
174         do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
175         echo "setup single mount lustre success"
176 }
177
178 check_mount2() {
179         do_facet client "touch $DIR/a" || return 71     
180         do_facet client "rm $DIR/a" || return 72        
181         do_facet client "touch $DIR2/a" || return 73    
182         do_facet client "rm $DIR2/a" || return 74       
183         echo "setup double mount lustre success"
184 }
185
186 build_test_filter
187
188 if [ "$ONLY" == "setup" ]; then
189         setup
190         exit
191 fi
192
193 if [ "$ONLY" == "cleanup" ]; then
194         cleanup
195         exit
196 fi
197
198 init_gss
199
200 #create single point mountpoint
201
202 reformat_and_config
203
204 test_0() {
205         setup
206         check_mount || return 41
207         cleanup || return $?
208 }
209 run_test 0 "single mount setup"
210
211 test_1() {
212         start_ost
213         echo "start ost second time..."
214         setup
215         check_mount || return 42
216         cleanup || return $?
217 }
218 run_test 1 "start up ost twice (should return errors)"
219
220 test_2() {
221         start_ost
222         start_mds
223         echo "start mds second time.."
224         start_mds
225         mount_client $MOUNT
226         check_mount || return 43
227         cleanup || return $?
228 }
229 run_test 2 "start up mds twice (should return err)"
230
231 test_3() {
232         setup
233         #mount.lustre returns an error if already in mtab
234         mount_client $MOUNT && return $?
235         check_mount || return 44
236         cleanup || return $?
237 }
238 run_test 3 "mount client twice (should return err)"
239
240 test_4() {
241         setup
242         touch $DIR/$tfile || return 85
243         stop_ost -f
244         cleanup
245         eno=$?
246         # ok for ost to fail shutdown
247         if [ 202 -ne $eno ]; then
248                 return $eno;
249         fi
250         return 0
251 }
252 run_test 4 "force cleanup ost, then cleanup"
253
254 test_5a() {     # was test_5
255         setup
256         touch $DIR/$tfile || return 1
257         fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
258
259         stop_mds -f || return 2
260
261         # cleanup may return an error from the failed
262         # disconnects; for now I'll consider this successful
263         # if all the modules have unloaded.
264         umount -d $MOUNT &
265         UMOUNT_PID=$!
266         sleep 6
267         echo "killing umount"
268         kill -TERM $UMOUNT_PID
269         echo "waiting for umount to finish"
270         wait $UMOUNT_PID
271         if grep " $MOUNT " /proc/mounts; then
272                 echo "test 5: /proc/mounts after failed umount"
273                 umount $MOUNT &
274                 UMOUNT_PID=$!
275                 sleep 2
276                 echo "killing umount"
277                 kill -TERM $UMOUNT_PID
278                 echo "waiting for umount to finish"
279                 wait $UMOUNT_PID
280                 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
281         fi
282
283         manual_umount_client
284         # stop_mds is a no-op here, and should not fail
285         cleanup_nocli || return $?
286         # df may have lingering entry
287         manual_umount_client
288         # mtab may have lingering entry
289         local WAIT=0
290         local MAX_WAIT=20
291         local sleep=1
292         while [ "$WAIT" -ne "$MAX_WAIT" ]; do
293                 sleep $sleep
294                 grep -q $MOUNT" " /etc/mtab || break
295                 echo "Waiting /etc/mtab updated ... "
296                 WAIT=$(( WAIT + sleep))
297         done
298         [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
299         echo "/etc/mtab updated in $WAIT secs"
300 }
301 run_test 5a "force cleanup mds, then cleanup"
302
303 test_5b() {
304         start_ost
305         [ -d $MOUNT ] || mkdir -p $MOUNT
306         grep " $MOUNT " /etc/mtab && echo "test 5b: mtab before mount" && return 10
307         mount_client $MOUNT && return 1
308         grep " $MOUNT " /etc/mtab && echo "test 5b: mtab after failed mount" && return 11
309         umount_client $MOUNT
310         # stop_mds is a no-op here, and should not fail
311         cleanup_nocli || return $?
312         return 0
313 }
314 run_test 5b "mds down, cleanup after failed mount (bug 2712) (should return errs)"
315
316 test_5c() {
317         start_ost
318         start_mds
319         [ -d $MOUNT ] || mkdir -p $MOUNT
320         grep " $MOUNT " /etc/mtab && echo "test 5c: mtab before mount" && return 10
321         local oldfs="${FSNAME}"
322         FSNAME="wrong.${FSNAME}"
323         mount_client $MOUNT || :
324         FSNAME=${oldfs}
325         grep " $MOUNT " /etc/mtab && echo "test 5c: mtab after failed mount" && return 11
326         umount_client $MOUNT
327         cleanup_nocli  || return $?
328 }
329 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
330
331 test_5d() {
332         start_ost
333         start_mds
334         stop_ost -f
335         grep " $MOUNT " /etc/mtab && echo "test 5d: mtab before mount" && return 10
336         mount_client $MOUNT || return 1
337         cleanup  || return $?
338         grep " $MOUNT " /etc/mtab && echo "test 5d: mtab after unmount" && return 11
339         return 0
340 }
341 run_test 5d "mount with ost down"
342
343 test_5e() {
344         start_ost
345         start_mds
346
347 #define OBD_FAIL_PTLRPC_DELAY_SEND       0x506
348         do_facet client "lctl set_param fail_loc=0x80000506"
349         grep " $MOUNT " /etc/mtab && echo "test 5e: mtab before mount" && return 10
350         mount_client $MOUNT || echo "mount failed (not fatal)"
351         cleanup  || return $?
352         grep " $MOUNT " /etc/mtab && echo "test 5e: mtab after unmount" && return 11
353         return 0
354 }
355 run_test 5e "delayed connect, don't crash (bug 10268)"
356
357 test_6() {
358         setup
359         manual_umount_client
360         mount_client ${MOUNT} || return 87
361         touch $DIR/a || return 86
362         cleanup  || return $?
363 }
364 run_test 6 "manual umount, then mount again"
365
366 test_7() {
367         setup
368         manual_umount_client
369         cleanup_nocli || return $?
370 }
371 run_test 7 "manual umount, then cleanup"
372
373 test_8() {
374         setup
375         mount_client $MOUNT2
376         check_mount2 || return 45
377         umount_client $MOUNT2
378         cleanup  || return $?
379 }
380 run_test 8 "double mount setup"
381
382 test_9() {
383         start_ost
384
385         do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
386         do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
387
388         CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
389         if [ "$CHECK_PTLDEBUG" ] && { \
390            [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ] ||
391            [ "$CHECK_PTLDEBUG" = "trace inode" ]; }; then   
392            echo "lnet.debug success"
393         else
394            echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
395            return 1
396         fi
397         CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
398         if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
399            echo "lnet.subsystem_debug success"
400         else
401            echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
402            return 1
403         fi
404         stop_ost || return $?
405 }
406
407 run_test 9 "test ptldebug and subsystem for mkfs"
408
409 # LOGS/PENDING do not exist anymore since CMD3
410 test_16() {
411         local TMPMTPT="${TMP}/conf16"
412         local dev=${SINGLEMDS}_dev
413         local MDSDEV=${!dev}
414         if [ ! -e "$MDSDEV" ]; then
415             log "no $MDSDEV existing, so mount Lustre to create one"
416             setup
417             check_mount || return 41
418             cleanup || return $?
419         fi
420
421         [ -f "$MDSDEV" ] && LOOPOPT="-o loop"
422
423         log "change the mode of $MDSDEV/OBJECTS to 555"
424         do_facet $SINGLEMDS "mkdir -p $TMPMTPT &&
425                       mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
426                       chmod 555 $TMPMTPT/OBJECTS &&
427                       umount $TMPMTPT" || return $?
428
429         log "mount Lustre to change the mode of OBJECTS, then umount Lustre"
430         setup
431         check_mount || return 41
432         cleanup || return $?
433
434         log "read the mode of OBJECTS and check if they has been changed properly"
435         EXPECTEDOBJECTSMODE=`do_facet $SINGLEMDS "$DEBUGFS -R 'stat OBJECTS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
436
437         if [ "$EXPECTEDOBJECTSMODE" = "0777" ]; then
438                 log "Success:Lustre change the mode of OBJECTS correctly"
439         else
440                 error "Lustre does not change mode of OBJECTS properly"
441         fi
442 }
443 run_test 16 "verify that lustre will correct the mode of OBJECTS"
444
445 test_17() {
446         local dev=${SINGLEMDS}_dev
447         local MDSDEV=${!dev}
448
449         if [ ! -e "$MDSDEV" ]; then
450             echo "no $MDSDEV existing, so mount Lustre to create one"
451             setup
452             check_mount || return 41
453             cleanup || return $?
454         fi
455
456         echo "Remove mds config log"
457         do_facet $SINGLEMDS "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MDSDEV || return \$?" || return $?
458
459         start_ost
460         start_mds && return 42
461         reformat_and_config
462 }
463 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
464
465 test_18() {
466         [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return
467
468         local dev=${SINGLEMDS}_dev
469         local MDSDEV=${!dev}
470
471         local MIN=2000000
472
473         local OK=
474         # check if current MDSSIZE is large enough
475         [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
476                 log "use MDSSIZE=$MDSSIZE"
477
478         # check if the global config has a large enough MDSSIZE
479         [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
480                 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
481                 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
482
483         # check if the block device is large enough
484         [ -z "$OK" -a -b $MDSDEV ] && \
485                 [ "$(dd if=$MDSDEV of=/dev/null bs=1k count=1 skip=$MIN 2>&1 |
486                      awk '($3 == "in") { print $1 }')" = "1+0" ] && OK=1 && \
487                 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
488
489         # check if a loopback device has enough space for fs metadata (5%)
490         [ -z "$OK" ] && [ -f $MDSDEV -o ! -e $MDSDEV ] &&
491                 SPACE=$(df -P $(dirname $MDSDEV) |
492                         awk '($1 != "Filesystem") {print $4}') &&
493                 [ $SPACE -gt $((MIN / 20)) ] && OK=1 && myMDSSIZE=$MIN && \
494                         log "use file $MDSDEV with MIN=$MIN"
495
496         [ -z "$OK" ] && skip "$MDSDEV too small for ${MIN}kB MDS" && return
497
498
499         echo "mount mds with large journal..."
500         local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
501
502         MDS_MKFS_OPTS="--mgs --mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
503
504         reformat_and_config
505         echo "mount lustre system..."
506         setup
507         check_mount || return 41
508
509         echo "check journal size..."
510         local FOUNDSIZE=`do_facet mds "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}'`
511         if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
512                 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
513         else
514                 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
515         fi
516
517         cleanup || return $?
518
519         MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
520         reformat_and_config
521 }
522 run_test 18 "check mkfs creates large journals"
523
524 test_19a() {
525         start_mds || return 1
526         stop_mds -f || return 2
527 }
528 run_test 19a "start/stop MDS without OSTs"
529
530 test_19b() {
531         start_ost || return 1
532         stop_ost -f || return 2
533 }
534 run_test 19b "start/stop OSTs without MDS"
535
536 test_20() {
537         # first format the ost/mdt
538         start_ost
539         start_mds
540         mount_client $MOUNT
541         check_mount || return 43
542         rm -f $DIR/$tfile
543         remount_client ro $MOUNT || return 44
544         touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
545         [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
546         remount_client rw $MOUNT || return 47
547         touch $DIR/$tfile
548         [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
549         MCNT=`grep -c $MOUNT /etc/mtab`
550         [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
551         umount_client $MOUNT
552         stop_mds
553         stop_ost
554 }
555 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
556
557 test_21a() {
558         start_mds
559         start_ost
560         stop_ost
561         stop_mds
562 }
563 run_test 21a "start mds before ost, stop ost first"
564
565 test_21b() {
566         start_ost
567         start_mds
568         stop_mds
569         stop_ost
570 }
571 run_test 21b "start ost before mds, stop mds first"
572
573 test_21c() {
574         start_ost
575         start_mds
576         start_ost2
577         stop_ost
578         stop_ost2
579         stop_mds
580         #writeconf to remove all ost2 traces for subsequent tests
581         writeconf
582 }
583 run_test 21c "start mds between two osts, stop mds last"
584
585 test_22() {
586         start_mds
587
588         echo Client mount with ost in logs, but none running
589         start_ost
590         # wait until mds connected to ost and open client connection
591         # ping_interval + 1
592         sleep $((TIMEOUT / 4 + 1))
593         stop_ost
594         mount_client $MOUNT
595         # check_mount will block trying to contact ost
596         umount_client $MOUNT
597         pass
598
599         echo Client mount with a running ost
600         start_ost
601         if $GSS; then
602                 # if gss enabled, wait full time to let connection from
603                 # mds to ost be established, due to the mismatch between
604                 # initial connect timeout and gss context negotiation timeout.
605                 # This perhaps could be remove after AT landed.
606                 echo "sleep $((TIMEOUT + TIMEOUT + TIMEOUT))s"
607                 sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
608         fi
609         mount_client $MOUNT
610         check_mount || return 41
611         pass
612
613         cleanup
614 }
615 run_test 22 "start a client before osts (should return errs)"
616
617 test_23a() {    # was test_23
618         setup
619         # fail mds
620         stop $SINGLEMDS   
621         # force down client so that recovering mds waits for reconnect
622         local running=$(grep -c $MOUNT /proc/mounts) || true
623         if [ $running -ne 0 ]; then
624                 echo "Stopping client $MOUNT (opts: -f)"
625                 umount -f $MOUNT
626         fi
627
628         # enter recovery on mds
629         start_mds
630         # try to start a new client
631         mount_client $MOUNT &
632         sleep 5
633         MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
634         MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
635         echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
636         ps --ppid $MOUNT_PID
637         ps --ppid $MOUNT_LUSTRE_PID
638         # FIXME why o why can't I kill these? Manual "ctrl-c" works...
639         kill -TERM $MOUNT_LUSTRE_PID
640         echo "waiting for mount to finish"
641         ps -ef | grep mount
642         # we can not wait $MOUNT_PID because it is not a child of this shell
643         local PID1
644         local PID2
645         local WAIT=0
646         local MAX_WAIT=20
647         local sleep=1
648         while [ "$WAIT" -lt "$MAX_WAIT" ]; do
649                 sleep $sleep
650                 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
651                 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
652                 echo PID1=$PID1
653                 echo PID2=$PID2
654                 [ -z "$PID1" -a -z "$PID2" ] && break
655                 echo "waiting for mount to finish ... "
656                 WAIT=$(( WAIT + sleep))
657         done
658         [ "$WAIT" -eq "$MAX_WAIT" ] && error "MOUNT_PID $MOUNT_PID and \
659                 MOUNT__LUSTRE_PID $MOUNT__LUSTRE_PID still not killed in $WAIT secs"
660         ps -ef | grep mount
661         stop_mds || error
662         stop_ost || error
663 }
664 run_test 23a "interrupt client during recovery mount delay"
665
666 umount_client $MOUNT
667 cleanup_nocli
668
669 test_23b() {    # was test_23
670         start_ost
671         start_mds
672         # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
673         lctl set_param fail_loc=0x80000313
674         mount_client $MOUNT
675         cleanup
676 }
677 run_test 23b "Simulate -EINTR during mount"
678
679 fs2mds_HOST=$mds_HOST
680 fs2ost_HOST=$ost_HOST
681
682 cleanup_24a() {
683         trap 0
684         echo "umount $MOUNT2 ..."
685         umount $MOUNT2 || true
686         echo "stopping fs2mds ..."
687         stop fs2mds -f || true
688         echo "stopping fs2ost ..."
689         stop fs2ost -f || true
690 }
691
692 test_24a() {
693         #set up fs1 
694         gen_config
695         #set up fs2
696         [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
697         if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
698                 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
699                 skip "mixed loopback and real device not working" && return
700         fi
701
702         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
703         local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
704
705         # test 8-char fsname as well
706         local FSNAME2=test1234
707         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
708
709         add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
710
711         setup
712         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
713         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
714         mkdir -p $MOUNT2
715         mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
716         # 1 still works
717         check_mount || return 2
718         # files written on 1 should not show up on 2
719         cp /etc/passwd $DIR/$tfile
720         sleep 10
721         [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
722         # 2 should work
723         sleep 5
724         cp /etc/passwd $MOUNT2/b || return 3
725         rm $MOUNT2/b || return 4
726         # 2 is actually mounted
727         grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
728         # failover 
729         facet_failover fs2mds
730         facet_failover fs2ost
731         df
732         umount_client $MOUNT 
733         # the MDS must remain up until last MDT
734         stop_mds
735         MDS=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
736         [ -z "$MDS" ] && error "No MDT" && return 8
737         cleanup_24a
738         cleanup_nocli || return 6
739 }
740 run_test 24a "Multiple MDTs on a single node"
741
742 test_24b() {
743         if [ -z "$fs2mds_DEV" ]; then
744                 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
745                 skip "mixed loopback and real device not working" && return
746         fi
747
748         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
749
750         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10 
751         setup
752         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
753         cleanup || return 6
754 }
755 run_test 24b "Multiple MGSs on a single node (should return err)"
756
757 test_25() {
758         setup
759         check_mount || return 2
760         local MODULES=$($LCTL modules | awk '{ print $2 }')
761         rmmod $MODULES 2>/dev/null || true
762         cleanup || return 6
763 }
764 run_test 25 "Verify modules are referenced"
765
766 test_26() {
767     load_modules
768     # we need modules before mount for sysctl, so make sure...
769     do_facet $SINGLEMDS "lsmod | grep -q lustre || modprobe lustre"
770 #define OBD_FAIL_MDS_FS_SETUP            0x135
771     do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000135"
772     start_mds && echo MDS started && return 1
773     lctl get_param -n devices
774     DEVS=$(lctl get_param -n devices | wc -l)
775     [ $DEVS -gt 0 ] && return 2
776     unload_modules || return 203
777 }
778 run_test 26 "MDT startup failure cleans LOV (should return errs)"
779
780 set_and_check() {
781         local myfacet=$1
782         local TEST=$2
783         local PARAM=$3
784         local ORIG=$(do_facet $myfacet "$TEST") 
785         if [ $# -gt 3 ]; then
786             local FINAL=$4
787         else
788             local -i FINAL
789             FINAL=$(($ORIG + 5))
790         fi
791         echo "Setting $PARAM from $ORIG to $FINAL"
792         do_facet $SINGLEMDS "$LCTL conf_param $PARAM='$FINAL'" || error conf_param failed
793
794         wait_update $(facet_host $myfacet) "$TEST" "$FINAL" || error check failed!
795 }
796
797 test_27a() {
798         start_ost || return 1
799         start_mds || return 2
800         echo "Requeue thread should have started: " 
801         ps -e | grep ll_cfg_requeue 
802         set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
803         cleanup_nocli
804 }
805 run_test 27a "Reacquire MGS lock if OST started first"
806
807 test_27b() {
808         # FIXME. ~grev
809         setup
810         local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
811
812         facet_failover $SINGLEMDS
813         set_and_check $SINGLEMDS "lctl get_param -n mdt.$device.identity_acquire_expire" "$device.mdt.identity_acquire_expire" || return 3
814         set_and_check client "lctl get_param -n mdc.$device-mdc-*.max_rpcs_in_flight" "$device.mdc.max_rpcs_in_flight" || return 4
815         check_mount
816         cleanup
817 }
818 run_test 27b "Reacquire MGS lock after failover"
819
820 test_28() {
821         setup
822         TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
823         PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
824         ORIG=$($TEST)
825         FINAL=$(($ORIG + 1))
826         set_and_check client "$TEST" "$PARAM" $FINAL || return 3
827         FINAL=$(($FINAL + 1))
828         set_and_check client "$TEST" "$PARAM" $FINAL || return 4
829         umount_client $MOUNT || return 200
830         mount_client $MOUNT
831         RESULT=$($TEST)
832         if [ $RESULT -ne $FINAL ]; then
833             echo "New config not seen: wanted $FINAL got $RESULT"
834             return 4
835         else
836             echo "New config success: got $RESULT"
837         fi
838         set_and_check client "$TEST" "$PARAM" $ORIG || return 5
839         cleanup
840 }
841 run_test 28 "permanent parameter setting"
842
843 test_29() {
844         [ "$OSTCOUNT" -lt "2" ] && skip "$OSTCOUNT < 2, skipping" && return
845         setup > /dev/null 2>&1
846         start_ost2
847         sleep 10
848
849         local PARAM="$FSNAME-OST0001.osc.active"
850         local PROC_ACT="osc.$FSNAME-OST0001-osc-[^M]*.active"
851         local PROC_UUID="osc.$FSNAME-OST0001-osc-[^M]*.ost_server_uuid"
852
853         ACTV=$(lctl get_param -n $PROC_ACT)
854         DEAC=$((1 - $ACTV))
855         set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
856         # also check ost_server_uuid status
857         RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
858         if [ -z "$RESULT" ]; then
859             echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
860             return 3
861         else
862             echo "Live client success: got $RESULT"
863         fi
864
865         # check MDT too 
866         local MPROC="osc.$FSNAME-OST0001-osc-[M]*.active"
867         local MAX=30
868         local WAIT=0
869         while [ 1 ]; do
870             sleep 5
871             RESULT=`do_facet $SINGLEMDS " lctl get_param -n $MPROC"`
872             [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
873             if [ $RESULT -eq $DEAC ]; then
874                 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
875                 break
876             fi
877             WAIT=$((WAIT + 5))
878             if [ $WAIT -eq $MAX ]; then
879                 echo "MDT not deactivated: wanted $DEAC got $RESULT"
880                 return 4
881             fi
882             echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
883         done
884
885         # test new client starts deactivated
886         umount_client $MOUNT || return 200
887         mount_client $MOUNT
888         RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
889         if [ -z "$RESULT" ]; then
890             echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
891             return 5
892         else
893             echo "New client success: got $RESULT"
894         fi
895
896         # make sure it reactivates
897         set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
898
899         umount_client $MOUNT
900         stop_ost2
901         cleanup_nocli
902         #writeconf to remove all ost2 traces for subsequent tests
903         writeconf
904 }
905 run_test 29 "permanently remove an OST"
906
907 test_30() {
908         setup
909
910         TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
911         ORIG=$($TEST)
912         LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
913         for i in ${LIST[@]}; do
914             set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
915         done
916         # make sure client restart still works 
917         umount_client $MOUNT
918         mount_client $MOUNT || return 4
919         [ "$($TEST)" -ne "$i" ] && return 5   
920         set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $ORIG || return 6
921         cleanup
922 }
923 run_test 30 "Big config llog"
924
925 test_31() { # bug 10734
926         # ipaddr must not exist
927         mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
928         cleanup
929 }
930 run_test 31 "Connect to non-existent node (shouldn't crash)"
931
932 # Use these start32/stop32 fn instead of t-f start/stop fn,
933 # for local devices, to skip global facet vars init 
934 stop32 () {
935         local facet=$1
936         shift
937         echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
938         umount -d $@ ${MOUNT%/*}/${facet}
939         losetup -a
940 }
941
942 start32 () {
943         local facet=$1
944         shift
945         local device=$1
946         shift
947         mkdir -p ${MOUNT%/*}/${facet}
948
949         echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
950         mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
951         RC=$?
952         if [ $RC -ne 0 ]; then
953                 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
954                 echo "Start of ${device} of local ${facet} failed ${RC}"
955         fi 
956         losetup -a
957         return $RC
958 }
959
960 cleanup_nocli32 () {
961         stop32 mds1 -f
962         stop32 ost1 -f
963         wait_exit_ST client
964 }
965
966 cleanup_32() {
967         trap 0
968         echo "Cleanup test_32 umount $MOUNT ..."
969         umount -f $MOUNT || true
970         echo "Cleanup local mds ost1 ..."
971         cleanup_nocli32
972         unload_modules
973 }
974
975 test_32a() {
976         # this test is totally useless on a client-only system
977         [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0
978         [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
979         [ -z "$TUNEFS" ] && skip "No tunefs" && return 0
980         local DISK1_8=$LUSTRE/tests/disk1_8.tgz
981         [ ! -r $DISK1_8 ] && skip "Cannot find $DISK1_8" && return 0
982
983         mkdir -p $TMP/$tdir
984         tar xjvf $DISK1_8 -C $TMP/$tdir || \
985                 { skip "Cannot untar $DISK1_8" && return 0; }
986
987         load_modules
988         lctl set_param debug=$PTLDEBUG
989
990         $TUNEFS $tmpdir/mds || error "tunefs failed"
991
992         # nids are wrong, so client wont work, but server should start
993         start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
994                 trap cleanup_32 EXIT INT || return 3
995         
996         local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
997         echo MDS uuid $UUID
998         [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID" 
999
1000         $TUNEFS --mgsnode=`hostname` $tmpdir/ost1 || error "tunefs failed"
1001         start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1002         UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
1003         echo OST uuid $UUID
1004         [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID" 
1005
1006         local NID=$($LCTL list_nids | head -1)
1007
1008         echo "OSC changes should return err:" 
1009         $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 && return 7
1010         $LCTL conf_param lustre-OST0000.failover.node=$NID && return 8
1011         echo "ok."
1012         echo "MDC changes should succeed:" 
1013         $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1014         $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1015         echo "ok."
1016
1017         # With a new good MDT failover nid, we should be able to mount a client
1018         # (but it cant talk to OST)
1019         local mountopt="-o exclude=lustre-OST0000"
1020
1021         local device=`h2$NETTYPE $HOSTNAME`:/lustre
1022         echo "Starting local client: $HOSTNAME: $mountopt $device $MOUNT"
1023         mount -t lustre $mountopt $device $MOUNT || return 1
1024
1025         local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
1026         local new=$((old + 5))
1027         lctl conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=$new
1028         wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1029
1030         cleanup_32
1031
1032         # mount a second time to make sure we didnt leave upgrade flag on
1033         load_modules
1034         $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1035         start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1036                 trap cleanup_32 EXIT INT || return 12
1037
1038         cleanup_32
1039
1040         rm -rf $tmpdir || true  # true is only for TMP on NFS
1041 }
1042 run_test 32a "Upgrade from 1.8 (not live)"
1043
1044 test_32b() {
1045         # this test is totally useless on a client-only system
1046         [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0
1047         [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1048         [ -z "$TUNEFS" ] && skip "No tunefs" && return
1049
1050         local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
1051         [ ! -r $DISK1_8 ] && skip "Cannot find $DISK1_8" && return 0
1052         local tmpdir=$TMP/$tdir
1053         mkdir -p $tmpdir
1054         tar xjvf $DISK1_8 -C $tmpdir || \
1055                 { skip "Cannot untar $DISK1_8" && return ; }
1056
1057         load_modules
1058         lctl set_param debug=$PTLDEBUG
1059         local NEWNAME=lustre
1060
1061         # writeconf will cause servers to register with their current nids
1062         $TUNEFS --writeconf --fsname=$NEWNAME $tmpdir/mds || error "tunefs failed"
1063         start32 mds1 $tmpdir/mds "-o loop" && \
1064                 trap cleanup_32 EXIT INT || return 3
1065
1066         local UUID=$(lctl get_param -n mdt.${NEWNAME}-MDT0000.uuid)
1067         echo MDS uuid $UUID
1068         [ "$UUID" == "${NEWNAME}-MDT0000_UUID" ] || error "UUID is wrong: $UUID" 
1069
1070         $TUNEFS --mgsnode=`hostname` --writeconf --fsname=$NEWNAME $tmpdir/ost1 || error "tunefs failed"
1071         start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1072         UUID=$(lctl get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
1073         echo OST uuid $UUID
1074         [ "$UUID" == "${NEWNAME}-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1075
1076         echo "OSC changes should succeed:" 
1077         $LCTL conf_param ${NEWNAME}-OST0000.osc.max_dirty_mb=15 || return 7
1078         $LCTL conf_param ${NEWNAME}-OST0000.failover.node=$NID || return 8
1079         echo "ok."
1080         echo "MDC changes should succeed:" 
1081         $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1082         echo "ok."
1083
1084         # MDT and OST should have registered with new nids, so we should have
1085         # a fully-functioning client
1086         echo "Check client and old fs contents"
1087
1088         local device=`h2$NETTYPE $HOSTNAME`:/$NEWNAME
1089         echo "Starting local client: $HOSTNAME: $device $MOUNT"
1090         mount -t lustre $device $MOUNT || return 1
1091
1092         local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
1093         local new=$((old + 5))
1094         lctl conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=$new
1095         wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1096
1097         [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "94306271 1478" ] || return 12
1098         echo "ok."
1099
1100         cleanup_32
1101
1102         rm -rf $tmpdir || true  # true is only for TMP on NFS
1103 }
1104 run_test 32b "Upgrade from 1.8 with writeconf"
1105
1106 test_33a() { # bug 12333, was test_33
1107         local rc=0
1108         local FSNAME2=test-123
1109         [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1110
1111         if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1112                 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
1113                 skip "mixed loopback and real device not working" && return
1114         fi
1115
1116         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1117         local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1118         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1119         add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1120
1121         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1122         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1123         do_facet $SINGLEMDS "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1124         mkdir -p $MOUNT2
1125         mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1126         echo "ok."
1127
1128         cp /etc/hosts $MOUNT2/ || rc=3 
1129         $LFS getstripe $MOUNT2/hosts
1130
1131         umount -d $MOUNT2
1132         stop fs2ost -f
1133         stop fs2mds -f
1134         rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1135         cleanup_nocli || rc=6
1136         return $rc
1137 }
1138 run_test 33a "Mount ost with a large index number"
1139
1140 test_33b() {    # was test_34
1141         setup
1142
1143         do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1144         # Drop lock cancelation reply during umount
1145         #define OBD_FAIL_LDLM_CANCEL             0x304
1146         do_facet client lctl set_param fail_loc=0x80000304
1147         #lctl set_param debug=-1
1148         umount_client $MOUNT
1149         cleanup
1150 }
1151 run_test 33b "Drop cancel during umount"
1152
1153 test_34a() {
1154         setup
1155         do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1156         manual_umount_client
1157         rc=$?
1158         do_facet client killall -USR1 multiop
1159         if [ $rc -eq 0 ]; then
1160                 error "umount not fail!"
1161         fi
1162         sleep 1
1163         cleanup
1164 }
1165 run_test 34a "umount with opened file should be fail"
1166
1167
1168 test_34b() {
1169         setup
1170         touch $DIR/$tfile || return 1
1171         stop_mds --force || return 2
1172
1173         manual_umount_client --force
1174         rc=$?
1175         if [ $rc -ne 0 ]; then
1176                 error "mtab after failed umount - rc $rc"
1177         fi
1178
1179         cleanup
1180         return 0
1181 }
1182 run_test 34b "force umount with failed mds should be normal"
1183
1184 test_34c() {
1185         setup
1186         touch $DIR/$tfile || return 1
1187         stop_ost --force || return 2
1188
1189         manual_umount_client --force
1190         rc=$?
1191         if [ $rc -ne 0 ]; then
1192                 error "mtab after failed umount - rc $rc"
1193         fi
1194
1195         cleanup
1196         return 0
1197 }
1198 run_test 34c "force umount with failed ost should be normal"
1199
1200 test_35() { # bug 12459
1201         setup
1202
1203         DBG_SAVE="`lctl get_param -n debug`"
1204         lctl set_param debug="ha"
1205
1206         log "Set up a fake failnode for the MDS"
1207         FAKENID="127.0.0.2"
1208         local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
1209         do_facet $SINGLEMDS $LCTL conf_param ${device}.failover.node=$FAKENID || return 4
1210
1211         log "Wait for RECONNECT_INTERVAL seconds (10s)"
1212         sleep 10
1213
1214         MSG="conf-sanity.sh test_35 `date +%F%kh%Mm%Ss`"
1215         $LCTL clear
1216         log "$MSG"
1217         log "Stopping the MDT:"
1218         stop_mds || return 5
1219
1220         df $MOUNT > /dev/null 2>&1 &
1221         DFPID=$!
1222         log "Restarting the MDT:"
1223         start_mds || return 6
1224         log "Wait for df ($DFPID) ... "
1225         wait $DFPID
1226         log "done"
1227         lctl set_param debug="$DBG_SAVE"
1228
1229         # retrieve from the log the first server that the client tried to
1230         # contact after the connection loss
1231         $LCTL dk $TMP/lustre-log-$TESTNAME.log
1232         NEXTCONN=`awk "/${MSG}/ {start = 1;}
1233                        /import_select_connection.*$device-mdc.* using connection/ {
1234                                 if (start) {
1235                                         if (\\\$NF ~ /$FAKENID/)
1236                                                 print \\\$NF;
1237                                         else
1238                                                 print 0;
1239                                         exit;
1240                                 }
1241                        }" $TMP/lustre-log-$TESTNAME.log`
1242         [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1243         cleanup
1244 }
1245 run_test 35 "Reconnect to the last active server first"
1246
1247 test_36() { # 12743
1248         local rc
1249         local FSNAME2=test1234
1250         local fs3ost_HOST=$ost_HOST
1251
1252         [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1253         rc=0
1254
1255         if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1256                 do_facet $SINGLEMDS [ -b "$MDSDEV" ] && \
1257                 skip "mixed loopback and real device not working" && return
1258         fi
1259         [ $OSTCOUNT -lt 2 ] && skip "skipping test for single OST" && return
1260
1261         [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1262                 { skip "remote OST" && return 0; }
1263
1264         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1265         local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1266         local fs3ostdev=${fs3ost_DEV:-$(ostdevname 2)_2}
1267         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1268         # XXX after we support non 4K disk blocksize, change following --mkfsoptions with
1269         # other argument
1270         add fs2ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
1271         add fs3ost $OST_MKFS_OPTS --mkfsoptions='-b4096' --fsname=${FSNAME2} --mgsnode=$MGSNID --reformat $fs3ostdev || exit 10
1272
1273         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1274         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1275         start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1276         mkdir -p $MOUNT2
1277         mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1278
1279         sleep 5 # until 11778 fixed
1280
1281         dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1282
1283         BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1284         BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1285         BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1286         STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1287         DFTOTAL=`echo $STRING | cut -d, -f1`
1288         DFUSED=`echo $STRING  | cut -d, -f2`
1289         DFAVAIL=`echo $STRING | cut -d, -f3`
1290         DFFREE=$(($DFTOTAL - $DFUSED))
1291
1292         ALLOWANCE=$((64 * $OSTCOUNT))
1293
1294         if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||  
1295            [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1296                 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1297                 rc=1
1298         fi
1299         if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] || 
1300            [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1301                 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1302                 rc=2
1303         fi
1304         if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] || 
1305            [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1306                 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1307                 rc=3
1308        fi
1309
1310         umount -d $MOUNT2
1311         stop fs3ost -f || return 200
1312         stop fs2ost -f || return 201
1313         stop fs2mds -f || return 202
1314         rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev $fs3ostdev
1315         unload_modules || return 203
1316         return $rc
1317 }
1318 run_test 36 "df report consistency on OSTs with different block size"
1319
1320 test_37() {
1321         [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0
1322         LOCAL_MDSDEV="$TMP/mdt.img"
1323         SYM_MDSDEV="$TMP/sym_mdt.img"
1324
1325         echo "MDS :     $LOCAL_MDSDEV"
1326         echo "SYMLINK : $SYM_MDSDEV"
1327         rm -f $LOCAL_MDSDEV
1328
1329         touch $LOCAL_MDSDEV
1330         mkfs.lustre --reformat --fsname=lustre --mdt --mgs --device-size=9000 $LOCAL_MDSDEV ||
1331                 error "mkfs.lustre $LOCAL_MDSDEV failed"
1332         ln -s $LOCAL_MDSDEV $SYM_MDSDEV
1333
1334         echo "mount symlink device - $SYM_MDSDEV"
1335
1336         mount_op=`mount -v -t lustre -o loop $SYM_MDSDEV ${MOUNT%/*}/mds 2>&1 | grep "unable to set tunable"`
1337         umount -d ${MOUNT%/*}/mds
1338         rm -f $LOCAL_MDSDEV $SYM_MDSDEV
1339
1340         if [ -n "$mount_op" ]; then
1341                 error "**** FAIL: set tunables failed for symlink device"
1342         fi
1343         return 0
1344 }
1345 run_test 37 "verify set tunables works for symlink device"
1346
1347 test_38() { # bug 14222
1348         setup
1349         # like runtests
1350         COUNT=10
1351         SRC="/etc /bin"
1352         FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1353         log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1354         mkdir -p $DIR/$tdir
1355         tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1356                 error "copying $SRC to $DIR/$tdir"
1357         sync
1358         umount_client $MOUNT
1359         stop_mds
1360         log "rename lov_objid file on MDS"
1361         rm -f $TMP/lov_objid.orig
1362
1363         local dev=${SINGLEMDS}_dev
1364         local MDSDEV=${!dev}
1365         do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1366         do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1367
1368         do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.orig"
1369         # check create in mds_lov_connect
1370         start_mds
1371         mount_client $MOUNT
1372         for f in $FILES; do
1373                 [ $V ] && log "verifying $DIR/$tdir/$f"
1374                 diff -q $f $DIR/$tdir/$f || ERROR=y
1375         done
1376         do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\"  $MDSDEV"
1377         do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new"
1378         [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1379
1380         # check it's updates in sync
1381         umount_client $MOUNT
1382         stop_mds
1383
1384         do_facet $SINGLEMDS dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1385         do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1386         do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1387
1388         start_mds
1389         mount_client $MOUNT
1390         for f in $FILES; do
1391                 [ $V ] && log "verifying $DIR/$tdir/$f"
1392                 diff -q $f $DIR/$tdir/$f || ERROR=y
1393         done
1394         do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1395         do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new1"
1396         umount_client $MOUNT
1397         stop_mds
1398         [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1399
1400         log "files compared the same"
1401         cleanup
1402 }
1403 run_test 38 "MDS recreates missing lov_objid file from OST data"
1404
1405 test_39() {
1406         PTLDEBUG=+malloc
1407         setup
1408         cleanup
1409         perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' && 
1410                 error "memory leak detected" || true
1411 }
1412 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1413
1414 test_40() { # bug 15759
1415         start_ost
1416         #define OBD_FAIL_TGT_TOOMANY_THREADS     0x706
1417         do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000706"
1418         start_mds
1419         cleanup
1420 }
1421 run_test 40 "race during service thread startup"
1422
1423 test_41() { #bug 14134
1424         local rc
1425         local dev=${SINGLEMDS}_dev
1426         local MDSDEV=${!dev}
1427
1428         start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1429         start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1430         start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nomgs
1431         mkdir -p $MOUNT
1432         mount_client $MOUNT || return 1
1433         sleep 5
1434
1435         echo "blah blah" > $MOUNT/$tfile
1436         cat $MOUNT/$tfile
1437
1438         umount_client $MOUNT
1439         stop ost1 -f || return 201
1440         stop_mds -f || return 202
1441         stop_mds -f || return 203
1442         unload_modules || return 204
1443         return $rc
1444 }
1445 run_test 41 "mount mds with --nosvc and --nomgs"
1446
1447 test_42() { #bug 14693
1448         setup
1449         check_mount || return 2
1450         do_facet client lctl conf_param lustre.llite.some_wrong_param=10
1451         umount_client $MOUNT
1452         mount_client $MOUNT || return 1
1453         cleanup
1454         return 0
1455 }
1456 run_test 42 "invalid config param should not prevent client from mounting"
1457
1458 test_43() {
1459     [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip "run as root"
1460     setup
1461     chmod ugo+x $DIR || error "chmod 0 failed"
1462     set_and_check mds                                        \
1463         "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash"  \
1464         "$FSNAME.mdt.root_squash"                            \
1465         "0:0"
1466     set_and_check mds                                        \
1467        "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1468        "$FSNAME.mdt.nosquash_nids"                           \
1469        "NONE"
1470
1471     #
1472     # create set of test files
1473     #
1474     echo "111" > $DIR/$tfile-userfile || error "write 1 failed"
1475     chmod go-rw $DIR/$tfile-userfile  || error "chmod 1 failed"
1476     chown $RUNAS_ID.$RUNAS_ID $DIR/$tfile-userfile || error "chown failed"
1477
1478     echo "222" > $DIR/$tfile-rootfile || error "write 2 failed"
1479     chmod go-rw $DIR/$tfile-rootfile  || error "chmod 2 faield"
1480
1481     mkdir $DIR/$tdir-rootdir -p       || error "mkdir failed"
1482     chmod go-rwx $DIR/$tdir-rootdir   || error "chmod 3 failed"
1483     touch $DIR/$tdir-rootdir/tfile-1  || error "touch failed"
1484
1485     #
1486     # check root_squash:
1487     #   set root squash UID:GID to RUNAS_ID
1488     #   root should be able to access only files owned by RUNAS_ID
1489     #
1490     set_and_check mds                                        \
1491        "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash"   \
1492        "$FSNAME.mdt.root_squash"                             \
1493        "$RUNAS_ID:$RUNAS_ID"
1494
1495     ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-userfile)
1496     dd if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1497         error "$ST: root read permission is denied"
1498     echo "$ST: root read permission is granted - ok"
1499
1500     echo "444" | \
1501     dd conv=notrunc if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1502         error "$ST: root write permission is denied"
1503     echo "$ST: root write permission is granted - ok"
1504
1505     ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1506     dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1507         error "$ST: root read permission is granted"
1508     echo "$ST: root read permission is denied - ok"
1509
1510     echo "555" | \
1511     dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1512         error "$ST: root write permission is granted"
1513     echo "$ST: root write permission is denied - ok"
1514
1515     ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1516     rm $DIR/$tdir-rootdir/tfile-1 1>/dev/null 2>/dev/null && \
1517         error "$ST: root unlink permission is granted"
1518     echo "$ST: root unlink permission is denied - ok"
1519
1520     touch $DIR/tdir-rootdir/tfile-2 1>/dev/null 2>/dev/null && \
1521         error "$ST: root create permission is granted"
1522     echo "$ST: root create permission is denied - ok"
1523
1524     #
1525     # check nosquash_nids:
1526     #   put client's NID into nosquash_nids list,
1527     #   root should be able to access root file after that
1528     #
1529     local NIDLIST=$(lctl list_nids all | tr '\n' ' ')
1530     NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
1531     NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
1532     set_and_check mds                                        \
1533        "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1534        "$FSNAME-MDTall.mdt.nosquash_nids"                    \
1535        "$NIDLIST"
1536
1537     ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1538     dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1539         error "$ST: root read permission is denied"
1540     echo "$ST: root read permission is granted - ok"
1541
1542     echo "666" | \
1543     dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1544         error "$ST: root write permission is denied"
1545     echo "$ST: root write permission is granted - ok"
1546
1547     ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1548     rm $DIR/$tdir-rootdir/tfile-1 || \
1549         error "$ST: root unlink permission is denied"
1550     echo "$ST: root unlink permission is granted - ok"
1551     touch $DIR/$tdir-rootdir/tfile-2 || \
1552         error "$ST: root create permission is denied"
1553     echo "$ST: root create permission is granted - ok"
1554
1555     return 0
1556 }
1557 run_test 43 "check root_squash and nosquash_nids"
1558
1559 umount_client $MOUNT
1560 cleanup_nocli
1561
1562 test_45() { #17310
1563         setup
1564         check_mount || return 2
1565         stop_mds
1566         df -h $MOUNT &
1567         log "sleep 60 sec"
1568         sleep 60
1569 #define OBD_FAIL_PTLRPC_LONG_UNLINK   0x50f
1570         do_facet client "lctl set_param fail_loc=0x50f"
1571         log "sleep 10 sec"
1572         sleep 10
1573         manual_umount_client --force || return 3
1574         do_facet client "lctl set_param fail_loc=0x0"
1575         start_mds
1576         mount_client $MOUNT || return 4
1577         cleanup
1578         return 0
1579 }
1580 run_test 45 "long unlink handling in ptlrpcd"
1581
1582 test_46a() {
1583         OSTCOUNT=6
1584         reformat
1585         start_mds || return 1
1586         #first client should see only one ost
1587         start_ost || return 2
1588         #start_client
1589         mount_client $MOUNT || return 3
1590         
1591         start_ost2 || return 4
1592         start ost3 `ostdevname 3` $OST_MOUNT_OPTS || return 5
1593         start ost4 `ostdevname 4` $OST_MOUNT_OPTS || return 6
1594         start ost5 `ostdevname 5` $OST_MOUNT_OPTS || return 7
1595         # wait until ost2-5 is sync
1596         # ping_interval + 1
1597         sleep $((TIMEOUT / 4 + 1))
1598         #second client see both ost's
1599
1600         mount_client $MOUNT2 || return 8
1601         $LFS setstripe $MOUNT2 -c -1 || return 9
1602         $LFS getstripe $MOUNT2 || return 10
1603
1604         echo "ok" > $MOUNT2/widestripe
1605         $LFS getstripe $MOUNT2/widestripe || return 11
1606         # fill acl buffer for avoid expand lsm to them
1607         awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do  
1608             setfacl -m $acl $MOUNT2/widestripe
1609         done
1610
1611         # will be deadlock
1612         stat $MOUNT/widestripe || return 12
1613
1614         umount_client $MOUNT2 || return 13
1615         umount_client $MOUNT || return 14
1616         stop ost5 -f || return 20
1617         stop ost4 -f || return 21
1618         stop ost3 -f || return 22
1619         stop_ost2 || return 23
1620         stop_ost || return 24
1621         stop_mds || return 25
1622 }
1623 run_test 46a "handle ost additional - wide striped file"
1624
1625 test_47() { #17674
1626         reformat
1627         setup_noconfig
1628         check_mount || return 2
1629         $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
1630
1631         local lru_size=[]
1632         local count=0
1633         for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1634             if echo $ns | grep "MDT[[:digit:]]*"; then
1635                 continue
1636             fi
1637             lrs=$(echo $ns | sed 's/.*lru_size=//')
1638             lru_size[count]=$lrs
1639             let count=count+1
1640         done
1641  
1642         facet_failover ost1
1643         facet_failover $SINGLEMDS
1644         df -h $MOUNT || return 3
1645
1646         count=0
1647         for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
1648             if echo $ns | grep "MDT[[:digit:]]*"; then
1649                 continue
1650             fi
1651             lrs=$(echo $ns | sed 's/.*lru_size=//')
1652             if ! test "$lrs" -eq "${lru_size[count]}"; then
1653                 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
1654                 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
1655             fi
1656             let count=count+1
1657         done
1658
1659         cleanup
1660         return 0
1661 }
1662 run_test 47 "server restart does not make client loss lru_resize settings"
1663
1664 cleanup_48() {
1665         trap 0
1666
1667         # reformat after this test is needed - if test will failed
1668         # we will have unkillable file at FS
1669         reformat_and_config
1670 }
1671
1672 test_48() { # bug 17636
1673         reformat
1674         setup_noconfig
1675         check_mount || return 2
1676
1677         $LFS setstripe $MOUNT -c -1 || return 9
1678         $LFS getstripe $MOUNT || return 10
1679
1680         echo "ok" > $MOUNT/widestripe
1681         $LFS getstripe $MOUNT/widestripe || return 11
1682
1683         trap cleanup_48 EXIT ERR
1684
1685         # fill acl buffer for avoid expand lsm to them
1686         getent passwd | awk -F : '{ print "u:"$1":rwx" }' |  while read acl; do
1687             setfacl -m $acl $MOUNT/widestripe
1688         done
1689
1690         stat $MOUNT/widestripe || return 12
1691
1692         cleanup_48
1693         return 0
1694 }
1695 run_test 48 "too many acls on file"
1696
1697 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
1698 test_49() { # bug 17710
1699         local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
1700         local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
1701         local LOCAL_TIMEOUT=20
1702
1703
1704         OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
1705
1706         reformat
1707         start_mds
1708         start_ost
1709         mount_client $MOUNT
1710         check_mount || return 1
1711
1712         echo "check ldlm_timout..."
1713         LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1714         LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1715         LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1716
1717         if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1718                 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
1719         fi
1720
1721         if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
1722                 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
1723         fi
1724
1725         umount_client $MOUNT
1726         stop_ost || return 2
1727         stop_mds || return 3
1728
1729         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"
1730         
1731         reformat
1732         start_mds || return 4
1733         start_ost || return 5
1734         mount_client $MOUNT || return 6
1735         check_mount || return 7
1736
1737         LDLM_MDS="`do_facet mds lctl get_param -n ldlm_timeout`"
1738         LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
1739         LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
1740
1741         if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
1742                 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
1743         fi
1744         
1745         if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
1746                 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
1747         fi
1748                 
1749         cleanup || return $?
1750
1751         MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
1752         OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
1753 }
1754 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
1755
1756 cleanup_gss
1757 equals_msg `basename $0`: test complete
1758 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true