5 LUSTRE=${LUSTRE:-`dirname $0`/..}
6 . $LUSTRE/tests/test-framework.sh
10 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
12 ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
19 add_mds mds --dev $MDSDEV --size $MDSSIZE
20 add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
21 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
22 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE --failover
23 if [ ! -z "$ostfailover_HOST" ]; then
24 add_ostfailover ost --dev $OSTDEV --size $OSTSIZE
26 add_client client mds --lov lov1 --path $MOUNT
30 # make sure we are using the primary MDS, so the config log will
31 # be able to clean up properly.
32 activeost=`facet_active ost`
33 if [ $activeost != "ost" ]; then
37 stop mds ${FORCE} $MDSLCONFARGS
38 stop ost ${FORCE} --dump cleanup.log
41 if [ "$ONLY" == "cleanup" ]; then
42 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 this test."
61 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
62 start mds --reformat $MDSLCONFARGS
70 cp /etc/profile $DIR/$tfile
72 diff /etc/profile $DIR/$tfile
74 run_test 0 "empty replay"
80 $CHECKSTAT -t file $DIR/$tfile || return 1
87 echo "tag-$i" > $DIR/$tfile-$i
91 grep -q "tag-$i" $DIR/$tfile-$i || error "f1c-$i"
94 run_test 2 "|x| 10 open(O_CREAT)s"
97 verify=$ROOT/tmp/verify-$$
98 dd if=/dev/urandom bs=1024 count=5120 | tee $verify > $DIR/$tfile &
102 wait $ddpid || return 1
103 cmp $verify $DIR/$tfile || return 2
106 run_test 3 "Fail OST during write, with verification"
109 verify=$ROOT/tmp/verify-$$
110 dd if=/dev/urandom bs=1024 count=5120 | tee $verify > $DIR/$tfile
111 # invalidate cache, so that we're reading over the wire
112 for i in /proc/fs/lustre/ldlm/namespaces/OSC_*MNT*; do
113 echo -n clear > $i/lru_size
115 cmp $verify $DIR/$tfile &
118 wait $cmppid || return 1
121 run_test 4 "Fail OST during read, with verification"
123 equals_msg test complete, cleaning up