7 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
8 MOUNT1=${MOUNT1:-/mnt/lustre1}
9 MOUNT2=${MOUNT2:-/mnt/lustre2}
10 export NAME=${NAME:-mount2}
14 sh llmountcleanup.sh > /dev/null
20 sh llrmount.sh > /dev/null
35 mount | grep $MOUNT1 || sh llmount.sh
37 echo -n "test 1: check create on 2 mtpt's..."
39 [ -f $MOUNT2/f1 ] || error
42 echo "test 2: check attribute updates on 2 mtpt's..."
44 $CHECKSTAT -t file -p 0777 $MOUNT1/f1 || error
47 echo "test 2b: check cached attribute updates on 2 mtpt's..."
51 $CHECKSTAT -t file -p 0777 $MOUNT1/f2b || error
54 echo "test 2c: check cached attribute updates on 2 mtpt's..."
58 $CHECKSTAT -t file -p 0777 $MOUNT2/f2c || error
61 echo "test 3: check after remount attribute updates on 2 mtpt's..."
65 $CHECKSTAT -t file -p 0666 $MOUNT1/f1 || error
68 echo "test 4: unlink on one mountpoint removes file on other..."
70 $CHECKSTAT -a $MOUNT1/f1 || error
73 echo -n "test 5: symlink on one mtpt, readlink on another..."
74 ( cd $MOUNT1 ; ln -s this/is/good lnk )
76 [ "this/is/good" = "`perl -e 'print readlink("/mnt/lustre2/lnk");'`" ] || error
79 echo -n "test 6: fstat validation on multiple mount points..."
80 ./multifstat $MOUNT1/f6 $MOUNT2/f6
83 echo "test 9: remove of open file on other node..."
84 ./openunlink $MOUNT1/f9 $MOUNT2/f9 || error
87 echo -n "test 10: append of file with sub-page size on multiple mounts..."
90 for C in a b c d e f g h i j k l; do
91 MOUNT=`eval echo \\$MOUNT$MTPT`
92 echo -n $C >> $MOUNT/f10
93 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
95 [ "`cat $MOUNT1/f10`" = "abcdefghijkl" ] && pass || error
97 echo -n "test 11: write of file with sub-page size on multiple mounts..."
101 for C in a b c d e f g h i j k l; do
102 MOUNT=`eval echo \\$MOUNT$MTPT`
103 echo -n $C | dd of=$MOUNT/f11 bs=1 seek=$OFFSET count=1
104 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
105 OFFSET=`expr $OFFSET + 1`
107 [ "`cat $MOUNT1/f11`" = "abcdefghijkl" ] && pass || error
109 echo "test 12: file length and contents across mounts"
110 dd if=$SHELL of=$MOUNT1/f12 bs=4096 count=1
111 $CHECKSTAT -s 4096 $MOUNT1/f12 $MOUNT2/f12 || error
112 dd if=$SHELL bs=4096 count=1 | \
113 md5sum - $MOUNT1/f12 $MOUNT2/f12 | ( \
115 while read SUM FILE ; do \
116 [ $SUM == $GOODSUM ] || exit 2; \
119 echo "test 13: open(,O_TRUNC,), close() across mounts"
120 dd if=$SHELL of=$MOUNT1/f13 bs=4096 count=1
122 $CHECKSTAT -s 0 $MOUNT1/f13 $MOUNT2/f13 || error
124 echo "test 14: file extension while holding the fd open"
127 touch $MOUNT1/f14-start
130 mv $MOUNT1/f14-start $MOUNT1/f14-going;
131 while [ -f $MOUNT1/f14-going ] ; do sleep 1; done;
133 while [ -f $MOUNT1/f14-start ] ; do sleep 1; done;
134 $CHECKSTAT -s 1 $MOUNT1/f14 $MOUNT2/f14 || error
137 rm -f $MOUNT1/f[0-9]* $MOUNT1/lnk