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 ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""}
11 [ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT"
14 export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
15 export SECURITY=${SECURITY:-"null"}
18 FSTYPE=${FSTYPE:-ext3}
20 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
21 CREATETEST=${CREATETEST:-createtest}
23 LSTRIPE=${LSTRIPE:-"$LFS setstripe"}
24 LFIND=${LFIND:-"$LFS find"}
25 LVERIFY=${LVERIFY:-ll_dirstripe_verify}
27 MCREATE=${MCREATE:-mcreate}
28 OPENFILE=${OPENFILE:-openfile}
29 OPENUNLINK=${OPENUNLINK:-openunlink}
30 TOEXCL=${TOEXCL:-toexcl}
31 TRUNCATE=${TRUNCATE:-truncate}
32 MUNLINK=${MUNLINK:-munlink}
33 SOCKETSERVER=${SOCKETSERVER:-socketserver}
34 SOCKETCLIENT=${SOCKETCLIENT:-socketclient}
35 IOPENTEST1=${IOPENTEST1:-iopentest1}
36 IOPENTEST2=${IOPENTEST2:-iopentest2}
37 PTLDEBUG=${PTLDEBUG:-0}
41 if [ $UID -ne 0 ]; then
45 RUNAS_ID=${RUNAS_ID:-500}
46 RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
49 if [ `using_krb5_sec $SECURITY` == 'y' ] ; then
50 start_krb5_kdc || exit 1
51 if [ $RUNAS_ID -ne $UID ]; then
52 $RUNAS ./krb5_refresh_cache.sh || exit 2
56 export NAME=${NAME:-local}
62 sh llmountcleanup.sh > /dev/null || exit 20
69 sh llrmount.sh > /dev/null || exit 10
77 lctl mark "$*" 2> /dev/null || true
82 strace -o $TMP/$1.strace -ttt $*
84 log "FINISHED: $*: rc $RC"
89 check_kernel_version() {
90 VERSION_FILE=/proc/fs/lustre/kernel_version
92 [ ! -f $VERSION_FILE ] && echo "can't find kernel version" && return 1
93 GOT_VER=`cat $VERSION_FILE`
94 [ $GOT_VER -ge $WANT_VER ] && return 0
95 log "test needs at least kernel version $WANT_VER, running $GOT_VER"
100 if ! mount | grep -q $DIR; then
103 echo $PTLDEBUG >/proc/sys/portals/debug
105 export TESTNAME=test_$1
106 test_$1 || error "test_$1: exit with rc=$?"
113 build_test_filter() {
117 for E in $EXCEPT $ALWAYS_EXCEPT; do
118 eval EXCEPT_${E}=true
127 IFS=abcdefghijklmnopqrstuvwxyz _basetest $1
134 if [ ${!testname}x != x ]; then
139 if [ ${!testname}x != x ]; then
147 if [ ${!testname}x != x ]; then
148 echo "skipping excluded test $1"
151 testname=EXCEPT_$base
152 if [ ${!testname}x != x ]; then
153 echo "skipping excluded test $1 (base $base)"
160 [ "$SANITYLOG" ] && rm -f $SANITYLOG || true
164 if [ "$SANITYLOG" ]; then
165 echo "FAIL: $TESTNAME $@" >> $SANITYLOG
175 MOUNT="`mount | awk '/^'$NAME' .* lustre_lite / { print $3 }'`"
176 if [ -z "$MOUNT" ]; then
178 MOUNT="`mount | awk '/^'$NAME' .* lustre_lite / { print $3 }'`"
179 [ -z "$MOUNT" ] && error "NAME=$NAME not mounted"
183 [ `echo $MOUNT | wc -w` -gt 1 ] && error "NAME=$NAME mounted more than once"
186 [ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 99
188 rm -rf $DIR/[Rdfs][1-9]*
191 echo preparing for tests involving mounts
192 EXT2_DEV=${EXT2_DEV:-/tmp/SANITY.LOOP}
194 mke2fs -j -F $EXT2_DEV 8000 >/dev/null 2>&1
198 test -b /dev/loop0 &&
199 base="/dev/loop" || base="/dev/loop/"
201 for ((i=0;i<256;i++)); do
202 test -b $base$i || continue
204 losetup $base$i >/dev/null 2>&1 || {
216 dd if=/dev/zero of=$LOOP_FILE bs=1M count=10 2>/dev/null || return $?
218 losetup $LOOP_DEV $LOOP_FILE || {
220 cleanup_loop $LOOP_DEV $LOOP_FILE
224 mke2fs -F $LOOP_DEV >/dev/null 2>&1 || {
226 cleanup_loop $LOOP_DEV $LOOP_FILE
227 echo "cannot create test ext2 fs on $LOOP_DEV"
237 losetup -d $LOOP_DEV >/dev/null 2>&1
238 rm -fr $LOOP_FILE >/dev/null 2>&1
248 test "x$BG" = "xBACKGROUND" &&
251 test "x$MODE" = "xDEADLOCK" &&
252 INJECTION="touch \$MNTPATH/file"
254 cat > $UPCALL <<- EOF
257 MOUNT=\`which mount 2>/dev/null\`
258 test "x\$MOUNT" = "x" && MOUNT="/bin/mount"
263 test "x\$OPTIONS" = "x" || "x\$MNTPATH" = "x" &&
267 \$MOUNT \$OPTIONS \$MNTPATH > $LOG 2>&1 $BG
283 echo "======================== upcall log ==========================="
285 echo "==============================================================="
290 local LOG="/tmp/gns-log"
301 rm -fr $LOG >/dev/null 2>&1
302 UPCALL_PATH="/tmp/gns-upcall-$UPCALL.sh"
304 echo "generating upcall $UPCALL_PATH"
305 setup_upcall $UPCALL_PATH $UPCALL $LOG $BG || return $rc
307 echo "======================== upcall script ==========================="
308 cat $UPCALL_PATH 2>/dev/null || return $?
309 echo "=================================================================="
311 echo "$UPCALL_PATH" > /proc/fs/lustre/llite/fs0/gns_upcall || return $?
312 echo "upcall: $(cat /proc/fs/lustre/llite/fs0/gns_upcall)"
316 echo -n "mount on open $OBJECT1/test_file1 (generic): "
317 echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 || return $?
323 echo -n "mount on open $OBJECT1/test_file1 ($nr threads): "
324 for ((;i<=$nr;i++)); do
325 echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
336 test "x$OBJECT2" = "x" && {
337 echo "not defined object2 for concurrent2 testing"
340 echo -n "mount on open $OBJECT1/test_file1: "
341 echo -n "mount on open $OBJECT2/test_file1: "
342 echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 &
343 echo -n "test data" > $OBJECT2/test_file1 >/dev/null 2>&1 &
353 echo -n "mount on open $OBJECT1/test_file1: "
358 for ((;i<$nr;i++)); do
359 touch $OBJECT1/file$i &
360 echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
361 mkdir $OBJECT1/dir$i &
372 echo "invalid testing mode $MODE"
376 local ENTRY1="`basename $OBJECT1`"
377 local ENTRY2="`basename $OBJECT2`"
379 cat /proc/mounts | grep -q "$ENTRY1" || {
385 if test "x$MODE" = "xCONCUR2"; then
386 cat /proc/mounts | grep -q "$ENTRY2" || {
395 local sleep_time=$TIMOUT
396 let sleep_time+=$TICK*2
397 echo -n "waiting for umount ${sleep_time}s (timeout + tick*2): "
400 cat /proc/mounts | grep -q "$ENTRY1" && {
405 if test "x$MODE" = "xCONCUR2"; then
406 cat /proc/mounts | grep -q "$ENTRY2" && {
413 cleanup_upcall $UPCALL_PATH
423 mkdir -p $OBJPATH || return $?
424 echo -n $CONTENT > $OBJPATH/$OBJECT || return $?
426 echo "======================== mount object ==========================="
429 echo "================================================================="
431 chmod u+s $OBJPATH $EXTRA_OPT
439 chmod u-s $OBJPATH $EXTRA_OPT
440 umount $OBJPATH >/dev/null 2>&1
441 rm -fr $OBJPATH >/dev/null 2>&1
449 echo "$OBJECT" > /proc/fs/lustre/llite/fs0/gns_object_name || error
450 echo "$TIMOUT" > /proc/fs/lustre/llite/fs0/gns_timeout || error
451 echo "$TICK" > /proc/fs/lustre/llite/fs0/gns_tick || error
454 echo "timeout: $(cat /proc/fs/lustre/llite/fs0/gns_timeout)s"
455 echo "object: $(cat /proc/fs/lustre/llite/fs0/gns_object_name)"
456 echo "tick: $(cat /proc/fs/lustre/llite/fs0/gns_tick)s"
463 echo "1" > /proc/fs/lustre/llite/fs0/gns_enabled || error
464 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x1" || error
469 echo "0" > /proc/fs/lustre/llite/fs0/gns_enabled || error
470 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x0" || error
474 local LOOP_DEV=$(find_free_loop 2>/dev/null)
475 local LOOP_FILE="/tmp/gns_loop_1a"
476 local OBJECT=".mntinfo"
480 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
481 error "can't find free loop device"
483 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
484 cleanup_loop $LOOP_DEV $LOOP_FILE
485 setup_loop $LOOP_DEV $LOOP_FILE || error
487 echo "setting up GNS timeouts and mount object..."
488 setup_gns $OBJECT $TIMOUT $TICK || error
492 echo "preparing mount object at $DIR/gns_test_1a/$OBJECT..."
493 setup_object $DIR/gns_test_1a $OBJECT "-t ext2 $LOOP_DEV" || error
498 echo "testing GNS with GENERIC upcall 3 times on the row"
499 for ((i=0;i<3;i++)); do
500 check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC || {
502 cleanup_object $DIR/gns_test_1a
503 cleanup_loop $LOOP_DEV $LOOP_FILE
510 cleanup_object $DIR/gns_test_1a
511 cleanup_loop $LOOP_DEV $LOOP_FILE
514 run_test 1a " general GNS test - mount/umount (GENERIC) ================"
517 local LOOP_DEV=$(find_free_loop 2>/dev/null)
518 local LOOP_FILE="/tmp/gns_loop_1b"
519 local OBJECT=".mntinfo"
523 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
524 error "can't find free loop device"
526 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
527 cleanup_loop $LOOP_DEV $LOOP_FILE
528 setup_loop $LOOP_DEV $LOOP_FILE || error
530 echo "setting up GNS timeouts and mount object..."
531 setup_gns $OBJECT $TIMOUT $TICK || error
535 echo "preparing mount object at $DIR/gns_test_1b/$OBJECT..."
536 setup_object $DIR/gns_test_1b $OBJECT "-t ext2 $LOOP_DEV" || error
541 echo "testing GNS with DEADLOCK upcall 3 times on the row"
542 for ((i=0;i<3;i++)); do
543 check_gns DEADLOCK $DIR/gns_test_1b $DIR/gns_test_1b $TIMOUT $TICK GENERIC || {
545 cleanup_object $DIR/gns_test_1b
546 cleanup_loop $LOOP_DEV $LOOP_FILE
553 cleanup_object $DIR/gns_test_1b
554 cleanup_loop $LOOP_DEV $LOOP_FILE
557 run_test 1b " general GNS test - mount/umount (DEADLOCK) ==============="
560 local LOOP_DEV=$(find_free_loop 2>/dev/null)
561 local LOOP_FILE="/tmp/gns_loop_1c"
562 local OBJECT=".mntinfo"
566 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
567 error "can't find free loop device"
569 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
570 cleanup_loop $LOOP_DEV $LOOP_FILE
571 setup_loop $LOOP_DEV $LOOP_FILE || error
573 echo "setting up GNS timeouts and mount object..."
574 setup_gns $OBJECT $TIMOUT $TICK || error
578 echo "preparing mount object at $DIR/gns_test_1c/$OBJECT..."
579 setup_object $DIR/gns_test_1c $OBJECT "-t ext2 $LOOP_DEV" || error
584 echo "testing GNS with DEADLOCK upcall 4 times on the row"
590 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
592 check_gns $MODE $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC || {
594 cleanup_object $DIR/gns_test_1c
595 cleanup_loop $LOOP_DEV $LOOP_FILE
602 cleanup_object $DIR/gns_test_1c
603 cleanup_loop $LOOP_DEV $LOOP_FILE
606 run_test 1c " general GNS test - mount/umount (GENERIC/DEADLOCK) ========"
609 local LOOP_DEV=$(find_free_loop 2>/dev/null)
610 local LOOP_FILE="/tmp/gns_loop_1d"
611 local OBJECT=".mntinfo"
615 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
616 error "can't find free loop device"
618 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
619 cleanup_loop $LOOP_DEV $LOOP_FILE
620 setup_loop $LOOP_DEV $LOOP_FILE || error
622 echo "setting up GNS timeouts and mount object..."
623 setup_gns $OBJECT $TIMOUT $TICK || error
627 echo "preparing mount object at $DIR/gns_test_1d/$OBJECT..."
628 setup_object $DIR/gns_test_1d $OBJECT "-t ext2 $LOOP_DEV" || error
633 echo "testing GNS with GENERIC/DEADLOCK upcall 4 times on the row in CONCUR1 mode"
639 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
641 check_gns $MODE $DIR/gns_test_1d $DIR/gns_test_1d $TIMOUT $TICK CONCUR1 || {
643 cleanup_object $DIR/gns_test_1d
644 cleanup_loop $LOOP_DEV $LOOP_FILE
651 cleanup_object $DIR/gns_test_1d
652 cleanup_loop $LOOP_DEV $LOOP_FILE
655 run_test 1d " general GNS test - concurrent mount ======================="
658 local LOOP_DEV=$(find_free_loop 2>/dev/null)
659 local LOOP_FILE="/tmp/gns_loop_1e"
660 local OBJECT=".mntinfo"
664 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
665 error "can't find free loop device"
667 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
668 cleanup_loop $LOOP_DEV $LOOP_FILE
669 setup_loop $LOOP_DEV $LOOP_FILE || error
671 echo "setting up GNS timeouts and mount object..."
672 setup_gns $OBJECT $TIMOUT $TICK || error
676 echo "preparing mount object at $DIR/gns_test_1e1/$OBJECT..."
677 setup_object $DIR/gns_test_1e1 $OBJECT "-t ext2 $LOOP_DEV" || error
679 echo "preparing mount object at $DIR/gns_test_1e2/$OBJECT..."
680 setup_object $DIR/gns_test_1e2 $OBJECT "-t ext2 $LOOP_DEV" || error
685 echo "testing GNS with GENERIC upcall in CONCUR2 mode"
686 check_gns GENERIC $DIR/gns_test_1e1 $DIR/gns_test_1e2 $TIMOUT $TICK CONCUR2 || {
688 cleanup_object $DIR/gns_test_1e1
689 cleanup_object $DIR/gns_test_1e2
690 cleanup_loop $LOOP_DEV $LOOP_FILE
696 cleanup_object $DIR/gns_test_1e1
697 cleanup_object $DIR/gns_test_1e2
698 cleanup_loop $LOOP_DEV $LOOP_FILE
701 run_test 1e " general GNS test - concurrent mount of 2 GNS mounts ======="
704 local OBJECT=".mntinfo"
708 echo "setting up GNS timeouts and mount object..."
709 setup_gns $OBJECT $TIMOUT $TICK || error
713 echo "preparing mount object at $DIR/gns_test_2a/$OBJECT..."
714 mkdir -p $DIR/gns_test_2a
715 ln -s $DIR/gns_test_2a $DIR/gns_test_2a/$OBJECT
716 chmod u+s $DIR/gns_test_2a
721 echo "testing GNS with GENERIC upcall"
722 check_gns GENERIC $DIR/gns_test_2a $DIR/gns_test_2a $TIMOUT $TICK GENERIC && {
724 chmod u-s $DIR/gns_test_2a
725 rm -fr $DIR/gns_test_2a
726 error "symlink as mount object works?"
730 chmod u-s $DIR/gns_test_2a
731 rm -fr $DIR/gns_test_2a
734 run_test 2a " odd conditions (mount object is symlink) ============="
737 local OBJECT=".mntinfo"
741 echo "setting up GNS timeouts and mount object..."
742 setup_gns $OBJECT $TIMOUT $TICK || error
746 echo "preparing mount object at $DIR/gns_test_2b/$OBJECT..."
747 mkdir -p $DIR/gns_test_2b/$OBJECT
748 chmod u+s $DIR/gns_test_2b
753 echo "testing GNS with GENERIC upcall"
754 check_gns GENERIC $DIR/gns_test_2b $DIR/gns_test_2b $TIMOUT $TICK GENERIC && {
756 chmod u-s $DIR/gns_test_2b
757 rm -fr $DIR/gns_test_2b
758 error "dir as mount object works?"
762 chmod u-s $DIR/gns_test_2b
763 rm -fr $DIR/gns_test_2b
766 run_test 2b " odd conditions (mount object is directory) ==========="
769 local OBJECT=".mntinfo"
773 echo "setting up GNS timeouts and mount object..."
774 setup_gns $OBJECT $TIMOUT $TICK || error
778 echo "preparing mount object at $DIR/gns_test_2c/$OBJECT..."
779 mkdir -p $DIR/gns_test_2c/$OBJECT/$OBJECT/$OBJECT/$OBJECT
780 chmod u+s -R $DIR/gns_test_2c
785 echo "testing GNS with GENERIC upcall"
786 check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
788 chmod u-s -R $DIR/gns_test_2c
789 rm -fr $DIR/gns_test_2c
790 error "recursive mounting of dir as mount object works?"
794 chmod u-s $DIR/gns_test_2c
795 rm -fr $DIR/gns_test_2c
798 run_test 2c " odd conditions (mount object is recursive dir) ======="
801 local OBJECT=".mntinfo"
805 echo "setting up GNS timeouts and mount object..."
806 setup_gns $OBJECT $TIMOUT $TICK || error
810 echo "preparing mount object at $DIR/gns_test_2d/$OBJECT..."
811 mkdir -p $DIR/gns_test_2d
812 chmod u+s $DIR/gns_test_2d
817 echo "testing GNS with GENERIC upcall"
818 check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC && {
820 chmod u-s $DIR/gns_test_2d
821 rm -fr $DIR/gns_test_2d
822 error "mount point with absent mount object works?"
826 chmod u-s $DIR/gns_test_2d
827 rm -fr $DIR/gns_test_2d
830 run_test 2d " odd conditions (mount object is absent) =============="
833 local OBJECT=".mntinfo"
837 echo "setting up GNS timeouts and mount object..."
838 setup_gns $OBJECT $TIMOUT $TICK || error
840 echo "." > /proc/fs/lustre/llite/fs0/gns_object_name
841 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x." &&
842 error "'.' is set as mount object name"
844 echo ".." > /proc/fs/lustre/llite/fs0/gns_object_name
845 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.." &&
846 error "'..' is set as mount object name"
848 echo ".a" > /proc/fs/lustre/llite/fs0/gns_object_name
849 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.a" ||
850 error "'.a' is not set as mount object name"
852 echo "..a" > /proc/fs/lustre/llite/fs0/gns_object_name
853 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x..a" ||
854 error "'..a' is not set as mount object name"
857 run_test 2e " odd conditions ('.' and '..' as mount object) ============="
860 local LOOP_DEV=$(find_free_loop 2>/dev/null)
861 local LOOP_FILE="/tmp/gns_loop_2f"
862 local OBJECT=".mntinfo"
866 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
867 error "can't find free loop device"
869 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
870 cleanup_loop $LOOP_DEV $LOOP_FILE
871 setup_loop $LOOP_DEV $LOOP_FILE || error
873 echo "setting up GNS timeouts and mount object..."
874 setup_gns $OBJECT $TIMOUT $TICK || error
878 echo "preparing mount object at $DIR/gns_test_2f/$OBJECT..."
879 setup_object $DIR/gns_test_2f $OBJECT "-t ext2 $LOOP_DEV" || error
884 echo "testing GNS with DEADLOCK upcall in CONCUR3 mode"
886 local MODE="DEADLOCK"
888 check_gns $MODE $DIR/gns_test_2f $DIR/gns_test_2f $TIMOUT $TICK CONCUR3 || {
890 cleanup_object $DIR/gns_test_2f
891 cleanup_loop $LOOP_DEV $LOOP_FILE
897 cleanup_object $DIR/gns_test_2f
898 cleanup_loop $LOOP_DEV $LOOP_FILE
901 run_test 2f " odd conditions (mount point is modifying during mount) ===="
904 local LOOP_DEV=$(find_free_loop 2>/dev/null)
905 local LOOP_FILE="/tmp/gns_loop_2g"
906 local OBJECT=".mntinfo"
910 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
911 error "can't find free loop device"
913 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
914 cleanup_loop $LOOP_DEV $LOOP_FILE
915 setup_loop $LOOP_DEV $LOOP_FILE || error
917 echo "setting up GNS timeouts and mount object..."
918 setup_gns $OBJECT $TIMOUT $TICK || error
922 echo "preparing mount object at $DIR/gns_test_2g/$OBJECT..."
923 setup_object $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
924 $OBJECT "-t ext2 $LOOP_DEV" || error
929 echo "testing GNS with DEADLOCK upcall in GENERIC mode"
931 local MODE="DEADLOCK"
933 check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
934 $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC || {
936 cleanup_object $DIR/gns_test_2g
937 cleanup_loop $LOOP_DEV $LOOP_FILE
943 cleanup_object $DIR/gns_test_2g
944 cleanup_loop $LOOP_DEV $LOOP_FILE
947 run_test 2g " odd conditions (mount point is recursive marked SUID dir) ="
950 local LOOP_DEV=$(find_free_loop 2>/dev/null)
951 local LOOP_FILE="/tmp/gns_loop_2h"
952 local OBJECT=".mntinfo"
956 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
957 error "can't find free loop device"
959 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
960 cleanup_loop $LOOP_DEV $LOOP_FILE
961 setup_loop $LOOP_DEV $LOOP_FILE || error
963 echo "setting up GNS timeouts and mount object..."
964 setup_gns $OBJECT $TIMOUT $TICK || error
968 echo "preparing mount object at $DIR/gns_test_2h/$OBJECT..."
969 setup_object $DIR/gns_test_2h $OBJECT "-t ext2 $LOOP_DEV" || error
974 echo "testing GNS with GENERIC upcall in GENERIC mode"
976 check_gns GENERIC $DIR/gns_test_2h $DIR/gns_test_2h \
977 $TIMOUT $TICK GENERIC BACKGROUND || {
979 cleanup_object $DIR/gns_test_2h
980 cleanup_loop $LOOP_DEV $LOOP_FILE
986 cleanup_object $DIR/gns_test_2h
987 cleanup_loop $LOOP_DEV $LOOP_FILE
990 run_test 2h " odd conditions (mounting in background) ==================="
996 log "cleanup: ==========================================================="
997 if [ "`mount | grep ^$NAME`" ]; then
998 rm -rf $DIR/[Rdfs][1-9]*
999 if [ "$I_MOUNTED" = "yes" ]; then
1000 sh llmountcleanup.sh || error
1004 echo '=========================== finished ==============================='
1005 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true