5 LUSTRE=${LUSTRE:-`dirname $0`/..}
6 PATH=$PATH:$LUSTRE/utils:$LUSTRE/tests
8 . $LUSTRE/../ltest/functional/llite/common/common.sh
12 # XXX I wish all this stuff was in some default-config.sh somewhere
13 MDSNODE=${MDSNODE:-mdev6}
14 OSTNODE=${OSTNODE:-mdev7}
15 CLIENT=${CLIENTNODE:-mdev8}
16 NETWORKTYPE=${NETWORKTYPE:-tcp}
17 MOUNTPT=${MOUNTPT:-/mnt/lustre}
18 CONFIG=recovery-small.xml
25 $PDSH $MDSNODE "PATH=\$PATH:$LUSTRE/utils:$LUSTRE/tests; cd $PWD; $@"
29 $PDSH $CLIENT "PATH=\$PATH:$LUSTRE/utils:$LUSTRE/tests; cd $PWD; $@"
33 $PDSH $OSTNODE "PATH=\$PATH:$LUSTRE/utils:$LUSTRE/tests; cd $PWD; $@"
37 do_mds "echo 0x121 > /proc/sys/lustre/fail_loc"
38 do_client "$1 & sleep ${TIMEOUT:-5}; sleep 2; kill \$!"
39 do_mds "echo 0 > /proc/sys/lustre/fail_loc"
44 for NODE in $CLIENT $MDSNODE $OSTNODE; do
45 lmc -m $CONFIG --add net --node $NODE --nid `h2$NETWORKTYPE $NODE` \
46 --nettype $NETWORKTYPE || exit 4
48 lmc -m $CONFIG --add mds --node $MDSNODE --mds mds1 --dev $MDSDEV \
49 --size $MDSSIZE || exit 5
50 lmc -m $CONFIG --add ost --node $OSTNODE --ost ost1 --dev $OSTDEV \
51 --size $OSTSIZE || exit 6
52 lmc -m $CONFIG --add mtpt --node $CLIENT --path $MOUNTPT --mds mds1 \
57 do_mds "lconf $@ $CONFIG"
61 do_mds "lconf $@ --cleanup $CONFIG"
65 do_ost "lconf $@ $CONFIG"
69 do_ost "lconf $@ --cleanup $CONFIG"
73 do_client "lconf $@ $CONFIG"
77 do_client "lconf $@ --cleanup $CONFIG"
82 start_mds ${REFORMAT:---reformat}
83 start_ost ${REFORMAT:---reformat}
84 mount_client --timeout=${TIMEOUT:-5} --recovery_upcall=/bin/true
88 do_mds "echo 0 > /proc/sys/lustre/fail_loc"
89 unmount_client $@ || true
90 shutdown_mds $@ || true
91 shutdown_ost $@ || true
95 # wait to make sure we enter recovery
96 # it'd be better if the upcall notified us somehow, I think
97 sleep $(( ${TIMEOUT:-5} + 2 ))
102 unmount_client --force
103 mount_client --timeout=${TIMEOUT:-5} --recovery_upcall=/bin/true
106 if [ ! -z "$ONLY" ]; then
112 drop_request "mcreate /mnt/lustre/1" & wait_for_timeout
115 drop_request "tchmod 111 /mnt/lustre/2" & wait_for_timeout
118 drop_request "statone /mnt/lustre/2" & wait_for_timeout
121 do_client "cp /etc/resolv.conf /mnt/lustre/resolv.conf"
122 drop_request "cat /mnt/lustre/resolv.conf > /dev/null" & wait_for_timeout
125 drop_request "mv /mnt/lustre/resolv.conf /mnt/lustre/renamed" & wait_for_timeout
128 drop_request "mlink /mnt/lustre/renamed-again /mnt/lustre/link1" & wait_for_timeout
131 drop_request "munlink /mnt/lustre/link1" & wait_for_timeout