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"
39 do_mds "echo 0 > /proc/sys/lustre/fail_loc"
43 do_mds "echo 0x120 > /proc/sys/lustre/fail_loc"
45 do_mds "echo 0 > /proc/sys/lustre/fail_loc"
50 for NODE in $CLIENT $MDSNODE $OSTNODE; do
51 lmc -m $CONFIG --add net --node $NODE --nid `h2$NETWORKTYPE $NODE` \
52 --nettype $NETWORKTYPE || exit 4
54 lmc -m $CONFIG --add mds --node $MDSNODE --mds mds1 --dev $MDSDEV \
55 --size $MDSSIZE || exit 5
56 lmc -m $CONFIG --add ost --node $OSTNODE --ost ost1 --dev $OSTDEV \
57 --size $OSTSIZE || exit 6
58 lmc -m $CONFIG --add mtpt --node $CLIENT --path $MOUNTPT --mds mds1 \
63 do_mds "lconf $@ $CONFIG"
67 do_mds "lconf $@ --cleanup $CONFIG"
71 do_ost "lconf $@ $CONFIG"
75 do_ost "lconf $@ --cleanup $CONFIG"
79 do_client "lconf $@ $CONFIG"
83 do_client "lconf $@ --cleanup $CONFIG"
88 start_mds ${REFORMAT:---reformat}
89 start_ost ${REFORMAT:---reformat}
90 # XXX we should write our own upcall, when we move this somewhere better.
91 mount_client --timeout=${TIMEOUT:-5} \
92 --recovery_upcall=$PWD/../../ltest/functional/llite/09/client-upcall.sh
96 do_mds "echo 0 > /proc/sys/lustre/fail_loc"
97 unmount_client $@ || true
98 shutdown_mds $@ || true
99 shutdown_ost $@ || true
104 do_mds 'echo -e "device \$mds1\\nprobe\\nnotransno\\nreadonly" | lctl'
109 do_client "df -h $MOUNTPT" # trigger failover, if we haven't already
112 if [ ! -z "$ONLY" ]; then
118 drop_request "mcreate /mnt/lustre/1"
119 drop_reply "mcreate /mnt/lustre/2"
120 # replay "mcreate /mnt/lustre/3"
122 drop_request "tchmod 111 /mnt/lustre/2"
123 drop_reply "tchmod 666 /mnt/lustre/2"
124 # replay "tchmod 444 /mnt/lustre/2"
126 drop_request "statone /mnt/lustre/2"
127 drop_reply "statone /mnt/lustre/2"
128 # replay "statone /mnt/lustre/2"
130 do_client "cp /etc/resolv.conf /mnt/lustre/resolv.conf"
131 drop_request "cat /mnt/lustre/resolv.conf > /dev/null"
132 drop_reply "cat /mnt/lustre/resolv.conf > /dev/null"
134 drop_request "mv /mnt/lustre/resolv.conf /mnt/lustre/renamed"
135 drop_reply "mv /mnt/lustre/renamed /mnt/lustre/renamed-again"
137 drop_request "mlink /mnt/lustre/renamed-again /mnt/lustre/link1"
138 drop_reply "mlink /mnt/lustre/renamed-again /mnt/lustre/link2"
140 drop_request "munlink /mnt/lustre/link1"
141 drop_reply "munlink /mnt/lustre/link2"