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
422 mkdir -p $OBJPATH || return $?
423 echo -n $CONTENT > $OBJPATH/$OBJECT || return $?
425 echo "======================== mount object ==========================="
428 echo "================================================================="
438 umount $OBJPATH >/dev/null 2>&1
439 rm -fr $OBJPATH >/dev/null 2>&1
447 echo "$OBJECT" > /proc/fs/lustre/llite/fs0/gns_object_name || error
448 echo "$TIMOUT" > /proc/fs/lustre/llite/fs0/gns_timeout || error
449 echo "$TICK" > /proc/fs/lustre/llite/fs0/gns_tick || error
452 echo "timeout: $(cat /proc/fs/lustre/llite/fs0/gns_timeout)s"
453 echo "object: $(cat /proc/fs/lustre/llite/fs0/gns_object_name)"
454 echo "tick: $(cat /proc/fs/lustre/llite/fs0/gns_tick)s"
461 echo "1" > /proc/fs/lustre/llite/fs0/gns_enabled || error
462 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x1" || error
467 echo "0" > /proc/fs/lustre/llite/fs0/gns_enabled || error
468 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x0" || error
472 local LOOP_DEV=$(find_free_loop 2>/dev/null)
473 local LOOP_FILE="/tmp/gns_loop_1a"
474 local OBJECT=".mntinfo"
478 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
479 error "can't find free loop device"
481 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
482 cleanup_loop $LOOP_DEV $LOOP_FILE
483 setup_loop $LOOP_DEV $LOOP_FILE || error
485 echo "setting up GNS timeouts and mount object..."
486 setup_gns $OBJECT $TIMOUT $TICK || error
490 echo "preparing mount object at $DIR/gns_test_1a/$OBJECT..."
491 setup_object $DIR/gns_test_1a $OBJECT "-t ext2 $LOOP_DEV" || error
496 echo "testing GNS with GENERIC upcall 3 times on the row"
497 for ((i=0;i<3;i++)); do
498 check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC || {
500 cleanup_object $DIR/gns_test_1a
501 cleanup_loop $LOOP_DEV $LOOP_FILE
508 cleanup_object $DIR/gns_test_1a
509 cleanup_loop $LOOP_DEV $LOOP_FILE
512 run_test 1a " general GNS test - mount/umount (GENERIC) ================"
515 local LOOP_DEV=$(find_free_loop 2>/dev/null)
516 local LOOP_FILE="/tmp/gns_loop_1b"
517 local OBJECT=".mntinfo"
521 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
522 error "can't find free loop device"
524 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
525 cleanup_loop $LOOP_DEV $LOOP_FILE
526 setup_loop $LOOP_DEV $LOOP_FILE || error
528 echo "setting up GNS timeouts and mount object..."
529 setup_gns $OBJECT $TIMOUT $TICK || error
533 echo "preparing mount object at $DIR/gns_test_1b/$OBJECT..."
534 setup_object $DIR/gns_test_1b $OBJECT "-t ext2 $LOOP_DEV" || error
539 echo "testing GNS with DEADLOCK upcall 3 times on the row"
540 for ((i=0;i<3;i++)); do
541 check_gns DEADLOCK $DIR/gns_test_1b $DIR/gns_test_1b $TIMOUT $TICK GENERIC || {
543 cleanup_object $DIR/gns_test_1b
544 cleanup_loop $LOOP_DEV $LOOP_FILE
551 cleanup_object $DIR/gns_test_1b
552 cleanup_loop $LOOP_DEV $LOOP_FILE
555 run_test 1b " general GNS test - mount/umount (DEADLOCK) ==============="
558 local LOOP_DEV=$(find_free_loop 2>/dev/null)
559 local LOOP_FILE="/tmp/gns_loop_1c"
560 local OBJECT=".mntinfo"
564 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
565 error "can't find free loop device"
567 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
568 cleanup_loop $LOOP_DEV $LOOP_FILE
569 setup_loop $LOOP_DEV $LOOP_FILE || error
571 echo "setting up GNS timeouts and mount object..."
572 setup_gns $OBJECT $TIMOUT $TICK || error
576 echo "preparing mount object at $DIR/gns_test_1c/$OBJECT..."
577 setup_object $DIR/gns_test_1c $OBJECT "-t ext2 $LOOP_DEV" || error
582 echo "testing GNS with DEADLOCK upcall 4 times on the row"
588 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
590 check_gns $MODE $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC || {
592 cleanup_object $DIR/gns_test_1c
593 cleanup_loop $LOOP_DEV $LOOP_FILE
600 cleanup_object $DIR/gns_test_1c
601 cleanup_loop $LOOP_DEV $LOOP_FILE
604 run_test 1c " general GNS test - mount/umount (GENERIC/DEADLOCK) ========"
607 local LOOP_DEV=$(find_free_loop 2>/dev/null)
608 local LOOP_FILE="/tmp/gns_loop_1d"
609 local OBJECT=".mntinfo"
613 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
614 error "can't find free loop device"
616 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
617 cleanup_loop $LOOP_DEV $LOOP_FILE
618 setup_loop $LOOP_DEV $LOOP_FILE || error
620 echo "setting up GNS timeouts and mount object..."
621 setup_gns $OBJECT $TIMOUT $TICK || error
625 echo "preparing mount object at $DIR/gns_test_1d/$OBJECT..."
626 setup_object $DIR/gns_test_1d $OBJECT "-t ext2 $LOOP_DEV" || error
631 echo "testing GNS with GENERIC/DEADLOCK upcall 4 times on the row in CONCUR1 mode"
637 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
639 check_gns $MODE $DIR/gns_test_1d $DIR/gns_test_1d $TIMOUT $TICK CONCUR1 || {
641 cleanup_object $DIR/gns_test_1d
642 cleanup_loop $LOOP_DEV $LOOP_FILE
649 cleanup_object $DIR/gns_test_1d
650 cleanup_loop $LOOP_DEV $LOOP_FILE
653 run_test 1d " general GNS test - concurrent mount ======================="
656 local LOOP_DEV=$(find_free_loop 2>/dev/null)
657 local LOOP_FILE="/tmp/gns_loop_1e"
658 local OBJECT=".mntinfo"
662 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
663 error "can't find free loop device"
665 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
666 cleanup_loop $LOOP_DEV $LOOP_FILE
667 setup_loop $LOOP_DEV $LOOP_FILE || error
669 echo "setting up GNS timeouts and mount object..."
670 setup_gns $OBJECT $TIMOUT $TICK || error
674 echo "preparing mount object at $DIR/gns_test_1e1/$OBJECT..."
675 setup_object $DIR/gns_test_1e1 $OBJECT "-t ext2 $LOOP_DEV" || error
677 echo "preparing mount object at $DIR/gns_test_1e2/$OBJECT..."
678 setup_object $DIR/gns_test_1e2 $OBJECT "-t ext2 $LOOP_DEV" || error
683 echo "testing GNS with GENERIC upcall in CONCUR2 mode"
684 check_gns GENERIC $DIR/gns_test_1e1 $DIR/gns_test_1e2 $TIMOUT $TICK CONCUR2 || {
686 cleanup_object $DIR/gns_test_1e1
687 cleanup_object $DIR/gns_test_1e2
688 cleanup_loop $LOOP_DEV $LOOP_FILE
694 cleanup_object $DIR/gns_test_1e1
695 cleanup_object $DIR/gns_test_1e2
696 cleanup_loop $LOOP_DEV $LOOP_FILE
699 run_test 1e " general GNS test - concurrent mount of 2 GNS mounts ======="
702 local OBJECT=".mntinfo"
706 echo "setting up GNS timeouts and mount object..."
707 setup_gns $OBJECT $TIMOUT $TICK || error
711 echo "preparing mount object at $DIR/gns_test_2a/$OBJECT..."
712 mkdir -p $DIR/gns_test_2a
713 ln -s $DIR/gns_test_2a $DIR/gns_test_2a/$OBJECT
714 chmod u+s $DIR/gns_test_2a
719 echo "testing GNS with GENERIC upcall"
720 check_gns GENERIC $DIR/gns_test_2a $DIR/gns_test_2a $TIMOUT $TICK GENERIC && {
722 chmod u-s $DIR/gns_test_2a
723 rm -fr $DIR/gns_test_2a
724 error "symlink as mount object works?"
728 chmod u-s $DIR/gns_test_2a
729 rm -fr $DIR/gns_test_2a
732 run_test 2a " odd conditions (mount object is symlink) ============="
735 local OBJECT=".mntinfo"
739 echo "setting up GNS timeouts and mount object..."
740 setup_gns $OBJECT $TIMOUT $TICK || error
744 echo "preparing mount object at $DIR/gns_test_2b/$OBJECT..."
745 mkdir -p $DIR/gns_test_2b/$OBJECT
746 chmod u+s $DIR/gns_test_2b
751 echo "testing GNS with GENERIC upcall"
752 check_gns GENERIC $DIR/gns_test_2b $DIR/gns_test_2b $TIMOUT $TICK GENERIC && {
754 chmod u-s $DIR/gns_test_2b
755 rm -fr $DIR/gns_test_2b
756 error "dir as mount object works?"
760 chmod u-s $DIR/gns_test_2b
761 rm -fr $DIR/gns_test_2b
764 run_test 2b " odd conditions (mount object is directory) ==========="
767 local OBJECT=".mntinfo"
771 echo "setting up GNS timeouts and mount object..."
772 setup_gns $OBJECT $TIMOUT $TICK || error
776 echo "preparing mount object at $DIR/gns_test_2c/$OBJECT..."
777 mkdir -p $DIR/gns_test_2c/$OBJECT/$OBJECT/$OBJECT/$OBJECT
778 chmod u+s -R $DIR/gns_test_2c
783 echo "testing GNS with GENERIC upcall"
784 check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
786 chmod u-s -R $DIR/gns_test_2c
787 rm -fr $DIR/gns_test_2c
788 error "recursive mounting of dir as mount object works?"
792 chmod u-s $DIR/gns_test_2c
793 rm -fr $DIR/gns_test_2c
796 run_test 2c " odd conditions (mount object is recursive dir) ======="
799 local OBJECT=".mntinfo"
803 echo "setting up GNS timeouts and mount object..."
804 setup_gns $OBJECT $TIMOUT $TICK || error
808 echo "preparing mount object at $DIR/gns_test_2d/$OBJECT..."
809 mkdir -p $DIR/gns_test_2d
810 chmod u+s $DIR/gns_test_2d
815 echo "testing GNS with GENERIC upcall"
816 check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC && {
818 chmod u-s $DIR/gns_test_2d
819 rm -fr $DIR/gns_test_2d
820 error "mount point with absent mount object works?"
824 chmod u-s $DIR/gns_test_2d
825 rm -fr $DIR/gns_test_2d
828 run_test 2d " odd conditions (mount object is absent) =============="
831 local OBJECT=".mntinfo"
835 echo "setting up GNS timeouts and mount object..."
836 setup_gns $OBJECT $TIMOUT $TICK || error
838 echo "." > /proc/fs/lustre/llite/fs0/gns_object_name
839 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x." &&
840 error "'.' is set as mount object name"
842 echo ".." > /proc/fs/lustre/llite/fs0/gns_object_name
843 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.." &&
844 error "'..' is set as mount object name"
846 echo ".a" > /proc/fs/lustre/llite/fs0/gns_object_name
847 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.a" ||
848 error "'.a' is not set as mount object name"
850 echo "..a" > /proc/fs/lustre/llite/fs0/gns_object_name
851 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x..a" ||
852 error "'..a' is not set as mount object name"
855 run_test 2e " odd conditions ('.' and '..' as mount object) ============="
858 local LOOP_DEV=$(find_free_loop 2>/dev/null)
859 local LOOP_FILE="/tmp/gns_loop_2f"
860 local OBJECT=".mntinfo"
864 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
865 error "can't find free loop device"
867 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
868 cleanup_loop $LOOP_DEV $LOOP_FILE
869 setup_loop $LOOP_DEV $LOOP_FILE || error
871 echo "setting up GNS timeouts and mount object..."
872 setup_gns $OBJECT $TIMOUT $TICK || error
876 echo "preparing mount object at $DIR/gns_test_2f/$OBJECT..."
877 setup_object $DIR/gns_test_2f $OBJECT "-t ext2 $LOOP_DEV" || error
882 echo "testing GNS with DEADLOCK upcall in CONCUR3 mode"
884 local MODE="DEADLOCK"
886 check_gns $MODE $DIR/gns_test_2f $DIR/gns_test_2f $TIMOUT $TICK CONCUR3 || {
888 cleanup_object $DIR/gns_test_2f
889 cleanup_loop $LOOP_DEV $LOOP_FILE
895 cleanup_object $DIR/gns_test_2f
896 cleanup_loop $LOOP_DEV $LOOP_FILE
899 run_test 2f " odd conditions (mount point is modifying during mount) ===="
902 local LOOP_DEV=$(find_free_loop 2>/dev/null)
903 local LOOP_FILE="/tmp/gns_loop_2g"
904 local OBJECT=".mntinfo"
908 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
909 error "can't find free loop device"
911 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
912 cleanup_loop $LOOP_DEV $LOOP_FILE
913 setup_loop $LOOP_DEV $LOOP_FILE || error
915 echo "setting up GNS timeouts and mount object..."
916 setup_gns $OBJECT $TIMOUT $TICK || error
920 echo "preparing mount object at $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT..."
921 setup_object $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
922 $OBJECT "-t ext2 $LOOP_DEV" || error
923 chmod u+s $DIR/gns_test_2g
928 echo "testing GNS with DEADLOCK upcall in GENERIC mode"
930 local MODE="DEADLOCK"
932 check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
933 $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC || {
935 cleanup_object $DIR/gns_test_2g
936 cleanup_loop $LOOP_DEV $LOOP_FILE
942 cleanup_object $DIR/gns_test_2g
943 cleanup_loop $LOOP_DEV $LOOP_FILE
946 run_test 2g " odd conditions (mount point is recursive marked SUID dir) ="
949 local LOOP_DEV=$(find_free_loop 2>/dev/null)
950 local LOOP_FILE="/tmp/gns_loop_2h"
951 local OBJECT=".mntinfo"
955 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
956 error "can't find free loop device"
958 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
959 cleanup_loop $LOOP_DEV $LOOP_FILE
960 setup_loop $LOOP_DEV $LOOP_FILE || error
962 echo "setting up GNS timeouts and mount object..."
963 setup_gns $OBJECT $TIMOUT $TICK || error
967 echo "preparing mount object at $DIR/gns_test_2h/$OBJECT..."
968 setup_object $DIR/gns_test_2h $OBJECT "-t ext2 $LOOP_DEV" || error
973 echo "testing GNS with GENERIC upcall in GENERIC mode"
975 check_gns GENERIC $DIR/gns_test_2h $DIR/gns_test_2h \
976 $TIMOUT $TICK GENERIC BACKGROUND || {
978 cleanup_object $DIR/gns_test_2h
979 cleanup_loop $LOOP_DEV $LOOP_FILE
985 cleanup_object $DIR/gns_test_2h
986 cleanup_loop $LOOP_DEV $LOOP_FILE
989 run_test 2h " odd conditions (mounting in background) ==================="
995 log "cleanup: ==========================================================="
996 if [ "`mount | grep ^$NAME`" ]; then
997 rm -rf $DIR/[Rdfs][1-9]*
998 if [ "$I_MOUNTED" = "yes" ]; then
999 sh llmountcleanup.sh || error
1003 echo '=========================== finished ==============================='
1004 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true