5 LUSTRE=${LUSTRE:-`dirname $0`/..}
6 . $LUSTRE/tests/test-framework.sh
10 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
14 add_mds mds --dev $MDSDEV --size $MDSSIZE
15 if [ ! -z "$mdsfailover_HOST" ]; then
16 add_mdsfailover mds --dev $MDSDEV --size $MDSSIZE
19 add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
20 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
21 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE
22 add_ost ost2 --lov lov1 --dev ${OSTDEV}-2 --size $OSTSIZE
23 add_client client mds --lov lov1 --path $MOUNT
31 # make sure we are using the primary MDS, so the config log will
32 # be able to clean up properly.
33 activemds=`facet_active mds`
34 if [ $activemds != "mds" ]; then
43 stop ost ${FORCE} --dump cleanup-dual.log
46 if [ "$ONLY" == "cleanup" ]; then
47 sysctl -w portals.debug=0
53 start ost --reformat $OSTLCONFARGS
54 PINGER=`cat /proc/fs/lustre/pinger`
56 if [ "$PINGER" != "on" ]; then
57 echo "ERROR: Lustre must be built with --enable-pinger for replay-dual"
62 start ost2 --reformat $OSTLCONFARGS
63 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
64 start mds $MDSLCONFARGS --reformat
68 echo $TIMEOUT > /proc/sys/lustre/timeout
69 echo $UPCALL > /proc/sys/lustre/upcall
71 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
79 checkstat $MOUNT2/a || return 1
80 checkstat $MOUNT1/b || return 2
81 rm $MOUNT2/a $MOUNT1/b
82 checkstat $MOUNT1/a && return 3
83 checkstat $MOUNT2/b && return 4
87 run_test 1 "|X| simple create"
95 checkstat $MOUNT2/adir || return 1
97 checkstat $MOUNT2/adir && return 2
101 run_test 2 "|X| mkdir adir"
106 mkdir $MOUNT2/adir/bdir
109 checkstat $MOUNT2/adir || return 1
110 checkstat $MOUNT1/adir/bdir || return 2
111 rmdir $MOUNT2/adir/bdir $MOUNT1/adir
112 checkstat $MOUNT1/adir && return 3
113 checkstat $MOUNT2/adir/bdir && return 4
117 run_test 3 "|X| mkdir adir, mkdir adir/bdir "
122 mkdir $MOUNT1/adir && return 1
123 mkdir $MOUNT2/adir/bdir
126 checkstat $MOUNT2/adir || return 2
127 checkstat $MOUNT1/adir/bdir || return 3
129 rmdir $MOUNT2/adir/bdir $MOUNT1/adir
130 checkstat $MOUNT1/adir && return 4
131 checkstat $MOUNT2/adir/bdir && return 5
135 run_test 4 "|X| mkdir adir (-EEXIST), mkdir adir/bdir "
139 # multiclient version of replay_single.sh/test_8
141 multiop $MOUNT2/a o_tSc &
143 # give multiop a chance to open
148 wait $pid || return 1
151 [ -e $MOUNT2/a ] && return 2
154 run_test 5 "open, unlink |X| close"
159 multiop $MOUNT2/a o_c &
161 multiop $MOUNT1/a o_c &
163 # give multiop a chance to open
168 wait $pid1 || return 1
172 wait $pid2 || return 1
173 [ -e $MOUNT2/a ] && return 2
176 run_test 6 "open1, open2, unlink |X| close1 [fail mds] close2"
179 if [ "$ONLY" != "setup" ]; then
180 equals_msg test complete, cleaning up