3 # Run select tests by setting ONLY, or as arguments to the script.
4 # Skip specific tests by setting EXCEPT.
6 # e.g. ONLY="22 23" or ONLY="`seq 32 39`" or EXCEPT="31"
10 # bug number for skipped test: 1979
11 ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"42b"}
12 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
15 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
17 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
18 CREATETEST=${CREATETEST:-createtest}
20 LSTRIPE=${LSTRIPE:-lstripe}
22 MCREATE=${MCREATE:-mcreate}
23 OPENFILE=${OPENFILE:-openfile}
24 OPENUNLINK=${OPENUNLINK:-openunlink}
25 TOEXCL=${TOEXCL:-toexcl}
26 TRUNCATE=${TRUNCATE:-truncate}
27 MUNLINK=${MUNLINK:-munlink}
28 SOCKETSERVER=${SOCKETSERVER:-socketserver}
29 SOCKETCLIENT=${SOCKETCLIENT:-socketclient}
31 if [ $UID -ne 0 ]; then
35 RUNAS_ID=${RUNAS_ID:-500}
36 RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
39 export NAME=${NAME:-local}
45 sh llmountcleanup.sh > /dev/null || exit 20
52 sh llrmount.sh > /dev/null || exit 10
60 lctl mark "$*" 2> /dev/null || true
64 if ! mount | grep -q $DIR; then
68 test_$1 || error "test_$1: $?"
78 for E in $EXCEPT $ALWAYS_EXCEPT; do
88 IFS=abcdefghijklmnopqrstuvwxyz _basetest $1
95 if [ ${!testname}x != x ]; then
100 if [ ${!testname}x != x ]; then
108 if [ ${!testname}x != x ]; then
109 echo "skipping excluded test $1"
112 testname=EXCEPT_$base
113 if [ ${!testname}x != x ]; then
114 echo "skipping excluded test $1 (base $base)"
121 [ "$SANITYLOG" ] && rm -f $SANITYLOG || true
125 if [ "$SANITYLOG" ]; then
126 echo "FAIL: $@" >> $SANITYLOG
136 MOUNT="`mount | awk '/^'$NAME' .* lustre_lite / { print $3 }'`"
137 if [ -z "$MOUNT" ]; then
139 MOUNT="`mount | awk '/^'$NAME' .* lustre_lite / { print $3 }'`"
140 [ -z "$MOUNT" ] && error "NAME=$NAME not mounted"
144 [ `echo $MOUNT | wc -w` -gt 1 ] && error "NAME=$NAME mounted more than once"
147 [ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 99
149 LOVNAME=`cat /proc/fs/lustre/llite/fs0/lov/common_name`
150 STRIPECOUNT=`cat /proc/fs/lustre/lov/$LOVNAME/numobd`
152 [ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
153 [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
154 rm -rf $DIR/[Rdfs][1-9]*
158 echo preparing for tests involving mounts
159 EXT2_DEV=${EXT2_DEV:-/tmp/SANITY.LOOP}
161 mke2fs -F $EXT2_DEV 1000 > /dev/null
165 $CHECKSTAT -t file $DIR/f || error
167 $CHECKSTAT -a $DIR/f || error
169 run_test 0 "touch .../f ; rm .../f ============================="
174 $CHECKSTAT -t dir $DIR/d1/d2 || error
176 run_test 1a "mkdir .../d1; mkdir .../d1/d2 ====================="
181 $CHECKSTAT -a $DIR/d1 || error
183 run_test 1b "rmdir .../d1/d2; rmdir .../d1 ====================="
188 $CHECKSTAT -t file $DIR/d2/f || error
190 run_test 2a "mkdir .../d2; touch .../d2/f ======================"
194 $CHECKSTAT -a $DIR/d2 || error
196 run_test 2b "rm -r .../d2; checkstat .../d2/f ======================"
200 $CHECKSTAT -t dir $DIR/d3 || error
202 run_test 3a "mkdir .../d3 ======================================"
205 if [ ! -d $DIR/d3 ]; then
209 $CHECKSTAT -t file $DIR/d3/f || error
211 run_test 3b "touch .../d3/f ===================================="
215 $CHECKSTAT -a $DIR/d3 || error
217 run_test 3c "rm -r .../d3 ======================================"
221 $CHECKSTAT -t dir $DIR/d4 || error
223 run_test 4a "mkdir .../d4 ======================================"
226 if [ ! -d $DIR/d4 ]; then
230 $CHECKSTAT -t dir $DIR/d4/d2 || error
232 run_test 4b "mkdir .../d4/d2 ==================================="
237 chmod 0707 $DIR/d5/d2
238 $CHECKSTAT -t dir -p 0707 $DIR/d5/d2 || error
240 run_test 5 "mkdir .../d5 .../d5/d2; chmod .../d5/d2 ============"
244 chmod 0666 $DIR/f6a || error
245 $CHECKSTAT -t file -p 0666 -u \#$UID $DIR/f6a || error
247 run_test 6a "touch .../f6a; chmod .../f6a ======================"
250 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6b" && return
251 if [ ! -f $DIR/f6a ]; then
255 $RUNAS chmod 0444 $DIR/f6a && error
256 $CHECKSTAT -t file -p 0666 -u \#$UID $DIR/f6a || error
258 run_test 6b "$RUNAS chmod .../f6a (should return error) =="
261 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6c" && return
263 chown $RUNAS_ID $DIR/f6c || error
264 $CHECKSTAT -t file -u \#$RUNAS_ID $DIR/f6c || error
266 run_test 6c "touch .../f6c; chown .../f6c ======================"
269 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6d" && return
270 if [ ! -f $DIR/f6c ]; then
272 chown $RUNAS_ID $DIR/f6c
274 $RUNAS chown $UID $DIR/f6c && error
275 $CHECKSTAT -t file -u \#$RUNAS_ID $DIR/f6c || error
277 run_test 6d "$RUNAS chown .../f6c (should return error) =="
280 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6e" && return
282 chgrp $RUNAS_ID $DIR/f6e || error
283 $CHECKSTAT -t file -u \#$UID -g \#$RUNAS_ID $DIR/f6e || error
285 run_test 6e "touch .../f6e; chgrp .../f6e ======================"
288 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6f" && return
289 if [ ! -f $DIR/f6e ]; then
291 chgrp $RUNAS_ID $DIR/f6e
293 $RUNAS chgrp $UID $DIR/f6e && error
294 $CHECKSTAT -t file -u \#$UID -g \#$RUNAS_ID $DIR/f6e || error
296 run_test 6f "$RUNAS chgrp .../f6e (should return error) =="
299 [ $RUNAS_ID -eq $UID ] && echo "skipping test 6g" && return
300 mkdir $DIR/d6g || error
301 chmod 777 $DIR/d6g || error
302 $RUNAS mkdir $DIR/d6g/d || error
303 chmod g+s $DIR/d6g/d || error
304 mkdir $DIR/d6g/d/subdir
305 $CHECKSTAT -g \#$RUNAS_ID $DIR/d6g/d/subdir || error
307 run_test 6g "Is new dir in sgid dir inheriting group?"
313 $CHECKSTAT -t file -p 0666 $DIR/d7/f || error
315 run_test 7a "mkdir .../d7; mcreate .../d7/f; chmod .../d7/f ===="
318 if [ ! -d $DIR/d7 ]; then
322 echo -n foo > $DIR/d7/f2
323 [ "`cat $DIR/d7/f2`" = "foo" ] || error
324 $CHECKSTAT -t file -s 3 $DIR/d7/f2 || error
326 run_test 7b "mkdir .../d7; mcreate d7/f2; echo foo > d7/f2 ====="
332 $CHECKSTAT -t file -p 0666 $DIR/d8/f || error
334 run_test 8 "mkdir .../d8; touch .../d8/f; chmod .../d8/f ======="
340 $CHECKSTAT -t dir $DIR/d9/d2/d3 || error
342 run_test 9 "mkdir .../d9 .../d9/d2 .../d9/d2/d3 ================"
348 $CHECKSTAT -t file $DIR/d10/d2/f || error
350 run_test 10 "mkdir .../d10 .../d10/d2; touch .../d10/d2/f ======"
355 chmod 0666 $DIR/d11/d2
356 chmod 0705 $DIR/d11/d2
357 $CHECKSTAT -t dir -p 0705 $DIR/d11/d2 || error
359 run_test 11 "mkdir .../d11 d11/d2; chmod .../d11/d2 ============"
364 chmod 0666 $DIR/d12/f
365 chmod 0654 $DIR/d12/f
366 $CHECKSTAT -t file -p 0654 $DIR/d12/f || error
368 run_test 12 "touch .../d12/f; chmod .../d12/f .../d12/f ========"
372 dd if=/dev/zero of=$DIR/d13/f count=10
374 $CHECKSTAT -t file -s 0 $DIR/d13/f || error
376 run_test 13 "creat .../d13/f; dd .../d13/f; > .../d13/f ========"
382 $CHECKSTAT -a $DIR/d14/f || error
384 run_test 14 "touch .../d14/f; rm .../d14/f; rm .../d14/f ======="
389 mv $DIR/d15/f $DIR/d15/f2
390 $CHECKSTAT -t file $DIR/d15/f2 || error
392 run_test 15 "touch .../d15/f; mv .../d15/f .../d15/f2 =========="
398 $CHECKSTAT -a $DIR/d16/f || error
400 run_test 16 "touch .../d16/f; rm -rf .../d16/f ================="
405 ln -s $DIR/d17/f $DIR/d17/l-exist
407 $CHECKSTAT -l $DIR/d17/f $DIR/d17/l-exist || error
408 $CHECKSTAT -f -t f $DIR/d17/l-exist || error
410 $CHECKSTAT -a $DIR/l-exist || error
412 run_test 17a "symlinks: create, remove (real) =================="
415 if [ ! -d $DIR/d17 ]; then
418 ln -s no-such-file $DIR/d17/l-dangle
420 $CHECKSTAT -l no-such-file $DIR/d17/l-dangle || error
421 $CHECKSTAT -fa $DIR/d17/l-dangle || error
423 $CHECKSTAT -a $DIR/l-dangle || error
425 run_test 17b "symlinks: create, remove (dangling) =============="
431 run_test 18 "touch .../f ; ls ... =============================="
437 $CHECKSTAT -a $DIR/f19 || error
439 run_test 19a "touch .../f19 ; ls -l ... ; rm .../f19 ==========="
442 ls -l $DIR/f19 && error || true
444 run_test 19b "ls -l .../f19 (should return error) =============="
447 [ $RUNAS_ID -eq $UID ] && echo "skipping test 19c" && return
448 $RUNAS touch $DIR/f19 && error || true
450 run_test 19c "$RUNAS touch .../f19 (should return error) =="
453 cat $DIR/f19 && error || true
455 run_test 19d "cat .../f19 (should return error) =============="
467 $CHECKSTAT -a $DIR/f || error
469 run_test 20 "touch .../f ; ls -l ... ==========================="
473 [ -f $DIR/d21/dangle ] && rm -f $DIR/d21/dangle
474 ln -s dangle $DIR/d21/link
475 echo foo >> $DIR/d21/link
477 $CHECKSTAT -t link $DIR/d21/link || error
478 $CHECKSTAT -f -t file $DIR/d21/link || error
480 run_test 21 "write to dangling link ============================"
484 chown $RUNAS_ID $DIR/d22
485 # Tar gets pissy if it can't access $PWD *sigh*
487 $RUNAS tar cf - /etc/hosts /etc/sysconfig/network | \
488 $RUNAS tar xfC - $DIR/d22)
490 $CHECKSTAT -t dir $DIR/d22/etc || error
491 $CHECKSTAT -u \#$RUNAS_ID $DIR/d22/etc || error
493 run_test 22 "unpack tar archive as non-root user ==============="
498 $TOEXCL -e $DIR/d23/f23 || error
500 run_test 23 "O_CREAT|O_EXCL in subdir =========================="
503 echo '== rename sanity =============================================='
504 echo '-- same directory rename'
507 mv $DIR/R1/f $DIR/R1/g
508 $CHECKSTAT -t file $DIR/R1/g || error
510 run_test 24a "touch .../R1/f; rename .../R1/f .../R1/g ========="
515 mv $DIR/R2/f $DIR/R2/g
516 $CHECKSTAT -a $DIR/R2/f || error
517 $CHECKSTAT -t file $DIR/R2/g || error
519 run_test 24b "touch .../R2/{f,g}; rename .../R2/f .../R2/g ====="
524 mv $DIR/R3/f $DIR/R3/g
525 $CHECKSTAT -a $DIR/R3/f || error
526 $CHECKSTAT -t dir $DIR/R3/g || error
528 run_test 24c "mkdir .../R3/f; rename .../R3/f .../R3/g ========="
533 perl -e "rename \"$DIR/R4/f\", \"$DIR/R4/g\";"
534 $CHECKSTAT -a $DIR/R4/f || error
535 $CHECKSTAT -t dir $DIR/R4/g || error
537 run_test 24d "mkdir .../R4/{f,g}; rename .../R4/f .../R4/g ====="
540 echo '-- cross directory renames --'
543 mv $DIR/R5a/f $DIR/R5b/g
544 $CHECKSTAT -a $DIR/R5a/f || error
545 $CHECKSTAT -t file $DIR/R5b/g || error
547 run_test 24e "touch .../R5a/f; rename .../R5a/f .../R5b/g ======"
551 touch $DIR/R6a/f $DIR/R6b/g
552 mv $DIR/R6a/f $DIR/R6b/g
553 $CHECKSTAT -a $DIR/R6a/f || error
554 $CHECKSTAT -t file $DIR/R6b/g || error
556 run_test 24f "touch .../R6a/f R6b/g; mv .../R6a/f .../R6b/g ===="
561 mv $DIR/R7a/d $DIR/R7b/e
562 $CHECKSTAT -a $DIR/R7a/d || error
563 $CHECKSTAT -t dir $DIR/R7b/e || error
565 run_test 24g "mkdir .../R7a/d; rename .../R7a/d .../R5b/e ======"
569 mkdir $DIR/R8a/d $DIR/R8b/e
570 perl -e "rename \"$DIR/R8a/d\", \"$DIR/R8b/e\";"
571 $CHECKSTAT -a $DIR/R8a/d || error
572 $CHECKSTAT -t dir $DIR/R8b/e || error
574 run_test 24h "mkdir .../R8{a,b} R8a/{d,e}; mv .../R8a/d .../R8b/e"
577 echo "-- rename error cases"
581 perl -e "rename \"$DIR/R9/f\", \"$DIR/R9/a\";"
582 $CHECKSTAT -t file $DIR/R9/f || error
583 $CHECKSTAT -t dir $DIR/R9/a || error
584 $CHECKSTAT -a file $DIR/R9/a/f || error
586 run_test 24i "rename file to dir error: touch f ; mkdir a ; rename f a"
590 perl -e "rename \"$DIR/R10/f\", \"$DIR/R10/g\""
591 $CHECKSTAT -t dir $DIR/R10 || error
592 $CHECKSTAT -a $DIR/R10/f || error
593 $CHECKSTAT -a $DIR/R10/g || error
595 run_test 24j "source does not exist ============================"
598 mkdir $DIR/R11a $DIR/R11a/d
600 mv $DIR/R11a/f $DIR/R11a/d
601 $CHECKSTAT -a $DIR/R11a/f || error
602 $CHECKSTAT -t file $DIR/R11a/d/f || error
604 run_test 24k "touch .../R11a/f; mv .../R11a/f .../R11a/d ======="
607 echo '== symlink sanity ============================================='
610 touch $DIR/s25/foo || error
612 run_test 25a "create file in symlinked directory ==============="
615 if [ ! -d $DIR/d25 ]; then
618 $CHECKSTAT -t file $DIR/s25/foo || error
620 run_test 25b "lookup file in symlinked directory ==============="
625 ln -s d26/d26-2 $DIR/s26
626 touch $DIR/s26/foo || error
628 run_test 26a "multiple component symlink ======================="
631 mkdir -p $DIR/d26b/d26-2
632 ln -s d26b/d26-2/foo $DIR/s26-2
633 touch $DIR/s26-2 || error
635 run_test 26b "multiple component symlink at end of lookup ======"
640 ln -s d26.2 $DIR/s26.2-1
641 ln -s s26.2-1 $DIR/s26.2-2
642 ln -s s26.2-2 $DIR/s26.2-3
643 chmod 0666 $DIR/s26.2-3/foo
645 run_test 26c "chain of symlinks ================================"
647 # recursive symlinks (bug 439)
649 ln -s d26-3/foo $DIR/d26-3
651 run_test 26d "create multiple component recursive symlink ======"
654 if [ ! -h $DIR/d26-3 ]; then
659 run_test 26e "unlink multiple component recursive symlink ======"
662 echo '== stripe sanity =============================================='
664 $LSTRIPE $DIR/d27/f0 8192 0 1 || error
665 $CHECKSTAT -t file $DIR/d27/f0 || error
667 log "== test_27b: write to one stripe file ========================="
668 cp /etc/hosts $DIR/d27/f0 || error
670 run_test 27a "one stripe file =================================="
673 [ "$STRIPECOUNT" -lt "2" ] && echo "skipping 2-stripe test" && return
674 if [ ! -d $DIR/d27 ]; then
677 $LSTRIPE $DIR/d27/f01 8192 0 2 || error
678 [ `$LFIND $DIR/d27/f01 | grep -A 10 obdidx | wc -l` -eq 4 ] ||
679 error "two-stripe file doesn't have two stripes"
681 log "== test_27d: write to two stripe file file f01 ================"
682 dd if=/dev/zero of=$DIR/d27/f01 bs=4k count=4 || error
684 run_test 27c "create two stripe file f01 ======================="
687 if [ ! -d $DIR/d27 ]; then
690 $LSTRIPE $DIR/d27/fdef 0 -1 0 || error
691 $CHECKSTAT -t file $DIR/d27/fdef || error
692 #dd if=/dev/zero of=$DIR/d27/fdef bs=4k count=4 || error
694 run_test 27d "create file with default settings ================"
697 if [ ! -d $DIR/d27 ]; then
700 $LSTRIPE $DIR/d27/f12 8192 1 2 || error
701 $LSTRIPE $DIR/d27/f12 8192 1 2 && error
702 $CHECKSTAT -t file $DIR/d27/f12 || error
704 run_test 27e "lstripe existing file (should return error) ======"
707 if [ ! -d $DIR/d27 ]; then
710 $LSTRIPE $DIR/d27/fbad 100 1 1 && error
711 dd if=/dev/zero of=$DIR/d27/f12 bs=4k count=4 || error
712 $LFIND $DIR/d27/fbad || error
714 run_test 27f "lstripe with bad stripe size (should return error)"
717 if [ ! -d $DIR/d27 ]; then
720 $MCREATE $DIR/d27/fnone || error
722 log "== test 27h: lfind with no objects ============================"
723 $LFIND $DIR/d27/fnone 2>&1 | grep -q "no stripe info" || error
725 log "== test 27i: lfind with some objects =========================="
726 touch $DIR/d27/fsome || error
727 $LFIND $DIR/d27/fsome | grep -q obdidx || error
729 run_test 27g "test lfind ======================================="
732 if [ ! -d $DIR/d27 ]; then
735 $LSTRIPE $DIR/d27/f27j 8192 $STRIPECOUNT 1 && error || true
737 run_test 27j "lstripe with bad stripe offset (should return error)"
741 $CREATETEST $DIR/d28/ct || error
743 run_test 28 "create/mknod/mkdir with bad file types ============"
746 for d in /proc/fs/lustre/ldlm/namespaces/$1*; do
747 echo clear > $d/lru_size
749 grep [0-9] /proc/fs/lustre/ldlm/namespaces/$1*/lock_unused_count /dev/null
758 MDCDIR=${MDCDIR:-/proc/fs/lustre/ldlm/namespaces/MDC_*}
759 LOCKCOUNTORIG=`cat $MDCDIR/lock_count`
760 LOCKUNUSEDCOUNTORIG=`cat $MDCDIR/lock_unused_count`
764 LOCKCOUNTCURRENT=`cat $MDCDIR/lock_count`
765 LOCKUNUSEDCOUNTCURRENT=`cat $MDCDIR/lock_unused_count`
766 if [ $LOCKCOUNTCURRENT -gt $LOCKCOUNTORIG ]; then
767 echo "CURRENT: $LOCKCOUNTCURRENT > $LOCKCOUNTORIG"
770 if [ $LOCKUNUSEDCOUNTCURRENT -gt $LOCKUNUSEDCOUNTORIG ]; then
771 echo "UNUSED: $LOCKUNUSEDCOUNTCURRENT > $LOCKUNUSEDCOUNTORIG"
775 run_test 29 "IT_GETATTR regression ============================"
782 run_test 30 "run binary from Lustre (execve) ==================="
785 $OPENUNLINK $DIR/f31 $DIR/f31 || error
786 $CHECKSTAT -a $DIR/f31 || error
788 run_test 31a "open-unlink file =================================="
791 touch $DIR/f31 || error
792 ln $DIR/f31 $DIR/f31b || error
793 multiop $DIR/f31b Ouc || error
794 $CHECKSTAT -t file $DIR/f31 || error
796 run_test 31b "unlink file with multiple links while open ======="
799 touch $DIR/f31 || error
800 ln $DIR/f31 $DIR/f31c || error
801 multiop $DIR/f31 O_uc &
803 multiop $DIR/f31c Ouc
808 run_test 31c "open-unlink file with multiple links ============="
811 opendirunlink $DIR/d31d $DIR/d31d || error
812 $CHECKSTAT -a $DIR/d31d || error
814 run_test 31d "remove of open directory ========================="
817 echo "== more mountpoints and symlinks ================="
818 [ -e $DIR/d32a ] && rm -fr $DIR/d32a
819 mkdir -p $DIR/d32a/ext2-mountpoint
820 mount -t ext2 -o loop $EXT2_DEV $DIR/d32a/ext2-mountpoint || error
821 $CHECKSTAT -t dir $DIR/d32a/ext2-mountpoint/.. || error
822 umount $DIR/d32a/ext2-mountpoint || error
824 run_test 32a "stat d32a/ext2-mountpoint/.. ====================="
827 [ -e $DIR/d32b ] && rm -fr $DIR/d32b
828 mkdir -p $DIR/d32b/ext2-mountpoint
829 mount -t ext2 -o loop $EXT2_DEV $DIR/d32b/ext2-mountpoint || error
830 ls -al $DIR/d32b/ext2-mountpoint/.. || error
831 umount $DIR/d32b/ext2-mountpoint || error
833 run_test 32b "open d32b/ext2-mountpoint/.. ====================="
836 [ -e $DIR/d32c ] && rm -fr $DIR/d32c
837 mkdir -p $DIR/d32c/ext2-mountpoint
838 mount -t ext2 -o loop $EXT2_DEV $DIR/d32c/ext2-mountpoint || error
839 mkdir -p $DIR/d32c/d2/test_dir
840 $CHECKSTAT -t dir $DIR/d32c/ext2-mountpoint/../d2/test_dir || error
841 umount $DIR/d32c/ext2-mountpoint || error
843 run_test 32c "stat d32c/ext2-mountpoint/../d2/test_dir ========="
846 [ -e $DIR/d32d ] && rm -fr $DIR/d32d
847 mkdir -p $DIR/d32d/ext2-mountpoint
848 mount -t ext2 -o loop $EXT2_DEV $DIR/d32d/ext2-mountpoint || error
849 mkdir -p $DIR/d32d/d2/test_dir
850 ls -al $DIR/d32d/ext2-mountpoint/../d2/test_dir || error
851 umount $DIR/d32d/ext2-mountpoint || error
853 run_test 32d "open d32d/ext2-mountpoint/../d2/test_dir ========="
856 [ -e $DIR/d32e ] && rm -fr $DIR/d32e
857 mkdir -p $DIR/d32e/tmp
858 TMP_DIR=$DIR/d32e/tmp
859 ln -s $DIR/d32e $TMP_DIR/symlink11
860 ln -s $TMP_DIR/symlink11 $TMP_DIR/../symlink01
861 $CHECKSTAT -t link $DIR/d32e/tmp/symlink11 || error
862 $CHECKSTAT -t link $DIR/d32e/symlink01 || error
864 run_test 32e "stat d32e/symlink->tmp/symlink->lustre-subdir ===="
867 [ -e $DIR/d32f ] && rm -fr $DIR/d32f
868 mkdir -p $DIR/d32f/tmp
869 TMP_DIR=$DIR/d32f/tmp
870 ln -s $DIR/d32f $TMP_DIR/symlink11
871 ln -s $TMP_DIR/symlink11 $TMP_DIR/../symlink01
872 ls $DIR/d32f/tmp/symlink11 || error
873 ls $DIR/d32f/symlink01 || error
875 run_test 32f "open d32f/symlink->tmp/symlink->lustre-subdir ===="
878 [ -e $DIR/d32g ] && rm -fr $DIR/d32g
879 [ -e $DIR/test_dir ] && rm -fr $DIR/test_dir
880 mkdir -p $DIR/test_dir
881 mkdir -p $DIR/d32g/tmp
882 TMP_DIR=$DIR/d32g/tmp
883 ln -s $DIR/test_dir $TMP_DIR/symlink12
884 ln -s $TMP_DIR/symlink12 $TMP_DIR/../symlink02
885 $CHECKSTAT -t link $DIR/d32g/tmp/symlink12 || error
886 $CHECKSTAT -t link $DIR/d32g/symlink02 || error
887 $CHECKSTAT -t dir -f $DIR/d32g/tmp/symlink12 || error
888 $CHECKSTAT -t dir -f $DIR/d32g/symlink02 || error
890 run_test 32g "stat d32g/symlink->tmp/symlink->lustre-subdir/test_dir"
893 [ -e $DIR/d32h ] && rm -fr $DIR/d32h
894 [ -e $DIR/test_dir ] && rm -fr $DIR/test_dir
895 mkdir -p $DIR/test_dir
896 mkdir -p $DIR/d32h/tmp
897 TMP_DIR=$DIR/d32h/tmp
898 ln -s $DIR/test_dir $TMP_DIR/symlink12
899 ln -s $TMP_DIR/symlink12 $TMP_DIR/../symlink02
900 ls $DIR/d32h/tmp/symlink12 || error
901 ls $DIR/d32h/symlink02 || error
903 run_test 32h "open d32h/symlink->tmp/symlink->lustre-subdir/test_dir"
906 [ -e $DIR/d32i ] && rm -fr $DIR/d32i
907 mkdir -p $DIR/d32i/ext2-mountpoint
908 mount -t ext2 -o loop $EXT2_DEV $DIR/d32i/ext2-mountpoint || error
909 touch $DIR/d32i/test_file
910 $CHECKSTAT -t file $DIR/d32i/ext2-mountpoint/../test_file || error
911 umount $DIR/d32i/ext2-mountpoint || error
913 run_test 32i "stat d32i/ext2-mountpoint/../test_file ==========="
916 [ -e $DIR/d32j ] && rm -fr $DIR/d32j
917 mkdir -p $DIR/d32j/ext2-mountpoint
918 mount -t ext2 -o loop $EXT2_DEV $DIR/d32j/ext2-mountpoint || error
919 touch $DIR/d32j/test_file
920 cat $DIR/d32j/ext2-mountpoint/../test_file || error
921 umount $DIR/d32j/ext2-mountpoint || error
923 run_test 32j "open d32j/ext2-mountpoint/../test_file ==========="
927 mkdir -p $DIR/d32k/ext2-mountpoint
928 mount -t ext2 -o loop $EXT2_DEV $DIR/d32k/ext2-mountpoint
929 mkdir -p $DIR/d32k/d2
930 touch $DIR/d32k/d2/test_file || error
931 $CHECKSTAT -t file $DIR/d32k/ext2-mountpoint/../d2/test_file || error
932 umount $DIR/d32k/ext2-mountpoint || error
934 run_test 32k "stat d32k/ext2-mountpoint/../d2/test_file ========"
938 mkdir -p $DIR/d32l/ext2-mountpoint
939 mount -t ext2 -o loop $EXT2_DEV $DIR/d32l/ext2-mountpoint || error
940 mkdir -p $DIR/d32l/d2
941 touch $DIR/d32l/d2/test_file
942 cat $DIR/d32l/ext2-mountpoint/../d2/test_file || error
943 umount $DIR/d32l/ext2-mountpoint || error
945 run_test 32l "open d32l/ext2-mountpoint/../d2/test_file ========"
949 mkdir -p $DIR/d32m/tmp
950 TMP_DIR=$DIR/d32m/tmp
951 ln -s $DIR $TMP_DIR/symlink11
952 ln -s $TMP_DIR/symlink11 $TMP_DIR/../symlink01
953 $CHECKSTAT -t link $DIR/d32m/tmp/symlink11 || error
954 $CHECKSTAT -t link $DIR/d32m/symlink01 || error
956 run_test 32m "stat d32m/symlink->tmp/symlink->lustre-root ======"
960 mkdir -p $DIR/d32n/tmp
961 TMP_DIR=$DIR/d32n/tmp
962 ln -s $DIR $TMP_DIR/symlink11
963 ln -s $TMP_DIR/symlink11 $TMP_DIR/../symlink01
964 ls -l $DIR/d32n/tmp/symlink11 || error
965 ls -l $DIR/d32n/symlink01 || error
967 run_test 32n "open d32n/symlink->tmp/symlink->lustre-root ======"
973 mkdir -p $DIR/d32o/tmp
974 TMP_DIR=$DIR/d32o/tmp
975 ln -s $DIR/test_file $TMP_DIR/symlink12
976 ln -s $TMP_DIR/symlink12 $TMP_DIR/../symlink02
977 $CHECKSTAT -t link $DIR/d32o/tmp/symlink12 || error
978 $CHECKSTAT -t link $DIR/d32o/symlink02 || error
979 $CHECKSTAT -t file -f $DIR/d32o/tmp/symlink12 || error
980 $CHECKSTAT -t file -f $DIR/d32o/symlink02 || error
982 run_test 32o "stat d32o/symlink->tmp/symlink->lustre-root/test_file"
992 mkdir -p $DIR/d32p/tmp
994 TMP_DIR=$DIR/d32p/tmp
996 ln -s $DIR/test_file $TMP_DIR/symlink12
998 ln -s $TMP_DIR/symlink12 $TMP_DIR/../symlink02
1000 cat $DIR/d32p/tmp/symlink12 || error
1002 cat $DIR/d32p/symlink02 || error
1005 run_test 32p "open d32p/symlink->tmp/symlink->lustre-root/test_file"
1008 [ -e $DIR/d32q ] && rm -fr $DIR/d32q
1010 touch $DIR/d32q/under_the_mount
1011 mount -t ext2 -o loop $EXT2_DEV $DIR/d32q
1012 ls $DIR/d32q/under_the_mount && error || true
1013 umount $DIR/d32q || error
1015 run_test 32q "stat follows mountpoints in Lustre ========================="
1018 [ -e $DIR/d32r ] && rm -fr $DIR/d32r
1020 touch $DIR/d32r/under_the_mount
1021 mount -t ext2 -o loop $EXT2_DEV $DIR/d32r
1022 ls $DIR/d32r | grep -q under_the_mount && error || true
1023 umount $DIR/d32r || error
1025 run_test 32r "opendir follows mountpoints in Lustre ========================="
1027 # chmod 444 /mnt/lustre/somefile
1028 # open(/mnt/lustre/somefile, O_RDWR)
1031 rm -f $DIR/test_33_file
1032 touch $DIR/test_33_file
1033 chmod 444 $DIR/test_33_file
1034 chown $RUNAS_ID $DIR/test_33_file
1036 $RUNAS $OPENFILE -f O_RDWR $DIR/test_33_file && error || true
1039 run_test 33 "write file with mode 444 (should return error) ===="
1041 TEST_34_SIZE=${TEST_34_SIZE:-2000000000000}
1043 rm -f $DIR/test_34_file
1044 $MCREATE $DIR/test_34_file || error
1045 $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
1046 $TRUNCATE $DIR/test_34_file $TEST_34_SIZE || error
1047 $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
1048 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1050 run_test 34a "truncate file that has not been opened ==========="
1053 [ ! -f $DIR/test_34_file ] && run_one 34a
1054 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1055 $OPENFILE -f O_RDONLY $DIR/test_34_file
1056 $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" || error
1057 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1059 run_test 34b "O_RDONLY opening file doesn't create objects ====="
1062 [ ! -f $DIR/test_34_file ] && run_one 34a
1063 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1064 $OPENFILE -f O_RDWR $DIR/test_34_file
1065 $LFIND $DIR/test_34_file 2>&1 | grep -q "no stripe info" && error
1066 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1068 run_test 34c "O_RDWR opening file-with-size works =============="
1071 dd if=/dev/zero of=$DIR/test_34_file conv=notrunc bs=4k count=1 || error
1072 $CHECKSTAT -s $TEST_34_SIZE $DIR/test_34_file || error
1073 rm $DIR/test_34_file
1075 run_test 34d "write to sparse file ============================="
1078 rm -f $DIR/test_34_file
1079 $MCREATE $DIR/test_34_file || error
1080 $TRUNCATE $DIR/test_34_file 1000 || error
1081 $CHECKSTAT -s 1000 $DIR/test_34_file || error
1082 $OPENFILE -f O_RDWR $DIR/test_34_file
1083 $CHECKSTAT -s 1000 $DIR/test_34_file || error
1085 run_test 34e "create objects, some with size and some without =="
1088 cp /bin/sh $DIR/test_35a_file
1089 chmod 444 $DIR/test_35a_file
1090 chown $RUNAS_ID $DIR/test_35a_file
1091 $RUNAS $DIR/test_35a_file && error || true
1092 rm $DIR/test_35a_file
1094 run_test 35a "exec file with mode 444 (should return and not leak) ====="
1098 rm -f $DIR/test_36_file
1099 utime $DIR/test_36_file || error
1101 run_test 36a "MDS utime check (mknod, utime) ==================="
1104 echo "" > $DIR/test_36_file
1105 utime $DIR/test_36_file || error
1107 run_test 36b "OST utime check (open, utime) ===================="
1110 rm -f $DIR/d36/test_36_file
1112 chown $RUNAS_ID $DIR/d36
1113 $RUNAS utime $DIR/d36/test_36_file || error
1115 run_test 36c "non-root MDS utime check (mknod, utime) =========="
1118 [ ! -d $DIR/d36 ] && run_one 36c
1119 echo "" > $DIR/d36/test_36_file
1120 $RUNAS utime $DIR/d36/test_36_file || error
1122 run_test 36d "non-root OST utime check (open, utime) ==========="
1125 [ $RUNAS_ID -eq $UID ] && return
1126 [ ! -d $DIR/d36 ] && mkdir $DIR/d36
1127 touch $DIR/d36/test_36_file2
1128 $RUNAS utime $DIR/d36/test_36_file2 && error || true
1130 run_test 36e "utime on non-owned file (should return error) ===="
1133 mkdir -p $DIR/dextra
1134 echo f > $DIR/dextra/fbugfile
1135 mount -t ext2 -o loop $EXT2_DEV $DIR/dextra
1136 ls $DIR/dextra | grep "\<fbugfile\>" && error
1137 umount $DIR/dextra || error
1138 rm -f $DIR/dextra/fbugfile || error
1140 run_test 37 "ls a mounted file system to check old content ====="
1143 o_directory $DIR/test38
1145 run_test 38 "open a regular file with O_DIRECTORY =============="
1148 touch $DIR/test_39_file
1149 touch $DIR/test_39_file2
1150 # ls -l $DIR/test_39_file $DIR/test_39_file2
1151 # ls -lu $DIR/test_39_file $DIR/test_39_file2
1152 # ls -lc $DIR/test_39_file $DIR/test_39_file2
1154 $OPENFILE -f O_CREAT:O_TRUNC:O_WRONLY $DIR/test_39_file2
1155 # ls -l $DIR/test_39_file $DIR/test_39_file2
1156 # ls -lu $DIR/test_39_file $DIR/test_39_file2
1157 # ls -lc $DIR/test_39_file $DIR/test_39_file2
1158 [ $DIR/test_39_file2 -nt $DIR/test_39_file ] || error
1160 run_test 39 "mtime changed on create ==========================="
1163 dd if=/dev/zero of=$DIR/f40 bs=4096 count=1
1164 $RUNAS $OPENFILE -f O_WRONLY:O_TRUNC $DIR/f40 && error
1165 $CHECKSTAT -t file -s 4096 $DIR/f40 || error
1167 run_test 40 "failed open(O_TRUNC) doesn't truncate ============="
1171 small_write $DIR/f41 18
1173 run_test 41 "test small file write + fstat ====================="
1175 count_ost_writes() {
1176 cat /proc/fs/lustre/osc/*/stats |
1177 awk -vwrites=0 '/ost_write/ { writes += $2 } END { print writes; }'
1180 # in 2.6, restore /proc/sys/vm/dirty_writeback_centisecs
1181 kill -CONT `pidof kupdated`
1184 # in 2.6, save and 0 /proc/sys/vm/dirty_writeback_centisecs
1185 kill -STOP `pidof kupdated`
1186 trap start_kupdated EXIT
1189 # Tests 42* verify that our behaviour is correct WRT caching, file closure,
1190 # file truncation, and file removal.
1192 cancel_lru_locks OSC
1194 sync # just to be safe
1195 BEFOREWRITES=`count_ost_writes`
1196 dd if=/dev/zero of=$DIR/f42a bs=1024 count=100
1197 AFTERWRITES=`count_ost_writes`
1198 [ $BEFOREWRITES -eq $AFTERWRITES ] || \
1199 error "$BEFOREWRITES < $AFTERWRITES"
1202 run_test 42a "ensure that we don't flush on close =============="
1205 cancel_lru_locks OSC
1208 dd if=/dev/zero of=$DIR/f42b bs=1024 count=100
1209 BEFOREWRITES=`count_ost_writes`
1210 $MUNLINK $DIR/f42b || error "$MUNLINK $DIR/f42b: $?"
1211 AFTERWRITES=`count_ost_writes`
1212 [ $BEFOREWRITES -eq $AFTERWRITES ] ||
1213 error "$BEFOREWRITES < $AFTERWRITES on unlink"
1214 BEFOREWRITES=`count_ost_writes`
1215 sync || error "sync: $?"
1216 AFTERWRITES=`count_ost_writes`
1217 [ $BEFOREWRITES -eq $AFTERWRITES ] ||
1218 error "$BEFOREWRITES < $AFTERWRITES on sync"
1219 dmesg | grep 'error from obd_brw_async' && error 'error writing back'
1223 run_test 42b "test destroy of file with cached dirty data ======"
1225 # if these tests just want to test the effect of truncation,
1226 # they have to be very careful. consider:
1227 # - the first open gets a {0,EOF}PR lock
1228 # - the first write conflicts and gets a {0, count-1}PW
1229 # - the rest of the writes are under {count,EOF}PW
1230 # - the open for truncate tries to match a {0,EOF}PR
1231 # for the filesize and cancels the PWs.
1232 # any number of fixes (don't get {0,EOF} on open, match
1233 # composite locks, do smarter file size management) fix
1234 # this, but for now we want these tests to verify that
1235 # the cancelation with truncate intent works, so we
1236 # start the file with a full-file pw lock to match against
1237 # until the truncate.
1242 cancel_lru_locks OSC
1244 # prime the file with 0,EOF PW to match
1248 # now the real test..
1249 dd if=/dev/zero of=$file bs=1024 count=100
1250 BEFOREWRITES=`count_ost_writes`
1251 $TRUNCATE $file $offset
1252 cancel_lru_locks OSC
1253 AFTERWRITES=`count_ost_writes`
1259 [ $BEFOREWRITES -eq $AFTERWRITES ] && \
1260 error "$BEFOREWRITES < $AFTERWRITES on truncate"
1263 run_test 42c "test partial truncate of file with cached dirty data ===="
1267 [ $BEFOREWRITES -eq $AFTERWRITES ] || \
1268 error "beforewrites $BEFOREWRITES != afterwrites $AFTERWRITES on truncate"
1271 run_test 42d "test complete truncate of file with cached dirty data ===="
1275 cp -p /bin/ls $DIR/d43/f
1276 exec 100>> $DIR/d43/f
1277 $DIR/d43/f && error || true
1280 run_test 43 "execution of file opened for write should return -ETXTBSY=="
1284 cp -p `which multiop` $DIR/d43/multiop
1286 $DIR/d43/multiop $DIR/d43/g o_c &
1289 multiop $DIR/d43/multiop Oc && error "expected error, got success"
1290 kill -USR1 $MULTIPID || return 2
1291 wait $MULTIPID || return 3
1293 run_test 43a "open(RDWR) of file being executed should return -ETXTBSY=="
1297 cp -p `which multiop` $DIR/d43/multiop
1299 $DIR/d43/multiop $DIR/d43/g o_c &
1302 truncate $DIR/d43/multiop 0 && error "expected error, got success"
1303 kill -USR1 $MULTIPID || return 2
1304 wait $MULTIPID || return 3
1306 run_test 43b "truncate of file being executed should return -ETXTBSY===="
1309 local testdir="$DIR/43a"
1312 ( cd $(dirname $SHELL) && md5sum $(basename $SHELL) ) | \
1313 ( cd $testdir && md5sum -c)
1315 run_test 43c "md5sum of copy into lustre================================"
1318 [ "$STRIPECOUNT" -lt "2" ] && echo "skipping 2-stripe test" && return
1319 dd if=/dev/zero of=$DIR/f1 bs=4k count=1 seek=127
1320 dd if=$DIR/f1 bs=4k count=1
1322 run_test 44 "zero length read from a sparse stripe ============="
1325 local nstripe=`$LCTL lov_getconfig $DIR | grep default_stripe_count: | \
1327 local stride=`$LCTL lov_getconfig $DIR | grep default_stripe_size: | \
1329 if [ $nstripe -eq 0 ] ; then
1330 nstripe=`$LCTL lov_getconfig $DIR | grep obd_count: | awk '{print $2}'`
1333 OFFSETS="0 $((stride/2)) $((stride-1))"
1334 for offset in $OFFSETS ; do
1335 for i in `seq 0 $((nstripe-1))`; do
1337 local GLOBALOFFSETS=""
1338 local size=$((((i + 2 * $nstripe )*$stride + $offset))) # Bytes
1339 ll_sparseness_write $DIR/44a $size || error "ll_sparseness_write"
1340 GLOBALOFFSETS="$GLOBALOFFSETS $size"
1341 ll_sparseness_verify $DIR/44a $GLOBALOFFSETS \
1342 || error "ll_sparseness_verify $GLOBALOFFSETS"
1344 for j in `seq 0 $((nstripe-1))`; do
1345 size=$((((j + $nstripe )*$stride + $offset))) # Bytes
1346 ll_sparseness_write $DIR/44a $size || error "ll_sparseness_write"
1347 GLOBALOFFSETS="$GLOBALOFFSETS $size"
1349 ll_sparseness_verify $DIR/44a $GLOBALOFFSETS \
1350 || error "ll_sparseness_verify $GLOBALOFFSETS"
1354 run_test 44a "test sparse pwrite ==============================="
1358 for d in /proc/fs/lustre/osc/*/cur_dirty_bytes; do
1359 tot=$(($tot + `cat $d`))
1364 before=`dirty_osc_total`
1365 echo executing "\"$*\""
1367 after=`dirty_osc_total`
1368 echo before $before, after $after
1374 do_dirty_record "echo blah > $f"
1375 [ $before -eq $after ] && error "write wasn't cached"
1376 do_dirty_record "> $f"
1377 [ $before -gt $after ] || error "truncate didn't lower dirty count"
1378 do_dirty_record "echo blah > $f"
1379 [ $before -eq $after ] && error "write wasn't cached"
1380 do_dirty_record "sync"
1381 [ $before -gt $after ] || error "writeback didn't lower dirty count"
1382 do_dirty_record "echo blah > $f"
1383 [ $before -eq $after ] && error "write wasn't cached"
1384 do_dirty_record "cancel_lru_locks OSC"
1385 [ $before -gt $after ] || error "lock cancelation didn't lower dirty count"
1388 run_test 45 "osc io page accounting ============================"
1394 # in a 2 stripe file (lov.sh), page 63 maps to page 31 in its object. this
1395 # test tickles a bug where re-dirtying a page was failing to be mapped to the
1396 # objects offset and an assert hit when an rpc was built with 63's mapped
1397 # offset 31 and 31's raw 31 offset. it also found general redirtying bugs.
1402 dd if=/dev/zero of=$f bs=`page_size` seek=31 count=1
1404 dd conv=notrunc if=/dev/zero of=$f bs=`page_size` seek=63 count=1
1405 dd conv=notrunc if=/dev/zero of=$f bs=`page_size` seek=31 count=1
1409 run_test 46 "dirtying a previously written page ================"
1411 # Check that device nodes are created and then visible correctly (#2091)
1413 cmknod $DIR/test_47_node || error
1415 run_test 47 "Device nodes check ================================"
1420 mv $DIR/d48 $DIR/d48.new || error "move directory failed"
1421 mkdir $DIR/d48 || error "recreate diectory failed"
1422 ls || error "can't list after recreate directory"
1424 run_test 48 "Access renamed current working directory ========="
1430 ls /proc/$$/cwd || error
1432 run_test 50 "special situations: /proc symlinks ==============="
1435 # bug 1516 - create an empty entry right after ".." then split dir
1438 $MCREATE $DIR/d49/bar
1440 createmany -m $DIR/d49/longfile 201
1442 while [ `ls -sd $DIR/d49 | awk '{ print $1 }'` -eq 4 ]; do
1443 $MCREATE $DIR/d49/longfile$FNUM
1447 ls -l $DIR/d49 > /dev/null || error
1449 run_test 51 "special situations: split htree with empty entry =="
1452 [ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
1455 chattr =a $DIR/d52a/foo || error
1456 echo bar >> $DIR/d52a/foo || error
1457 cp /etc/hosts $DIR/d52a/foo && error
1458 rm -f $DIR/d52a/foo 2>/dev/null && error
1459 link $DIR/d52a/foo $DIR/d52a/foo_link 2>/dev/null && error
1460 echo foo >> $DIR/d52a/foo || error
1461 mrename $DIR/d52a/foo $DIR/d52a/foo_ren && error
1462 lsattr $DIR/d52a/foo | egrep -q "^-+a-+ $DIR/d52a/foo" || error
1463 chattr -a $DIR/d52a/foo || error
1465 rm -fr $DIR/d52a || error
1467 run_test 52a "append-only flag test ============================"
1470 [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
1473 chattr =i $DIR/d52b/foo || error
1474 cat test > $DIR/d52b/foo && error
1475 cp /etc/hosts $DIR/d52b/foo && error
1476 rm -f $DIR/d52b/foo 2>/dev/null && error
1477 link $DIR/d52b/foo $DIR/d52b/foo_link 2>/dev/null && error
1478 echo foo >> $DIR/d52b/foo && error
1479 mrename $DIR/d52b/foo $DIR/d52b/foo_ren && error
1480 [ -f $DIR/d52b/foo ] || error
1481 [ -f $DIR/d52b/foo_ren ] && error
1482 lsattr $DIR/d52b/foo | egrep -q "^-+i-+ $DIR/d52b/foo" || error
1483 chattr -i $DIR/d52b/foo || error
1485 rm -fr $DIR/d52b || error
1487 run_test 52b "immutable flag test =============================="
1490 for i in /proc/fs/lustre/osc/OSC*mds1 ; do
1491 ostname=`echo $i | cut -d _ -f 3-4 | sed -e s/_mds1//`
1492 ost_last=`cat /proc/fs/lustre/obdfilter/$ostname/last_id`
1493 mds_last=`cat $i/prealloc_last_id`
1494 echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
1495 if [ $ost_last != $mds_last ]; then
1496 error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
1500 run_test 53 "verify that MDS and OSTs agree on pre-creation====="
1503 $SOCKETSERVER $DIR/socket &
1505 $SOCKETCLIENT $DIR/socket || error
1506 $MUNLINK $DIR/socket
1508 run_test 54a "unix damain socket test ==========================="
1514 dd if=/dev/zero of=$f bs=`page_size` count=1
1516 run_test 54b "char device works in lustre"
1521 loopdev="$DIR/loop54c"
1523 mknod $loopdev b 7 1
1524 dd if=/dev/zero of=$f bs=`page_size` count=1024 > /dev/null
1527 echo "make a loop file system..."
1528 mkfs.ext2 -F $f > /dev/null
1531 dd if=/dev/zero of=$dir/tmp bs=`page_size` count=30 || error
1532 dd if=$dir/tmp of=/dev/zero bs=`page_size` count=30 || error
1535 run_test 54c "loop device works in lustre"
1541 [ "$string" = `echo $string > $f | cat $f` ] || error
1543 run_test 54d "fifo device works in lustre"
1546 echo "touch 130 files"
1547 for i in `seq 1 130` ; do
1551 for i in `seq 1 130` ; do
1556 # wait for commitment of removal
1558 run_test 59 "verify cancellation of llog records async=========="
1561 echo 60 "llog tests run from kernel mode"
1564 run_test 60 "llog sanity tests run from kernel module =========="
1568 dd if=/dev/zero of=$f bs=`page_size` count=1
1569 cancel_lru_locks OSC
1570 multiop $f OSMWUc || error
1573 run_test 61 "mmap() writes don't make sync hang =========="
1575 # bug 2330 - insufficient obd_match error checking causes LBUG
1579 cancel_lru_locks OSC
1580 echo 0x405 > /proc/sys/lustre/fail_loc
1581 cat $f && error # expect -EIO
1582 multiop $f Owc && error
1583 echo 0 > /proc/sys/lustre/fail_loc
1585 run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)"
1587 # on the LLNL clusters, runas will still pick up root's $TMP settings,
1588 # which will not be writable for the runas user, and then you get a CVS
1589 # error message with a corrupt path string (CVS bug) and panic.
1590 # We're not using much space, so just stick it in /tmp, which is safe.
1596 [ $RUNAS_ID -ne $UID ] && HOME=/tmp
1599 echo 99 "cvs operations ===================================="
1600 mkdir -p $DIR/d99cvsroot
1601 chown $RUNAS_ID $DIR/d99cvsroot
1602 $RUNAS cvs -d $DIR/d99cvsroot init || error
1604 run_test 99a "cvs init ========================================="
1607 [ ! -d $DIR/d99cvsroot ] && run_one 99a
1609 $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" d99reposname vtag rtag
1611 run_test 99b "cvs import ======================================="
1614 [ ! -d $DIR/d99cvsroot ] && run_one 99b
1616 mkdir -p $DIR/d99reposname
1617 chown $RUNAS_ID $DIR/d99reposname
1618 $RUNAS cvs -d $DIR/d99cvsroot co d99reposname
1620 run_test 99c "cvs checkout ====================================="
1623 [ ! -d $DIR/d99cvsroot ] && run_one 99c
1624 cd $DIR/d99reposname
1626 $RUNAS cvs add -m 'addmsg' foo99
1628 run_test 99d "cvs add =========================================="
1631 [ ! -d $DIR/d99cvsroot ] && run_one 99c
1632 cd $DIR/d99reposname
1635 run_test 99e "cvs update ======================================="
1638 [ ! -d $DIR/d99cvsroot ] && run_one 99d
1639 cd $DIR/d99reposname
1640 $RUNAS cvs commit -m 'nomsg' foo99
1642 run_test 99f "cvs commit ======================================="
1648 log "cleanup: ======================================================"
1649 if [ "$I_MOUNTED" = "yes" -a "`mount | grep ^$NAME`" ]; then
1650 rm -rf $DIR/[Rdfs][1-9]*
1651 sh llmountcleanup.sh || error
1654 echo '=========================== finished ==============================='
1655 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true