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 add_mds mds --dev "$MDSDEV" --size "$MDSSIZE"
17 add_lov lov1 mds --stripe_sz $STRIPE_BYTES \
18 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
19 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE --failover
20 if [ ! -z "$ostfailover_HOST" ]; then
21 add_ostfailover ost --dev $OSTDEV --size $OSTSIZE
23 add_client client mds --lov lov1 --path $MOUNT
27 # make sure we are using the primary MDS, so the config log will
28 # be able to clean up properly.
29 activeost=`facet_active ost`
30 if [ $activeost != "ost" ]; then
33 zconf_umount `hostname` $MOUNT
34 stop mds ${FORCE} $MDSLCONFARGS
35 stop ost ${FORCE} --dump $TMP/replay-ost-single-`hostname`.log
39 if [ "$ONLY" == "cleanup" ]; then
40 sysctl -w portals.debug=0
47 SETUP=${SETUP:-"setup"}
48 CLEANUP=${CLEANUP:-"cleanup"}
53 start ost --reformat $OSTLCONFARGS
54 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
55 start mds --reformat $MDSLCONFARGS
57 if [ -z "`grep " $MOUNT " /proc/mounts`" ]; then
58 # test "-1" needed during initial client->OST connection
59 log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`"
61 #define OBD_FAIL_OST_ALL_REPLY_NET 0x211
62 do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
64 zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
72 LCOUNT=${LCOUNT:-10000}
75 ./createmany -o $DIR/llog-%d $LCOUNT
78 run_test 0 "Prepare fileset"
81 ./chownmany 1000 $DIR/llog-%d $LCOUNT
83 $CHECKSTAT -u \#1000 $DIR/llog-* || return 4
85 run_test 1 "Do chowns"
88 HALFCOUNT=${HALFCOUNT:-17}
89 ./chownmany 500 $DIR/llog-%d 0 $HALFCOUNT
91 ./chownmany 500 $DIR/llog-%d $HALFCOUNT $LCOUNT
93 $CHECKSTAT -u \#500 $DIR/llog-* || return 5
95 run_test 2 "Fail OST during chown"
98 ./unlinkmany $DIR/llog-%d $LCOUNT
100 $CHECKSTAT -t file $DIR/llog-* && return 10 || true
102 run_test 3 "Remove testset"
104 equals_msg test complete, cleaning up
105 FORCE=--force $CLEANUP