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}
16 # test 5 needs a larger fs than what local normally has
20 add_mds mds --dev $MDSDEV --size $MDSSIZE
21 add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
22 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
23 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE --failover
24 if [ ! -z "$ostfailover_HOST" ]; then
25 add_ostfailover ost --dev $OSTDEV --size $OSTSIZE
27 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 activeost=`facet_active ost`
34 if [ $activeost != "ost" ]; then
37 zconf_umount `hostname` $MOUNT
38 stop mds ${FORCE} $MDSLCONFARGS
39 stop ost ${FORCE} --dump cleanup.log
42 if [ "$ONLY" == "cleanup" ]; then
43 sysctl -w portals.debug=0
54 start ost --reformat $OSTLCONFARGS
56 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
57 start mds --reformat $MDSLCONFARGS
58 zconf_mount `hostname` $MOUNT
64 cp /etc/profile $DIR/$tfile
66 diff /etc/profile $DIR/$tfile
68 run_test 0 "empty replay"
73 $CHECKSTAT -t file $DIR/$tfile || return 1
79 echo "tag-$i" > $DIR/$tfile-$i
83 grep -q "tag-$i" $DIR/$tfile-$i || error "f1c-$i"
86 run_test 2 "|x| 10 open(O_CREAT)s"
89 verify=$ROOT/tmp/verify-$$
90 dd if=/dev/urandom bs=1024 count=5120 | tee $verify > $DIR/$tfile &
94 wait $ddpid || return 1
95 cmp $verify $DIR/$tfile || return 2
96 rm -f $verify $DIR/$tfile
98 run_test 3 "Fail OST during write, with verification"
101 verify=$ROOT/tmp/verify-$$
102 dd if=/dev/urandom bs=1024 count=5120 | tee $verify > $DIR/$tfile
103 # invalidate cache, so that we're reading over the wire
104 for i in /proc/fs/lustre/ldlm/namespaces/OSC_*MNT*; do
105 echo -n clear > $i/lru_size
107 cmp $verify $DIR/$tfile &
110 wait $cmppid || return 1
111 rm -f $verify $DIR/$tfile
113 run_test 4 "Fail OST during read, with verification"
116 IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r 64 -s 1g"
117 iozone $IOZONE_OPTS -f $DIR/$tfile &
122 wait $PID || return 1
124 run_test 5 "Fail OST during iozone"
126 equals_msg test complete, cleaning up