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 ! cat /proc/mounts | 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 "==============================================================="
295 mnt="`cat /proc/mounts | grep $OBJECT | awk '{print \$2}'`"
296 test -z "$mnt" && return 1
299 test "x$p" = "x$OBJECT" || return 1
306 local LOG="/tmp/gns-log"
317 rm -fr $LOG >/dev/null 2>&1
318 UPCALL_PATH="/tmp/gns-upcall-$UPCALL.sh"
320 echo "generating upcall $UPCALL_PATH"
321 setup_upcall $UPCALL_PATH $UPCALL $LOG $BG || return $rc
323 echo "======================== upcall script ==========================="
324 cat $UPCALL_PATH 2>/dev/null || return $?
325 echo "=================================================================="
327 echo "$UPCALL_PATH" > /proc/fs/lustre/llite/fs0/gns_upcall || return $?
328 echo "upcall: $(cat /proc/fs/lustre/llite/fs0/gns_upcall)"
332 echo -n "mount on open $OBJECT1/test_file1 (generic): "
333 echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 || return $?
339 echo -n "mount on open $OBJECT1/test_file1 ($nr threads): "
340 for ((;i<=$nr;i++)); do
341 echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
352 test "x$OBJECT2" = "x" && {
353 echo "not defined object2 for concurrent2 testing"
356 echo -n "mount on open $OBJECT1/test_file1: "
357 echo -n "mount on open $OBJECT2/test_file1: "
358 echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 &
359 echo -n "test data" > $OBJECT2/test_file1 >/dev/null 2>&1 &
369 echo -n "mount on open $OBJECT1/test_file1: "
374 for ((;i<$nr;i++)); do
375 touch $OBJECT1/file$i &
376 echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
377 mkdir $OBJECT1/dir$i &
388 echo "invalid testing mode $MODE"
392 check_mnt $OBJECT1 || {
398 if test "x$MODE" = "xCONCUR2"; then
399 check_mnt $OBJECT2 || {
408 local sleep_time=$TIMOUT
409 let sleep_time+=$TICK*2
410 echo -n "waiting for umount ${sleep_time}s (timeout + tick*2): "
413 check_mnt $OBJECT1 && {
418 if test "x$MODE" = "xCONCUR2"; then
419 check_mnt $OBJECT2 && {
426 cleanup_upcall $UPCALL_PATH
435 mkdir -p $OBJPATH || return $?
436 echo -n $CONTENT > $OBJPATH/$OBJECT || return $?
438 echo "======================== mount object ==========================="
441 echo "================================================================="
451 umount $OBJPATH >/dev/null 2>&1
452 rm -fr $OBJPATH >/dev/null 2>&1
460 echo "$OBJECT" > /proc/fs/lustre/llite/fs0/gns_object_name || error
461 echo "$TIMOUT" > /proc/fs/lustre/llite/fs0/gns_timeout || error
462 echo "$TICK" > /proc/fs/lustre/llite/fs0/gns_tick || error
465 echo "timeout: $(cat /proc/fs/lustre/llite/fs0/gns_timeout)s"
466 echo "object: $(cat /proc/fs/lustre/llite/fs0/gns_object_name)"
467 echo "tick: $(cat /proc/fs/lustre/llite/fs0/gns_tick)s"
474 echo "1" > /proc/fs/lustre/llite/fs0/gns_enabled || error
475 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x1" || error
480 echo "0" > /proc/fs/lustre/llite/fs0/gns_enabled || error
481 test "x$(cat /proc/fs/lustre/llite/fs0/gns_enabled)" = "x0" || error
485 local LOOP_DEV=$(find_free_loop 2>/dev/null)
486 local LOOP_FILE="/tmp/gns_loop_1a"
487 local OBJECT=".mntinfo"
491 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
492 error "can't find free loop device"
494 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
495 cleanup_loop $LOOP_DEV $LOOP_FILE
496 setup_loop $LOOP_DEV $LOOP_FILE || error
498 echo "setting up GNS timeouts and mount object..."
499 setup_gns $OBJECT $TIMOUT $TICK || error
503 echo "preparing mount object at $DIR/gns_test_1a/$OBJECT..."
504 setup_object $DIR/gns_test_1a $OBJECT "-t ext2 $LOOP_DEV" || error
509 echo "testing GNS with GENERIC upcall 3 times on the row"
511 for ((i=0;i<3;i++)); do
512 check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC || {
514 cleanup_object $DIR/gns_test_1a
515 cleanup_loop $LOOP_DEV $LOOP_FILE
522 cleanup_object $DIR/gns_test_1a
523 cleanup_loop $LOOP_DEV $LOOP_FILE
526 run_test 1a " general GNS test - mount/umount (GENERIC) ================"
529 local LOOP_DEV=$(find_free_loop 2>/dev/null)
530 local LOOP_FILE="/tmp/gns_loop_1b"
531 local OBJECT=".mntinfo"
535 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
536 error "can't find free loop device"
538 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
539 cleanup_loop $LOOP_DEV $LOOP_FILE
540 setup_loop $LOOP_DEV $LOOP_FILE || error
542 echo "setting up GNS timeouts and mount object..."
543 setup_gns $OBJECT $TIMOUT $TICK || error
547 echo "preparing mount object at $DIR/gns_test_1b/$OBJECT..."
548 setup_object $DIR/gns_test_1b $OBJECT "-t ext2 $LOOP_DEV" || error
553 echo "testing GNS with DEADLOCK upcall 3 times on the row"
555 for ((i=0;i<3;i++)); do
556 check_gns DEADLOCK $DIR/gns_test_1b $DIR/gns_test_1b $TIMOUT $TICK GENERIC || {
558 cleanup_object $DIR/gns_test_1b
559 cleanup_loop $LOOP_DEV $LOOP_FILE
566 cleanup_object $DIR/gns_test_1b
567 cleanup_loop $LOOP_DEV $LOOP_FILE
570 run_test 1b " general GNS test - mount/umount (DEADLOCK) ==============="
573 local LOOP_DEV=$(find_free_loop 2>/dev/null)
574 local LOOP_FILE="/tmp/gns_loop_1c"
575 local OBJECT=".mntinfo"
579 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
580 error "can't find free loop device"
582 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
583 cleanup_loop $LOOP_DEV $LOOP_FILE
584 setup_loop $LOOP_DEV $LOOP_FILE || error
586 echo "setting up GNS timeouts and mount object..."
587 setup_gns $OBJECT $TIMOUT $TICK || error
591 echo "preparing mount object at $DIR/gns_test_1c/$OBJECT..."
592 setup_object $DIR/gns_test_1c $OBJECT "-t ext2 $LOOP_DEV" || error
597 echo "testing GNS with GENERIC/DEADLOCK upcall 4 times on the row in GENERIC mode"
603 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
605 check_gns $MODE $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC || {
607 cleanup_object $DIR/gns_test_1c
608 cleanup_loop $LOOP_DEV $LOOP_FILE
615 cleanup_object $DIR/gns_test_1c
616 cleanup_loop $LOOP_DEV $LOOP_FILE
619 run_test 1c " general GNS test - mount/umount (GENERIC/DEADLOCK) ========"
622 local LOOP_DEV=$(find_free_loop 2>/dev/null)
623 local LOOP_FILE="/tmp/gns_loop_1d"
624 local OBJECT=".mntinfo"
628 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
629 error "can't find free loop device"
631 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
632 cleanup_loop $LOOP_DEV $LOOP_FILE
633 setup_loop $LOOP_DEV $LOOP_FILE || error
635 echo "setting up GNS timeouts and mount object..."
636 setup_gns $OBJECT $TIMOUT $TICK || error
640 echo "preparing mount object at $DIR/gns_test_1d/$OBJECT..."
641 setup_object $DIR/gns_test_1d $OBJECT "-t ext2 $LOOP_DEV" || error
646 echo "testing GNS with GENERIC/DEADLOCK upcall 4 times on the row in CONCUR1 mode"
652 test $(($i%2)) -eq 1 && MODE="DEADLOCK"
654 check_gns $MODE $DIR/gns_test_1d $DIR/gns_test_1d $TIMOUT $TICK CONCUR1 || {
656 cleanup_object $DIR/gns_test_1d
657 cleanup_loop $LOOP_DEV $LOOP_FILE
664 cleanup_object $DIR/gns_test_1d
665 cleanup_loop $LOOP_DEV $LOOP_FILE
668 run_test 1d " general GNS test - concurrent mount ======================="
671 local LOOP_DEV=$(find_free_loop 2>/dev/null)
672 local LOOP_FILE="/tmp/gns_loop_1e"
673 local OBJECT=".mntinfo"
677 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
678 error "can't find free loop device"
680 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
681 cleanup_loop $LOOP_DEV $LOOP_FILE
682 setup_loop $LOOP_DEV $LOOP_FILE || error
684 echo "setting up GNS timeouts and mount object..."
685 setup_gns $OBJECT $TIMOUT $TICK || error
689 echo "preparing mount object at $DIR/gns_test_1e1/$OBJECT..."
690 setup_object $DIR/gns_test_1e1 $OBJECT "-t ext2 $LOOP_DEV" || error
692 echo "preparing mount object at $DIR/gns_test_1e2/$OBJECT..."
693 setup_object $DIR/gns_test_1e2 $OBJECT "-t ext2 $LOOP_DEV" || error
698 echo "testing GNS with GENERIC upcall in CONCUR2 mode"
700 check_gns GENERIC $DIR/gns_test_1e1 $DIR/gns_test_1e2 $TIMOUT $TICK CONCUR2 || {
702 cleanup_object $DIR/gns_test_1e1
703 cleanup_object $DIR/gns_test_1e2
704 cleanup_loop $LOOP_DEV $LOOP_FILE
710 cleanup_object $DIR/gns_test_1e1
711 cleanup_object $DIR/gns_test_1e2
712 cleanup_loop $LOOP_DEV $LOOP_FILE
715 run_test 1e " general GNS test - concurrent mount of 2 GNS mounts ======="
718 local OBJECT=".mntinfo"
722 echo "setting up GNS timeouts and mount object..."
723 setup_gns $OBJECT $TIMOUT $TICK || error
727 echo "preparing mount object at $DIR/gns_test_2a/$OBJECT..."
728 mkdir -p $DIR/gns_test_2a
729 ln -s $DIR/gns_test_2a $DIR/gns_test_2a/$OBJECT
730 chmod u+s $DIR/gns_test_2a
735 echo "testing GNS with GENERIC upcall"
737 check_gns GENERIC $DIR/gns_test_2a $DIR/gns_test_2a $TIMOUT $TICK GENERIC && {
739 chmod u-s $DIR/gns_test_2a
740 rm -fr $DIR/gns_test_2a
741 error "symlink as mount object works?"
745 chmod u-s $DIR/gns_test_2a
746 rm -fr $DIR/gns_test_2a
749 run_test 2a " odd conditions (mount object is symlink) ============="
752 local OBJECT=".mntinfo"
756 echo "setting up GNS timeouts and mount object..."
757 setup_gns $OBJECT $TIMOUT $TICK || error
761 echo "preparing mount object at $DIR/gns_test_2b/$OBJECT..."
762 mkdir -p $DIR/gns_test_2b/$OBJECT
763 chmod u+s $DIR/gns_test_2b
768 echo "testing GNS with GENERIC upcall"
770 check_gns GENERIC $DIR/gns_test_2b $DIR/gns_test_2b $TIMOUT $TICK GENERIC && {
772 chmod u-s $DIR/gns_test_2b
773 rm -fr $DIR/gns_test_2b
774 error "dir as mount object works?"
778 chmod u-s $DIR/gns_test_2b
779 rm -fr $DIR/gns_test_2b
782 run_test 2b " odd conditions (mount object is directory) ==========="
785 local OBJECT=".mntinfo"
789 echo "setting up GNS timeouts and mount object..."
790 setup_gns $OBJECT $TIMOUT $TICK || error
794 echo "preparing mount object at $DIR/gns_test_2c/$OBJECT..."
795 mkdir -p $DIR/gns_test_2c/$OBJECT/$OBJECT/$OBJECT/$OBJECT
796 chmod u+s -R $DIR/gns_test_2c
801 echo "testing GNS with GENERIC upcall"
803 check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
805 chmod u-s -R $DIR/gns_test_2c
806 rm -fr $DIR/gns_test_2c
807 error "recursive mounting of dir as mount object works?"
811 chmod u-s $DIR/gns_test_2c
812 rm -fr $DIR/gns_test_2c
815 run_test 2c " odd conditions (mount object is recursive dir) ======="
818 local OBJECT=".mntinfo"
822 echo "setting up GNS timeouts and mount object..."
823 setup_gns $OBJECT $TIMOUT $TICK || error
827 echo "preparing mount object at $DIR/gns_test_2d/$OBJECT..."
828 mkdir -p $DIR/gns_test_2d
829 chmod u+s $DIR/gns_test_2d
834 echo "testing GNS with GENERIC upcall"
836 check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC && {
838 chmod u-s $DIR/gns_test_2d
839 rm -fr $DIR/gns_test_2d
840 error "mount point with absent mount object works?"
844 chmod u-s $DIR/gns_test_2d
845 rm -fr $DIR/gns_test_2d
848 run_test 2d " odd conditions (mount object is absent) =============="
851 local OBJECT=".mntinfo"
855 echo "setting up GNS timeouts and mount object..."
856 setup_gns $OBJECT $TIMOUT $TICK || error
858 echo "." > /proc/fs/lustre/llite/fs0/gns_object_name
859 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x." &&
860 error "'.' is set as mount object name"
862 echo ".." > /proc/fs/lustre/llite/fs0/gns_object_name
863 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.." &&
864 error "'..' is set as mount object name"
866 echo ".a" > /proc/fs/lustre/llite/fs0/gns_object_name
867 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x.a" ||
868 error "'.a' is not set as mount object name"
870 echo "..a" > /proc/fs/lustre/llite/fs0/gns_object_name
871 test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x..a" ||
872 error "'..a' is not set as mount object name"
875 run_test 2e " odd conditions ('.' and '..' as mount object) ============="
878 local LOOP_DEV=$(find_free_loop 2>/dev/null)
879 local LOOP_FILE="/tmp/gns_loop_2f"
880 local OBJECT=".mntinfo"
884 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
885 error "can't find free loop device"
887 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
888 cleanup_loop $LOOP_DEV $LOOP_FILE
889 setup_loop $LOOP_DEV $LOOP_FILE || error
891 echo "setting up GNS timeouts and mount object..."
892 setup_gns $OBJECT $TIMOUT $TICK || error
896 echo "preparing mount object at $DIR/gns_test_2f/$OBJECT..."
897 setup_object $DIR/gns_test_2f $OBJECT "-t ext2 $LOOP_DEV" || error
902 echo "testing GNS with DEADLOCK upcall in CONCUR3 mode"
904 local MODE="DEADLOCK"
906 check_gns $MODE $DIR/gns_test_2f $DIR/gns_test_2f $TIMOUT $TICK CONCUR3 || {
908 cleanup_object $DIR/gns_test_2f
909 cleanup_loop $LOOP_DEV $LOOP_FILE
915 cleanup_object $DIR/gns_test_2f
916 cleanup_loop $LOOP_DEV $LOOP_FILE
919 run_test 2f " odd conditions (mount point is modifying during mount) ===="
922 local LOOP_DEV=$(find_free_loop 2>/dev/null)
923 local LOOP_FILE="/tmp/gns_loop_2g"
924 local OBJECT=".mntinfo"
928 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
929 error "can't find free loop device"
931 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
932 cleanup_loop $LOOP_DEV $LOOP_FILE
933 setup_loop $LOOP_DEV $LOOP_FILE || error
935 echo "setting up GNS timeouts and mount object..."
936 setup_gns $OBJECT $TIMOUT $TICK || error
940 echo "preparing mount object at $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT..."
941 setup_object $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
942 $OBJECT "-t ext2 $LOOP_DEV" || error
943 chmod u+s $DIR/gns_test_2g -R
948 echo "testing GNS with DEADLOCK upcall in GENERIC mode"
950 local MODE="DEADLOCK"
952 check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
953 $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC || {
955 cleanup_object $DIR/gns_test_2g
956 cleanup_loop $LOOP_DEV $LOOP_FILE
957 error "recursive mount point does not work"
963 echo "turning SUID on $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT off"
964 chmod u-s $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT
968 check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
969 $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC && {
971 cleanup_object $DIR/gns_test_2g
972 cleanup_loop $LOOP_DEV $LOOP_FILE
973 error "GNS works whereas mount point is not SUID marked dir"
978 cleanup_object $DIR/gns_test_2g
979 cleanup_loop $LOOP_DEV $LOOP_FILE
982 run_test 2g " odd conditions (mount point is recursive marked SUID dir) ="
985 local LOOP_DEV=$(find_free_loop 2>/dev/null)
986 local LOOP_FILE="/tmp/gns_loop_2h"
987 local OBJECT=".mntinfo"
991 test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
992 error "can't find free loop device"
994 echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
995 cleanup_loop $LOOP_DEV $LOOP_FILE
996 setup_loop $LOOP_DEV $LOOP_FILE || error
998 echo "setting up GNS timeouts and mount object..."
999 setup_gns $OBJECT $TIMOUT $TICK || error
1003 echo "preparing mount object at $DIR/gns_test_2h/$OBJECT..."
1004 setup_object $DIR/gns_test_2h $OBJECT "-t ext2 $LOOP_DEV" || error
1009 echo "testing GNS with GENERIC upcall in GENERIC mode"
1011 check_gns GENERIC $DIR/gns_test_2h $DIR/gns_test_2h \
1012 $TIMOUT $TICK GENERIC BACKGROUND || {
1014 cleanup_object $DIR/gns_test_2h
1015 cleanup_loop $LOOP_DEV $LOOP_FILE
1021 cleanup_object $DIR/gns_test_2h
1022 cleanup_loop $LOOP_DEV $LOOP_FILE
1025 run_test 2h " odd conditions (mounting in background) ==================="
1031 log "cleanup: ==========================================================="
1032 if [ "`mount | grep ^$NAME`" ]; then
1033 rm -rf $DIR/[Rdfs][1-9]*
1034 if [ "$I_MOUNTED" = "yes" ]; then
1035 sh llmountcleanup.sh || error
1039 echo '=========================== finished ==============================='
1040 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true