Whamcloud - gitweb
b=1719
[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 TCPBUF=1048576
16  
17
18 h2elan () {
19     echo $1 | sed 's/[^0-9]*//g'
20 }
21
22 h2tcp () {
23     echo "${1}"
24 }
25
26 [ -f $config ] && rm $config
27
28 # Client node
29 ${LMC} --add net --node client --nid '*' --nettype elan || exit 1
30 # Router node
31 ${LMC} --add net --router --node $ROUTER --tcpbuf $TCPBUF --nid `h2tcp $ROUTER` --nettype tcp || exit 1
32 ${LMC} --add net --node $ROUTER --nid `h2elan $ROUTER` --nettype elan|| exit 1
33 ${LMC} -m $config --add route --node $ROUTER --nettype elan --gw `h2elan $ROUTER` --lo `h2elan $CLIENT_LO` --hi `h2elan $CLIENT_HI` || exit 2
34
35 for s in $SERVERS
36  do
37    # server node
38    ${LMC} --add net --node $s --tcpbuf $TCPBUF --nid $s --nettype tcp || exit 1
39    # route to server
40    ${LMC} --add route --node $ROUTER --nettype tcp --gw `h2tcp $ROUTER` --lo $s || exit 2
41    # the device on the server
42    ${LMC} --add ost --node $s --obd obd_$s --obdtype=obdecho || exit 3
43    # attach to the device on the client (this would normally be a mount)
44    ${LMC} --add oscref --node client --osc  OSC_obd_$s || exit 4
45 done