Whamcloud - gitweb
7bfc35a91a612bf3b9da2fb64c523eb6251b5430
[fs/lustre-release.git] / lustre / tests / mcr.sh
1 #!/bin/bash
2
3 config=${1:-mcr.xml}
4
5 LMC="../utils/lmc -m $config"
6
7 # TCP/IP servers
8 SERVERS="ba-ost-1  ba-ost-2"
9 ROUTER=dev5
10
11 # Elan clients
12 CLIENT_LO=dev2
13 CLIENT_HI=dev25
14
15 PORT=988
16 TCPBUF=1048576
17  
18
19 h2elan () {
20     echo $1 | sed 's/[^0-9]*//g'
21 }
22
23 h2ip () {
24     echo "${1}"
25 }
26
27 [ -f $config ] && rm $config
28
29 # Client node
30 ${LMC} --node client --net '*' elan || exit 1
31 # Router node
32 ${LMC} --router --node $ROUTER --tcpbuf $TCPBUF --net `h2ip $ROUTER`  tcp $PORT || exit 1
33 ${LMC} --node $ROUTER --net `h2elan $ROUTER` elan|| exit 1
34 ${LMC} --node $ROUTER --route elan `h2elan $ROUTER` `h2elan $CLIENT_LO` `h2elan $CLIENT_HI` || exit 2
35
36 for s in $SERVERS
37  do
38    # server node
39    ${LMC} --node $s --tcpbuf $TCPBUF --net $s tcp $PORT || exit 1
40    # route to server
41    ${LMC} --node $ROUTER --route tcp `h2ip $ROUTER` $s || exit 2
42    # the device on the server
43    ${LMC} --node $s --obdtype=obdecho --ost || exit 3
44    # attach to the device on the client (this would normally be a moun)
45    ${LMC} --node client --osc  OSC_$s || exit 4
46 done