6 ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"8"} # bug 1557
9 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
11 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
12 CREATETEST=${CREATETEST:-createtest}
14 LSTRIPE=${LSTRIPE:-lstripe}
16 MCREATE=${MCREATE:-mcreate}
17 OPENFILE=${OPENFILE:-openfile}
18 OPENUNLINK=${OPENUNLINK:-openunlink}
19 TOEXCL=${TOEXCL:-toexcl}
20 TRUNCATE=${TRUNCATE:-truncate}
22 if [ $UID -ne 0 ]; then
26 RUNAS_ID=${RUNAS_ID:-500}
27 RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
30 export NAME=${NAME:-mount2}
36 sh llmountcleanup.sh > /dev/null || exit 20
42 sh llrmount.sh > /dev/null || exit 10
49 lctl mark "$*" || true
53 if ! mount | grep -q $DIR1; then
65 if [ "`echo $1 | grep '\<'$O'[a-z]*\>'`" ]; then
73 for X in $EXCEPT $ALWAYS_EXCEPT; do
74 if [ "`echo $1 | grep '\<'$X'[a-z]*\>'`" ]; then
75 echo "skipping excluded test $1"
79 if [ -z "$ONLY" ]; then
94 MOUNT1=`mount| awk '/^'$NAME' .* lustre_lite / { print $3 }'| head -1`
95 MOUNT2=`mount| awk '/^'$NAME' .* lustre_lite / { print $3 }'| tail -1`
96 [ -z "$MOUNT1" ] && error "NAME=$NAME not mounted once"
97 [ "$MOUNT1" = "$MOUNT2" ] && error "NAME=$NAME not mounted twice"
98 [ `mount| awk '/^'$NAME' .* lustre_lite / { print $3 }'| wc -l` -ne 2 ] && \
99 error "NAME=$NAME mounted more than twice"
101 DIR1=${DIR1:-$MOUNT1}
102 DIR2=${DIR2:-$MOUNT2}
103 [ -z "`echo $DIR1 | grep $MOUNT1`" ] && echo "$DIR1 not in $MOUNT1" && exit 96
104 [ -z "`echo $DIR2 | grep $MOUNT2`" ] && echo "$DIR2 not in $MOUNT2" && exit 95
106 rm -f $DIR1/[df][0-9]* $DIR1/lnk
110 [ -f $DIR2/f1 ] || error
112 run_test 1a "check create on 2 mtpt's =========================="
116 $CHECKSTAT -t file -p 0777 $DIR1/f1 || error
119 run_test 1b "check attribute updates on 2 mtpt's ==============="
122 $CHECKSTAT -t file -p 0666 $DIR1/f1 || error
124 run_test 1c "check after remount attribute updates on 2 mtpt's ="
128 $CHECKSTAT -a $DIR1/f1 || error
130 run_test 1d "unlink on one mountpoint removes file on other ===="
136 $CHECKSTAT -t file -p 0777 $DIR1/f2a || error
138 run_test 2a "check cached attribute updates on 2 mtpt's ========"
144 $CHECKSTAT -t file -p 0777 $DIR2/f2b || error
146 run_test 2b "check cached attribute updates on 2 mtpt's ========"
149 ( cd $DIR1 ; ln -s this/is/good lnk )
150 [ "this/is/good" = "`perl -e 'print readlink("'$DIR2/lnk'");'`" ] || \
153 run_test 3 "symlink on one mtpt, readlink on another ==========="
156 ./multifstat $DIR1/f6 $DIR2/f6
158 run_test 4 "fstat validation on multiple mount points =========="
162 truncate $DIR2/f5 100
165 run_test 5 "create a file on one mount, truncate it on the other"
168 ./openunlink $DIR1/f6 $DIR2/f6 || error
170 run_test 6 "remove of open file on other node =================="
173 ./opendirunlink $DIR1/d7 $DIR2/d7 || error
175 run_test 7 "remove of open directory on other node ============="
178 ./opendevunlink $DIR1/dev8 $DIR2/dev8 || error
180 run_test 8 "remove of open special file on other node =========="
185 for C in a b c d e f g h i j k l; do
186 DIR=`eval echo \\$DIR$MTPT`
187 echo -n $C >> $DIR/f9
188 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
190 [ "`cat $DIR1/f9`" = "abcdefghijkl" ] || error
192 run_test 9 "append of file with sub-page size on multiple mounts"
198 for C in a b c d e f g h i j k l; do
199 DIR=`eval echo \\$DIR$MTPT`
200 echo -n $C | dd of=$DIR/f10 bs=1 seek=$OFFSET count=1
201 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
202 OFFSET=`expr $OFFSET + 1`
204 [ "`cat $DIR1/f10`" = "abcdefghijkl" ] || error
206 run_test 10 "write of file with sub-page size on multiple mounts "
208 rm -f $DIR1/f[0-9]* $DIR1/lnk