Whamcloud - gitweb
54b3200f1f31a37eee0a586f2270236bd4b4239a
[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 # These tests don't apply to mountconf
15 MOUNTCONFSKIP="9 10 11 12 13 13b 14 15 18"
16
17 # bug number for skipped test:
18 ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP 16 23"
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 LUSTRE=${LUSTRE:-`dirname $0`/..}
26 RLUSTRE=${RLUSTRE:-$LUSTRE}
27 MOUNTLUSTRE=${MOUNTLUSTRE:-/sbin/mount.lustre}
28 MKFSLUSTRE=${MKFSLUSTRE:-/usr/sbin/mkfs.lustre}
29 HOSTNAME=`hostname`
30
31 . $LUSTRE/tests/test-framework.sh
32 init_test_env $@
33 # use small MDS + OST size to speed formatting time
34 MDSSIZE=40000
35 OSTSIZE=40000
36 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
37
38 reformat() {
39         formatall
40 }
41
42 writeconf() {
43     local facet=mds
44     shift
45     stop ${facet} -f
46     rm -f ${facet}active
47     # who knows if/where $TUNEFS is installed?  Better reformat if it fails...
48     do_facet ${facet} "$TUNEFS --writeconf $MDSDEV" || echo "tunefs failed, reformatting instead" && reformat
49 }
50
51 gen_config() {
52         reformat
53         # The MGS must be started before the OSTs for a new fs, so start
54         # and stop to generate the startup logs. 
55         start_mds
56         start_ost
57         sleep 5
58         stop_ost
59         stop_mds
60 }
61
62 start_mds() {
63         echo "start mds service on `facet_active_host mds`"
64         start mds $MDSDEV $MDS_MOUNT_OPTS || return 94
65 }
66
67 stop_mds() {
68         echo "stop mds service on `facet_active_host mds`"
69         # These tests all use non-failover stop
70         stop mds -f  || return 97
71 }
72
73 start_ost() {
74         echo "start ost1 service on `facet_active_host ost1`"
75         start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
76 }
77
78 stop_ost() {
79         echo "stop ost1 service on `facet_active_host ost1`"
80         # These tests all use non-failover stop
81         stop ost1 -f  || return 98
82 }
83
84 start_ost2() {
85         echo "start ost2 service on `facet_active_host ost2`"
86         start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
87 }
88
89 stop_ost2() {
90         echo "stop ost2 service on `facet_active_host ost2`"
91         # These tests all use non-failover stop
92         stop ost2 -f  || return 93
93 }
94
95 mount_client() {
96         local MOUNTPATH=$1
97         echo "mount $FSNAME on ${MOUNTPATH}....."
98         zconf_mount `hostname` $MOUNTPATH  || return 96
99 }
100
101 remount_client() {
102         local SAVEMOUNTOPT=$MOUNTOPT
103         MOUNTOPT="remount,$1"
104         local MOUNTPATH=$2
105         echo "remount '$1' lustre on ${MOUNTPATH}....."
106         zconf_mount `hostname`  $MOUNTPATH  || return 96
107         MOUNTOPT=$SAVEMOUNTOPT
108 }
109
110 umount_client() {
111         local MOUNTPATH=$1
112         echo "umount lustre on ${MOUNTPATH}....."
113         zconf_umount `hostname` $MOUNTPATH || return 97
114 }
115
116 manual_umount_client(){
117         echo "manual umount lustre on ${MOUNT}...."
118         do_facet client "umount -d $MOUNT"
119 }
120
121 setup() {
122         start_ost
123         start_mds
124         mount_client $MOUNT
125 }
126
127 cleanup_nocli() {
128         stop_mds || return 201
129         stop_ost || return 202
130         unload_modules || return 203
131 }
132
133 cleanup() {
134         umount_client $MOUNT || return 200
135         cleanup_nocli || return $?
136 }
137
138 check_mount() {
139         do_facet client "cp /etc/passwd $DIR/a" || return 71
140         do_facet client "rm $DIR/a" || return 72
141         # make sure lustre is actually mounted (touch will block, 
142         # but grep won't, so do it after) 
143         do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
144         echo "setup single mount lustre success"
145 }
146
147 check_mount2() {
148         do_facet client "touch $DIR/a" || return 71     
149         do_facet client "rm $DIR/a" || return 72        
150         do_facet client "touch $DIR2/a" || return 73    
151         do_facet client "rm $DIR2/a" || return 74       
152         echo "setup double mount lustre success"
153 }
154
155 build_test_filter
156
157 if [ "$ONLY" == "setup" ]; then
158         setup
159         exit
160 fi
161
162 if [ "$ONLY" == "cleanup" ]; then
163         cleanup
164         exit
165 fi
166
167 #create single point mountpoint
168
169 gen_config
170
171 init_krb5_env
172
173 test_0() {
174         setup
175         check_mount || return 41
176         cleanup || return $?
177 }
178 run_test 0 "single mount setup"
179
180 test_1() {
181         start_ost
182         echo "start ost second time..."
183         setup
184         check_mount || return 42
185         cleanup || return $?
186 }
187 run_test 1 "start up ost twice (should return errors)"
188
189 test_2() {
190         start_ost
191         start_mds       
192         echo "start mds second time.."
193         start_mds
194         mount_client $MOUNT
195         check_mount || return 43
196         cleanup || return $?
197 }
198 run_test 2 "start up mds twice (should return err)"
199
200 test_3() {
201         setup
202         #mount.lustre returns an error if already in mtab
203         mount_client $MOUNT && return $?
204         check_mount || return 44
205         cleanup || return $?
206 }
207 run_test 3 "mount client twice (should return err)"
208
209 test_4() {
210         setup
211         touch $DIR/$tfile || return 85
212         stop_ost -f
213         cleanup
214         eno=$?
215         # ok for ost to fail shutdown
216         if [ 202 -ne $eno ]; then
217                 return $eno;
218         fi
219         return 0
220 }
221 run_test 4 "force cleanup ost, then cleanup"
222
223 test_5() {
224         setup
225         touch $DIR/$tfile || return 1
226         stop_mds -f || return 2
227
228         # cleanup may return an error from the failed
229         # disconnects; for now I'll consider this successful
230         # if all the modules have unloaded.
231         umount -d $MOUNT &
232         UMOUNT_PID=$!
233         sleep 6
234         echo "killing umount"
235         kill -TERM $UMOUNT_PID
236         echo "waiting for umount to finish"
237         wait $UMOUNT_PID
238         if grep " $MOUNT " /etc/mtab; then
239                 echo "test 5: mtab after failed umount"
240                 umount $MOUNT &
241                 UMOUNT_PID=$!
242                 sleep 2
243                 echo "killing umount"
244                 kill -TERM $UMOUNT_PID
245                 echo "waiting for umount to finish"
246                 wait $UMOUNT_PID
247                 grep " $MOUNT " /etc/mtab && echo "test 5: mtab after second umount" && return 11
248         fi
249
250         manual_umount_client
251         # stop_mds is a no-op here, and should not fail
252         cleanup_nocli || return $?
253         # df may have lingering entry
254         manual_umount_client
255         # mtab may have lingering entry
256         grep -v $MOUNT" " /etc/mtab > $TMP/mtabtemp
257         mv $TMP/mtabtemp /etc/mtab
258 }
259 run_test 5 "force cleanup mds, then cleanup"
260
261 test_5b() {
262         start_ost
263         [ -d $MOUNT ] || mkdir -p $MOUNT
264         grep " $MOUNT " /etc/mtab && echo "test 5b: mtab before mount" && return 10
265         mount_client $MOUNT && return 1
266         grep " $MOUNT " /etc/mtab && echo "test 5b: mtab after failed mount" && return 11
267         umount_client $MOUNT    
268         # stop_mds is a no-op here, and should not fail
269         cleanup_nocli || return $?
270         return 0
271 }
272 run_test 5b "mds down, cleanup after failed mount (bug 2712) (should return errs)"
273
274 test_5c() {
275         start_ost
276         start_mds
277         [ -d $MOUNT ] || mkdir -p $MOUNT
278         grep " $MOUNT " /etc/mtab && echo "test 5c: mtab before mount" && return 10
279         mount -t lustre $MGSNID:/wrong.$FSNAME $MOUNT || :
280         grep " $MOUNT " /etc/mtab && echo "test 5c: mtab after failed mount" && return 11
281         umount_client $MOUNT
282         cleanup_nocli  || return $?
283 }
284 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
285
286 test_5d() {
287         start_ost
288         start_mds
289         stop_ost -f
290         grep " $MOUNT " /etc/mtab && echo "test 5d: mtab before mount" && return 10
291         mount_client $MOUNT || return 1
292         cleanup  || return $?
293         grep " $MOUNT " /etc/mtab && echo "test 5d: mtab after unmount" && return 11
294         return 0
295 }
296 run_test 5d "mount with ost down"
297
298 test_5e() {
299         start_ost
300         start_mds
301         # give MDS a chance to connect to OSTs (bz 10476)
302         sleep 5 
303
304 #define OBD_FAIL_PTLRPC_DELAY_SEND       0x506
305         do_facet client "sysctl -w lustre.fail_loc=0x80000506"
306         grep " $MOUNT " /etc/mtab && echo "test 5e: mtab before mount" && return 10
307         mount_client $MOUNT || echo "mount failed (not fatal)"
308         cleanup  || return $?
309         grep " $MOUNT " /etc/mtab && echo "test 5e: mtab after unmount" && return 11
310         return 0
311 }
312 run_test 5e "delayed connect, don't crash (bug 10268)"
313
314 test_6() {
315         setup
316         manual_umount_client
317         mount_client ${MOUNT} || return 87
318         touch $DIR/a || return 86
319         cleanup  || return $?
320 }
321 run_test 6 "manual umount, then mount again"
322
323 test_7() {
324         setup
325         manual_umount_client
326         cleanup_nocli || return $?
327 }
328 run_test 7 "manual umount, then cleanup"
329
330 test_8() {
331         setup
332         mount_client $MOUNT2
333         check_mount2 || return 45
334         umount_client $MOUNT2
335         cleanup  || return $?
336 }
337 run_test 8 "double mount setup"
338
339 test_9() {
340         start_ost
341
342         do_facet ost1 sysctl lnet.debug=\'inode trace\' || return 1
343         do_facet ost1 sysctl lnet.subsystem_debug=\'mds ost\' || return 1
344
345         CHECK_PTLDEBUG="`do_facet ost1 sysctl -n lnet.debug`"
346         if [ "$CHECK_PTLDEBUG" ] && [ "$CHECK_PTLDEBUG" = "trace inode" ];then
347            echo "lnet.debug success"
348         else
349            echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
350            return 1
351         fi
352         CHECK_SUBSYS="`do_facet ost1 sysctl -n lnet.subsystem_debug`"
353         if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
354            echo "lnet.subsystem_debug success"
355         else
356            echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
357            return 1
358         fi
359         stop_ost || return $?
360 }
361
362 run_test 9 "test ptldebug and subsystem for mkfs"
363
364 test_10() {
365         echo "generate configuration with the same name for node and mds"
366         OLDXMLCONFIG=$XMLCONFIG
367         XMLCONFIG="broken.xml"
368         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
369         facet="mds"
370         rm -f ${facet}active
371         add_facet $facet
372         echo "the name for node and mds is the same"
373         do_lmc --add mds --node ${facet}_facet --mds ${facet}_facet \
374             --dev $MDSDEV --size $MDSSIZE || return $?
375         do_lmc --add lov --mds ${facet}_facet --lov lov1 --stripe_sz \
376             $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ \
377             --stripe_pattern 0 || return $?
378         add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE
379         facet="client"
380         add_facet $facet --lustre_upcall $UPCALL
381         do_lmc --add mtpt --node ${facet}_facet --mds mds_facet \
382             --lov lov1 --path $MOUNT
383
384         echo "mount lustre"
385         start_ost
386         start_mds
387         mount_client $MOUNT
388         check_mount || return 41
389         cleanup || return $?
390
391         echo "Success!"
392         XMLCONFIG=$OLDXMLCONFIG
393 }
394 run_test 10 "mount lustre with the same name for node and mds"
395
396 test_11() {
397         OLDXMLCONFIG=$XMLCONFIG
398         XMLCONFIG="conf11.xml"
399
400         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
401         add_mds mds --dev $MDSDEV --size $MDSSIZE
402         add_ost ost --dev $OSTDEV --size $OSTSIZE
403         add_client client mds --path $MOUNT --ost ost_svc || return $?
404         echo "Default lov config success!"
405
406         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
407         add_mds mds --dev $MDSDEV --size $MDSSIZE
408         add_ost ost --dev $OSTDEV --size $OSTSIZE
409         add_client client mds --path $MOUNT && return $?
410         echo "--add mtpt with neither --lov nor --ost will return error"
411
412         echo ""
413         echo "Success!"
414         XMLCONFIG=$OLDXMLCONFIG
415 }
416 run_test 11 "use default lov configuration (should return error)"
417
418 test_12() {
419         OLDXMLCONFIG=$XMLCONFIG
420         XMLCONFIG="batch.xml"
421         BATCHFILE="batchfile"
422
423         # test double quote
424         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
425         [ -f "$BATCHFILE" ] && rm -f $BATCHFILE
426         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
427         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions \"-I 128\"" >> $BATCHFILE
428         # --mkfsoptions "-I 128"
429         do_lmc -m $XMLCONFIG --batch $BATCHFILE || return $?
430         if [ `sed -n '/>-I 128</p' $XMLCONFIG | wc -l` -eq 1 ]; then
431                 echo "matched double quote success"
432         else
433                 echo "matched double quote fail"
434                 return 1
435         fi
436         rm -f $XMLCONFIG
437         rm -f $BATCHFILE
438         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
439         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions \"-I 128" >> $BATCHFILE
440         # --mkfsoptions "-I 128
441         do_lmc -m $XMLCONFIG --batch $BATCHFILE && return $?
442         echo "unmatched double quote should return error"
443
444         # test single quote
445         rm -f $BATCHFILE
446         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
447         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions '-I 128'" >> $BATCHFILE
448         # --mkfsoptions '-I 128'
449         do_lmc -m $XMLCONFIG --batch $BATCHFILE || return $?
450         if [ `sed -n '/>-I 128</p' $XMLCONFIG | wc -l` -eq 1 ]; then
451                 echo "matched single quote success"
452         else
453                 echo "matched single quote fail"
454                 return 1
455         fi
456         rm -f $XMLCONFIG
457         rm -f $BATCHFILE
458         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
459         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions '-I 128" >> $BATCHFILE
460         # --mkfsoptions '-I 128
461         do_lmc -m $XMLCONFIG --batch $BATCHFILE && return $?
462         echo "unmatched single quote should return error"
463
464         # test backslash
465         rm -f $BATCHFILE
466         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
467         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions \-\I\ \128" >> $BATCHFILE
468         # --mkfsoptions \-\I\ \128
469         do_lmc -m $XMLCONFIG --batch $BATCHFILE || return $?
470         if [ `sed -n '/>-I 128</p' $XMLCONFIG | wc -l` -eq 1 ]; then
471                 echo "backslash followed by a whitespace/letter success"
472         else
473                 echo "backslash followed by a whitespace/letter fail"
474                 return 1
475         fi
476         rm -f $XMLCONFIG
477         rm -f $BATCHFILE
478         echo "--add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp" > $BATCHFILE
479         echo "--add mds --node $HOSTNAME --mds mds1 --mkfsoptions -I\ 128\\" >> $BATCHFILE
480         # --mkfsoptions -I\ 128\
481         do_lmc -m $XMLCONFIG --batch $BATCHFILE && return $?
482         echo "backslash followed by nothing should return error"
483
484         rm -f $BATCHFILE
485         XMLCONFIG=$OLDXMLCONFIG
486 }
487 run_test 12 "lmc --batch, with single/double quote, backslash in batchfile"
488
489 test_13() {
490         OLDXMLCONFIG=$XMLCONFIG
491         XMLCONFIG="conf13-1.xml"
492
493         # check long uuid will be truncated properly and uniquely
494         echo "To generate XML configuration file(with long ost name): $XMLCONFIG"
495         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
496         do_lmc --add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp
497         do_lmc --add mds --node $HOSTNAME --mds mds1_name_longer_than_31characters
498         do_lmc --add mds --node $HOSTNAME --mds mds2_name_longer_than_31characters
499         if [ ! -f "$XMLCONFIG" ]; then
500                 echo "Error:no file $XMLCONFIG created!"
501                 return 1
502         fi
503         EXPECTEDMDS1UUID="e_longer_than_31characters_UUID"
504         EXPECTEDMDS2UUID="longer_than_31characters_UUID_2"
505         FOUNDMDS1UUID=`awk -F"'" '/<mds .*uuid=/' $XMLCONFIG | sed -n '1p' \
506                        | sed "s/ /\n\r/g" | awk -F"'" '/uuid=/{print $2}'`
507         FOUNDMDS2UUID=`awk -F"'" '/<mds .*uuid=/' $XMLCONFIG | sed -n '2p' \
508                        | sed "s/ /\n\r/g" | awk -F"'" '/uuid=/{print $2}'`
509         [ -z "$FOUNDMDS1UUID" ] && echo "MDS1 UUID empty" && return 1
510         [ -z "$FOUNDMDS2UUID" ] && echo "MDS2 UUID empty" && return 1
511         if ([ $EXPECTEDMDS1UUID = $FOUNDMDS1UUID ] && [ $EXPECTEDMDS2UUID = $FOUNDMDS2UUID ]) || \
512            ([ $EXPECTEDMDS1UUID = $FOUNDMDS2UUID ] && [ $EXPECTEDMDS2UUID = $FOUNDMDS1UUID ]); then
513                 echo "Success:long uuid truncated successfully and being unique."
514         else
515                 echo "Error:expected uuid for mds1 and mds2: $EXPECTEDMDS1UUID; $EXPECTEDMDS2UUID"
516                 echo "but:     found uuid for mds1 and mds2: $FOUNDMDS1UUID; $FOUNDMDS2UUID"
517                 return 1
518         fi
519         rm -f $XMLCONFIG
520         XMLCONFIG=$OLDXMLCONFIG
521 }
522 run_test 13 "check new_uuid of lmc operating correctly"
523
524 test_13b() {
525         OLDXMLCONFIG=$XMLCONFIG
526         XMLCONFIG="conf13-1.xml"
527         SECONDXMLCONFIG="conf13-2.xml"
528         # check multiple invocations for lmc generate same XML configuration file
529         rm -f $XMLCONFIG
530         echo "Generate the first XML configuration file"
531         gen_config
532         echo "mv $XMLCONFIG to $SECONDXMLCONFIG"
533         sed -e "s/mtime[^ ]*//" $XMLCONFIG > $SECONDXMLCONFIG || return $?
534         echo "Generate the second XML configuration file"
535         gen_config
536         # don't compare .xml mtime, it will always be different
537         if [ `sed -e "s/mtime[^ ]*//" $XMLCONFIG | diff - $SECONDXMLCONFIG | wc -l` -eq 0 ]; then
538                 echo "Success:multiple invocations for lmc generate same XML file"
539         else
540                 echo "Error: multiple invocations for lmc generate different XML file"
541                 return 1
542         fi
543
544         rm -f $XMLCONFIG $SECONDXMLCONFIG
545         XMLCONFIG=$OLDXMLCONFIG
546 }
547 run_test 13b "check lmc generates consistent .xml file"
548
549 test_14() {
550         rm -f $XMLCONFIG
551
552         # create xml file with --mkfsoptions for ost
553         echo "create xml file with --mkfsoptions for ost"
554         add_mds mds --dev $MDSDEV --size $MDSSIZE
555         add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
556             --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
557         add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE \
558             --mkfsoptions "-Llabel_conf_14"
559         add_client client mds --lov lov1 --path $MOUNT
560
561         FOUNDSTRING=`awk -F"<" '/<mkfsoptions>/{print $2}' $XMLCONFIG`
562         EXPECTEDSTRING="mkfsoptions>-Llabel_conf_14"
563         if [ "$EXPECTEDSTRING" != "$FOUNDSTRING" ]; then
564                 echo "Error: expected: $EXPECTEDSTRING; found: $FOUNDSTRING"
565                 return 1
566         fi
567         echo "Success:mkfsoptions for ost written to xml file correctly."
568
569         # mount lustre to test lconf mkfsoptions-parsing
570         echo "mount lustre"
571         start_ost
572         start_mds
573         mount_client $MOUNT || return $?
574         if [ -z "`do_facet ost1 dumpe2fs -h $OSTDEV | grep label_conf_14`" ]; then
575                 echo "Error: the mkoptions not applied to mke2fs of ost."
576                 return 1
577         fi
578         cleanup
579         echo "lconf mkfsoptions for ost success"
580
581         gen_config
582 }
583 run_test 14 "test mkfsoptions of ost for lmc and lconf"
584
585 cleanup_15() {
586         trap 0
587         [ -f $MOUNTLUSTRE ] && echo "remove $MOUNTLUSTRE" && rm -f $MOUNTLUSTRE
588         if [ -f $MOUNTLUSTRE.sav ]; then
589                 echo "return original $MOUNTLUSTRE.sav to $MOUNTLUSTRE"
590                 mv $MOUNTLUSTRE.sav $MOUNTLUSTRE
591         fi
592 }
593
594 # this only tests the kernel mount command, not anything about lustre.
595 test_15() {
596         MOUNTLUSTRE=${MOUNTLUSTRE:-/sbin/mount.lustre}
597         start_ost
598         start_mds
599
600         echo "mount lustre on ${MOUNT} without $MOUNTLUSTRE....."
601         if [ -f "$MOUNTLUSTRE" ]; then
602                 echo "save $MOUNTLUSTRE to $MOUNTLUSTRE.sav"
603                 mv $MOUNTLUSTRE $MOUNTLUSTRE.sav && trap cleanup_15 EXIT INT
604                 if [ -f $MOUNTLUSTRE ]; then
605                         echo "$MOUNTLUSTRE cannot be moved, skipping test"
606                         return 0
607                 fi
608         fi
609
610         mount_client $MOUNT && error "mount succeeded" && return 1
611         echo "mount lustre on $MOUNT without $MOUNTLUSTRE failed as expected"
612         cleanup_15
613         cleanup || return $?
614 }
615 run_test 15 "zconf-mount without /sbin/mount.lustre (should return error)"
616
617 test_16() {
618         TMPMTPT="${MOUNT%/*}/conf16"
619
620         if [ ! -e "$MDSDEV" ]; then
621             log "no $MDSDEV existing, so mount Lustre to create one"
622             setup
623             check_mount || return 41
624             cleanup || return $?
625         fi
626
627         [ -f "$MDSDEV" ] && LOOPOPT="-o loop"
628
629         log "change the mode of $MDSDEV/OBJECTS,LOGS,PENDING to 555"
630         do_facet mds "mkdir -p $TMPMTPT &&
631                       mount $LOOPOPT -t $FSTYPE $MDSDEV $TMPMTPT &&
632                       chmod 555 $TMPMTPT/{OBJECTS,LOGS,PENDING} &&
633                       umount $TMPMTPT" || return $?
634
635         log "mount Lustre to change the mode of OBJECTS/LOGS/PENDING, then umount Lustre"
636         setup
637         check_mount || return 41
638         cleanup || return $?
639
640         log "read the mode of OBJECTS/LOGS/PENDING and check if they has been changed properly"
641         EXPECTEDOBJECTSMODE=`do_facet mds "debugfs -R 'stat OBJECTS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
642         EXPECTEDLOGSMODE=`do_facet mds "debugfs -R 'stat LOGS' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
643         EXPECTEDPENDINGMODE=`do_facet mds "debugfs -R 'stat PENDING' $MDSDEV 2> /dev/null" | grep 'Mode: ' | sed -e "s/.*Mode: *//" -e "s/ *Flags:.*//"`
644
645         if [ "$EXPECTEDOBJECTSMODE" = "0777" ]; then
646                 log "Success:Lustre change the mode of OBJECTS correctly"
647         else
648                 error "Lustre does not change mode of OBJECTS properly"
649         fi
650
651         if [ "$EXPECTEDLOGSMODE" = "0777" ]; then
652                 log "Success:Lustre change the mode of LOGS correctly"
653         else
654                 error "Lustre does not change mode of LOGS properly"
655         fi
656
657         if [ "$EXPECTEDPENDINGMODE" = "0777" ]; then
658                 log "Success:Lustre change the mode of PENDING correctly"
659         else
660                 error "Lustre does not change mode of PENDING properly"
661         fi
662 }
663 run_test 16 "verify that lustre will correct the mode of OBJECTS/LOGS/PENDING"
664
665 test_17() {
666         if [ ! -e "$MDSDEV" ]; then
667             echo "no $MDSDEV existing, so mount Lustre to create one"
668             setup
669             check_mount || return 41
670             cleanup || return $?
671         fi
672
673         echo "Remove mds config log"
674         do_facet mds "debugfs -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MDSDEV || return \$?" || return $?
675
676         start_ost
677         start_mds && return 42
678         gen_config
679 }
680 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
681
682 test_18() {
683         [ -f $MDSDEV ] && echo "remove $MDSDEV" && rm -f $MDSDEV
684         echo "mount mds with large journal..."
685         OLDMDSSIZE=$MDSSIZE
686         MDSSIZE=2000000
687         #FIXME have to change MDS_MKFS_OPTS
688         gen_config
689
690         echo "mount lustre system..."
691         setup
692         check_mount || return 41
693
694         echo "check journal size..."
695         FOUNDSIZE=`do_facet mds "debugfs -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}'`
696         if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
697                 log "Success: mkfs creates large journals"
698         else
699                 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
700         fi
701
702         cleanup || return $?
703
704         MDSSIZE=$OLDMDSSIZE
705         gen_config
706 }
707 run_test 18 "check mkfs creates large journals"
708
709 test_19a() {
710         start_mds || return 1
711         stop_mds -f || return 2
712 }
713 run_test 19a "start/stop MDS without OSTs"
714
715 test_19b() {
716         start_ost || return 1
717         stop_ost -f || return 2
718 }
719 run_test 19b "start/stop OSTs without MDS"
720
721 test_20() {
722         # first format the ost/mdt
723         start_ost
724         start_mds
725         mount_client $MOUNT
726         check_mount || return 43
727         rm -f $DIR/$tfile
728         remount_client ro $MOUNT || return 44
729         touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
730         [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
731         remount_client rw $MOUNT || return 47
732         touch $DIR/$tfile
733         [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
734         MCNT=`grep -c $MOUNT /etc/mtab`
735         [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
736         umount_client $MOUNT
737         stop_mds
738         stop_ost
739 }
740 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
741
742 test_21a() {
743         start_mds
744         start_ost
745         stop_ost
746         stop_mds
747 }
748 run_test 21a "start mds before ost, stop ost first"
749
750 test_21b() {
751         start_ost
752         start_mds
753         stop_mds
754         stop_ost
755 }
756 run_test 21b "start ost before mds, stop mds first"
757
758 test_21c() {
759         start_ost
760         start_mds
761         start_ost2
762         stop_ost
763         stop_ost2
764         stop_mds
765 }
766 run_test 21c "start mds between two osts, stop mds last"
767
768 test_22() {
769         #reformat to remove all logs
770         reformat
771         start_mds
772         echo Client mount before any osts are in the logs
773         mount_client $MOUNT
774         check_mount && return 41
775         pass
776
777         echo Client mount with ost in logs, but none running
778         start_ost
779         stop_ost
780         mount_client $MOUNT
781         # check_mount will block trying to contact ost
782         umount_client $MOUNT
783         pass
784
785         echo Client mount with a running ost
786         start_ost
787         mount_client $MOUNT
788         sleep 5 #bz10476
789         check_mount || return 41
790         pass
791
792         cleanup
793 }
794 run_test 22 "start a client before osts (should return errs)"
795
796 test_23() {
797         setup
798         # fail mds
799         stop mds   
800         # force down client so that recovering mds waits for reconnect
801         zconf_umount `hostname` $MOUNT -f
802         # enter recovery on mds
803         start_mds
804         # try to start a new client
805         mount_client $MOUNT &
806         MOUNT_PID=$!
807         sleep 5
808         MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
809         echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
810         ps --ppid $MOUNT_PID
811         ps --ppid $MOUNT_LUSTRE_PID
812         # FIXME why o why can't I kill these? Manual "ctrl-c" works...
813         kill -TERM $MOUNT_PID
814         echo "waiting for mount to finish"
815         ps -ef | grep mount
816         wait $MOUNT_PID
817
818         stop_mds
819         stop_ost
820 }
821 #this test isn't working yet
822 #run_test 23 "interrupt client during recovery mount delay"
823
824 test_24a() {
825         local fs2mds_HOST=$mds_HOST
826         local fs2ost_HOST=$ost_HOST
827
828         [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \
829             log "mixed loopback and real device not working" && return
830
831         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
832         local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
833
834         # test 8-char fsname as well
835         local FSNAME2=test1234
836         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --nomgs --mgsnode=$MGSNID --reformat $fs2mdsdev || exit 10
837
838         add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2ostdev || exit 10
839
840         setup
841         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
842         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
843         mkdir -p $MOUNT2
844         mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
845         # 1 still works
846         check_mount || return 2
847         # files written on 1 should not show up on 2
848         cp /etc/passwd $DIR/$tfile
849         sleep 10
850         [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
851         # 2 should work
852         sleep 5
853         cp /etc/passwd $MOUNT2/b || return 3
854         rm $MOUNT2/b || return 4
855         # 2 is actually mounted
856         grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
857         # failover 
858         facet_failover fs2mds
859         facet_failover fs2ost
860         df
861         umount_client $MOUNT 
862         # the MDS must remain up until last MDT
863         stop_mds
864         MDS=$(awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' $LPROC/devices)
865         [ -z "$MDS" ] && error "No MDT" && return 8
866         umount $MOUNT2
867         stop fs2mds -f
868         stop fs2ost -f
869         cleanup_nocli || return 6
870 }
871 run_test 24a "Multiple MDTs on a single node"
872
873 test_24b() {
874         local fs2mds_HOST=$mds_HOST
875         [ -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \
876             log "mixed loopback and real device not working" && return
877
878         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
879
880         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME}2 --mgs --reformat $fs2mdsdev || exit 10 
881         setup
882         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
883         cleanup || return 6
884 }
885 run_test 24b "Multiple MGSs on a single node (should return err)"
886
887 test_25() {
888         setup
889         check_mount || return 2
890         local MODULES=$($LCTL modules | awk '{ print $2 }')
891         rmmod $MODULES 2>/dev/null || true
892         cleanup || return 6
893 }
894 run_test 25 "Verify modules are referenced"
895
896 test_26() {
897     load_modules
898     # we need modules before mount for sysctl, so make sure...
899     [ -z "$(lsmod | grep lustre)" ] && modprobe lustre 
900 #define OBD_FAIL_MDS_FS_SETUP            0x135
901     do_facet mds "sysctl -w lustre.fail_loc=0x80000135"
902     start_mds && echo MDS started && return 1
903     cat $LPROC/devices
904     DEVS=$(cat $LPROC/devices | wc -l)
905     [ $DEVS -gt 0 ] && return 2
906     unload_modules || return 203
907 }
908 run_test 26 "MDT startup failure cleans LOV (should return errs)"
909
910 set_and_check() {
911         local TEST=$1
912         local PARAM=$2
913         local ORIG=$($TEST) 
914         if [ $# -gt 2 ]; then
915             local FINAL=$3
916         else
917             local -i FINAL
918             FINAL=$(($ORIG + 5))
919         fi
920         echo "Setting $PARAM from $ORIG to $FINAL"
921         $LCTL conf_param $PARAM=$FINAL
922         local RESULT
923         local MAX=20
924         local WAIT=0
925         while [ 1 ]; do
926             sleep 5
927             RESULT=$($TEST) 
928             if [ $RESULT -eq $FINAL ]; then
929                 echo "Updated config after $WAIT sec (got $RESULT)"
930                 break
931             fi
932             WAIT=$((WAIT + 5))
933             if [ $WAIT -eq $MAX ]; then
934                 echo "Config update not seen: wanted $FINAL got $RESULT"
935                 return 3
936             fi
937             echo "Waiting $(($MAX - $WAIT)) secs for config update" 
938         done
939 }
940
941 test_27a() {
942         start_ost || return 1
943         start_mds || return 2
944         echo "Requeue thread should have started: " 
945         ps -e | grep ll_cfg_requeue 
946         set_and_check "cat $LPROC/obdfilter/$FSNAME-OST0000/client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3 
947         cleanup_nocli
948 }
949 run_test 27a "Reacquire MGS lock if OST started first"
950
951 test_27b() {
952         setup
953         facet_failover mds
954         set_and_check "cat $LPROC/mdt/$FSNAME-MDT0000/identity_acquire_expire" "$FSNAME-MDT0000.mdt.identity_acquire_expire" || return 3
955         set_and_check "cat $LPROC/mdc/$FSNAME-MDT0000-mdc-*/max_rpcs_in_flight" "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4
956         cleanup
957 }
958 run_test 27b "Reacquire MGS lock after failover"
959
960 test_28() {
961         setup
962         TEST="cat $LPROC/llite/$FSNAME-*/max_read_ahead_whole_mb"
963         ORIG=$($TEST) 
964         declare -i FINAL
965         FINAL=$(($ORIG + 10))
966         set_and_check "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" || return 3
967         set_and_check "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" || return 3
968         umount_client $MOUNT || return 200
969         mount_client $MOUNT
970         RESULT=$($TEST)
971         if [ $RESULT -ne $FINAL ]; then
972             echo "New config not seen: wanted $FINAL got $RESULT"
973             return 4
974         else
975             echo "New config success: got $RESULT"
976         fi
977         cleanup
978 }
979 run_test 28 "permanent parameter setting"
980
981 test_29() {
982         [ "$OSTCOUNT" -lt "2" ] && echo "skipping deactivate test" && return
983         setup > /dev/null 2>&1
984         start_ost2
985         sleep 10
986
987         local PARAM="$FSNAME-OST0001.osc.active"
988         local PROC_ACT="$LPROC/osc/$FSNAME-OST0001-osc-[^M]*/active"
989         local PROC_UUID="$LPROC/osc/$FSNAME-OST0001-osc-[^M]*/ost_server_uuid"
990         if [ ! -r $PROC_ACT ]; then
991             echo "Can't read $PROC_ACT"
992             ls $LPROC/osc/$FSNAME-*
993             return 1
994         fi
995         ACTV=$(cat $PROC_ACT)
996         DEAC=$((1 - $ACTV))
997         set_and_check "cat $PROC_ACT" "$PARAM" $DEAC || return 2
998         # also check ost_server_uuid status
999         RESULT=$(grep DEACTIV $PROC_UUID)
1000         if [ -z "$RESULT" ]; then
1001             echo "Live client not deactivated: $(cat $PROC_UUID)"
1002             return 3
1003         else
1004             echo "Live client success: got $RESULT"
1005         fi
1006
1007         # check MDT too 
1008         local MPROC="$LPROC/osc/$FSNAME-OST0001-osc-[M]*/active"
1009         if [ -r $MPROC ]; then
1010             RESULT=$(cat $MPROC)
1011             if [ $RESULT -ne $DEAC ]; then
1012                 echo "MDT not deactivated: $(cat $MPROC)"
1013                 return 4
1014             fi
1015             echo "MDT deactivated also"
1016         fi
1017
1018         # test new client starts deactivated
1019         umount_client $MOUNT || return 200
1020         mount_client $MOUNT
1021         RESULT=$(grep DEACTIV $PROC_UUID | grep NEW)
1022         if [ -z "$RESULT" ]; then
1023             echo "New client not deactivated from start: $(cat $PROC_UUID)"
1024             return 5
1025         else
1026             echo "New client success: got $RESULT"
1027         fi
1028
1029         # make sure it reactivates
1030         set_and_check "cat $PROC_ACT" "$PARAM" $ACTV || return 6
1031
1032         umount_client $MOUNT
1033         stop_ost2
1034         cleanup_nocli
1035         #writeconf to remove all ost2 traces for subsequent tests
1036         writeconf
1037 }
1038 run_test 29 "permanently remove an OST"
1039
1040 test_30() {
1041         # start mds first after writeconf
1042         start_mds
1043         start_ost
1044         mount_client $MOUNT
1045         TEST="cat $LPROC/llite/$FSNAME-*/max_read_ahead_whole_mb"
1046         ORIG=$($TEST) 
1047         for i in $(seq 1 20); do 
1048             set_and_check "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
1049         done
1050         # make sure client restart still works 
1051         umount_client $MOUNT
1052         mount_client $MOUNT || return 4
1053         [ "$($TEST)" -ne "$i" ] && return 5   
1054         set_and_check "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $ORIG || return 6
1055         cleanup
1056 }
1057 run_test 30 "Big config llog"
1058
1059 test_31() { # bug 10734
1060         # ipaddr must not exist
1061         mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
1062         cleanup
1063 }
1064 run_test 31 "Connect to non-existent node (shouldn't crash)"
1065
1066 test_32a() {
1067         [ -z "$TUNEFS" ] && echo "No tunefs" && return
1068         [ ! -r disk1_4.zip ] && echo "Cant find disk1_4.zip, skipping" && return
1069         unzip -o -j -d $TMP/$tdir disk1_4.zip || { echo "Cant unzip disk1_4, skipping" && return ; }
1070         load_modules
1071         sysctl lnet.debug=$PTLDEBUG
1072
1073         $TUNEFS $TMP/$tdir/mds || error "tunefs failed"
1074         # nids are wrong, so client wont work, but server should start
1075         start mds $TMP/$tdir/mds "-o loop,exclude=lustre-OST0000" || return 3
1076         local UUID=$(cat $LPROC/mds/lustre-MDT0000/uuid)
1077         echo MDS uuid $UUID
1078         [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID" 
1079
1080         $TUNEFS --mgsnode=`hostname` $TMP/$tdir/ost1 || error "tunefs failed"
1081         start ost1 $TMP/$tdir/ost1 "-o loop" || return 5
1082         UUID=$(cat $LPROC/obdfilter/lustre-OST0000/uuid)
1083         echo OST uuid $UUID
1084         [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID" 
1085
1086         local NID=$($LCTL list_nids | head -1)
1087
1088         echo "OSC changes should return err:" 
1089         $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 && return 7
1090         $LCTL conf_param lustre-OST0000.failover.node=$NID && return 8
1091         echo "ok."
1092         echo "MDC changes should succeed:" 
1093         $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1094         $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1095         echo "ok."
1096
1097         # With a new good MDT failover nid, we should be able to mount a client
1098         # (but it cant talk to OST)
1099         local OLDMOUNTOPT=$MOUNTOPT
1100         MOUNTOPT="exclude=lustre-OST0000"
1101         mount_client $MOUNT
1102         MOUNTOPT=$OLDMOUNTOPT
1103         set_and_check "cat $LPROC/mdc/*/max_rpcs_in_flight" "lustre-MDT0000.mdc.max_rpcs_in_flight" || return 11
1104
1105         zconf_umount `hostname` $MOUNT -f
1106         cleanup_nocli
1107
1108         # mount a second time to make sure we didnt leave upgrade flag on
1109         $TUNEFS --dryrun $TMP/$tdir/mds || error "tunefs failed"
1110         start mds $TMP/$tdir/mds "-o loop,exclude=lustre-OST0000" || return 12
1111         cleanup_nocli
1112
1113         [ -d $TMP/$tdir ] && rm -rf $TMP/$tdir
1114 }
1115 run_test 32a "Upgrade from 1.4 (not live)"
1116
1117 test_32b() {
1118         [ -z "$TUNEFS" ] && echo "No tunefs" && return
1119         [ ! -r disk1_4.zip ] && echo "Cant find disk1_4.zip, skipping" && return
1120         unzip -o -j -d $TMP/$tdir disk1_4.zip || { echo "Cant unzip disk1_4, skipping" && return ; }
1121         load_modules
1122         sysctl lnet.debug=$PTLDEBUG
1123
1124         # writeconf will cause servers to register with their current nids
1125         $TUNEFS --writeconf $TMP/$tdir/mds || error "tunefs failed"
1126         start mds $TMP/$tdir/mds "-o loop" || return 3
1127         local UUID=$(cat $LPROC/mds/lustre-MDT0000/uuid)
1128         echo MDS uuid $UUID
1129         [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID" 
1130
1131         $TUNEFS --mgsnode=`hostname` $TMP/$tdir/ost1 || error "tunefs failed"
1132         start ost1 $TMP/$tdir/ost1 "-o loop" || return 5
1133         UUID=$(cat $LPROC/obdfilter/lustre-OST0000/uuid)
1134         echo OST uuid $UUID
1135         [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID" 
1136
1137         echo "OSC changes should succeed:" 
1138         $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1139         $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1140         echo "ok."
1141         echo "MDC changes should succeed:" 
1142         $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1143         echo "ok."
1144
1145         # MDT and OST should have registered with new nids, so we should have
1146         # a fully-functioning client
1147         echo "Check client and old fs contents"
1148         mount_client $MOUNT
1149         set_and_check "cat $LPROC/mdc/*/max_rpcs_in_flight" "lustre-MDT0000.mdc.max_rpcs_in_flight" || return 11
1150         [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2479747619 779" ] || return 12  
1151         echo "ok."
1152
1153         cleanup
1154         [ -d $TMP/$tdir ] && rm -rf $TMP/$tdir
1155 }
1156 run_test 32b "Upgrade from 1.4 with writeconf"
1157
1158 test_33() { # bug 12333
1159         local FSNAME2=test1234
1160         local fs2mds_HOST=$mds_HOST
1161         local fs2ost_HOST=$ost_HOST
1162
1163         [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ] && [ -b "$MDSDEV" ] && \
1164             log "mixed loopback and real device not working" && return
1165
1166         local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
1167         local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
1168         add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
1169         add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=`hostname`@tcp --reformat $fs2ostdev || exit 10
1170
1171         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1172         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1173         mkdir -p $MOUNT2
1174         mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1175         echo "ok."
1176
1177         umount -d $MOUNT2
1178         stop fs2ost -f
1179         stop fs2mds -f
1180         rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
1181         cleanup_nocli || return 6
1182 }
1183 run_test 33 "Mount ost with a large index number"
1184
1185 umount_client $MOUNT    
1186 cleanup_nocli
1187 cleanup_krb5_env
1188
1189 equals_msg "Done"
1190 echo "$0: completed"