Create LISP test for csit_topology and for vpp_lite_topology
[one.git] / tests / data_plane / vpp_lite_topo / lisp_ip6.sh
1 #!/usr/bin/env bash
2
3 function ping_lisp6 {
4   sudo ip netns exec vppns1 ping6 -c 10 6:0:2::2
5   if [ $? -ne 0 ] ; then
6       echo "Can not ping other machine"
7       exit -1
8   fi
9 }
10
11 sudo ip netns exec vppns1 \
12   bash -c "
13     ip link set dev lo up
14     ip addr add 6:0:1::2/64 dev veth_vpp1
15     ip route add 6:0:2::0/64 via 6:0:1::1
16 "
17
18 sudo ip netns exec vppns2 \
19   bash -c "
20     ip link set dev lo up
21     ip addr add 6:0:2::2/64 dev veth_vpp2
22     ip route add 6:0:1::0/64 via 6:0:2::1
23 "
24
25 curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
26      -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG1_6}" \
27      -u ${ODL_USER}:${ODL_PASSWD}
28 curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:add-mapping \
29      -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_ADD_CONFIG2_6}" \
30      -u ${ODL_USER}:${ODL_PASSWD}
31
32 ping_lisp6
33
34 expect << EOF
35 spawn telnet localhost 5003
36 expect -re ".*>"
37 send "set int ip address del host-intervpp2 6:0:3::2/64\r"
38 expect -re ".*>"
39 send "set int ip address host-intervpp2 6:0:3::20/64\r"
40 expect -re ".*>"
41 EOF
42
43 curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:update-mapping \
44      -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${ODL_REPLACE_CONFIG2_6}" \
45      -u ${ODL_USER}:${ODL_PASSWD}
46
47 ping_lisp6