Debian Codegraph @

ctdb/tests/UNIT/eventscripts/stubs/multipath

raw
1 #!/bin/sh
2
3 usage()
4 {
5 die "usage: ${0} -ll device"
6 }
7
8 [ "$1" = "-ll" ] || usage
9 shift
10 [ $# -eq 1 ] || usage
11
12 device="$1"
13
14 if [ -n "$FAKE_MULTIPATH_HANG" ]; then
15 FAKE_SLEEP_REALLY="yes" sleep 999
16 fi
17
18 path1_state="active"
19 path2_state="enabled"
20
21 for i in $FAKE_MULTIPATH_FAILURES; do
22 if [ "$device" = "$i" ]; then
23 path1_state="inactive"
24 path2_state="inactive"
25 break
26 fi
27 done
28
29 cat <<EOF
30 ${device} (AUTO-01234567) dm-0 ,
31 size=10G features='0' hwhandler='0' wp=rw
32 |-+- policy='round-robin 0' prio=1 status=${path1_state}
33 | \`- #:#:#:# vda 252:0 active ready running
34 \`-+- policy='round-robin 0' prio=1 status=${path2_state}
35 \`- #:#:#:# vdb 252:16 active ready running
36 EOF