diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2016-06-29 14:53:39 +0200 |
---|---|---|
committer | Filip Tehlar <ftehlar@cisco.com> | 2016-06-29 15:48:00 +0200 |
commit | 572c17d6b9db44b8e0fb70222a13272fe41a4a7e (patch) | |
tree | d101e68bf3591d592a648080fe29b962b95f5f60 /tests/data_plane/vpp_lite_topo | |
parent | af09353134cdd9c6ea250851b22086e7237073d4 (diff) |
Add RTR + EID virt test (6over46)
Change-Id: Ia21075fc33059165f1fcef1bcb177e54dee0e6b8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'tests/data_plane/vpp_lite_topo')
-rw-r--r-- | tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface_two_customers.sh | 50 | ||||
-rw-r--r-- | tests/data_plane/vpp_lite_topo/test_driver/two_customers_topo.sh | 4 | ||||
-rwxr-xr-x | tests/data_plane/vpp_lite_topo/test_rtr_two_iface_6o46.sh (renamed from tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh) | 7 | ||||
-rwxr-xr-x | tests/data_plane/vpp_lite_topo/test_rtr_two_iface_two_customers_6o46.sh | 20 | ||||
-rw-r--r-- | tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface_two_customers.sh | 167 |
5 files changed, 242 insertions, 6 deletions
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface_two_customers.sh b/tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface_two_customers.sh new file mode 100644 index 0000000..46e0918 --- /dev/null +++ b/tests/data_plane/vpp_lite_topo/test_driver/rtr_two_iface_two_customers.sh @@ -0,0 +1,50 @@ +source config.sh +source odl_utils.sh +source topologies/rtr_two_iface_two_customers.sh + +ODL_CONFIG_FILE1="vpp1_customer1.json" +ODL_CONFIG_FILE2="vpp2_customer1.json" +ODL_CONFIG_FILE3="vpp1_customer2.json" +ODL_CONFIG_FILE4="vpp2_customer2.json" + +if [ "$1" == "clean" ] ; then + rtr_two_iface_clean + exit 0 +fi + +if [[ $(id -u) != 0 ]]; then + echo "Error: run this as a root." + exit 1 +fi + +function test_rtr_two_iface_two_customers { + rtr_two_iface_two_customers_setup + sleep 1 + + test_result=0 + rc=0 + + ip netns exec vpp1-cus1-ns "${1}" -w 20 -c 1 "${2}" + rc=$? + if [ $rc -ne 0 ] ; then + echo "Error: customer 1 did not receive any response!" + test_result=1 + fi + + ip netns exec vpp1-cus2-ns "${1}" -w 20 -c 1 "${2}" + rc=$? + if [ $rc -ne 0 ] ; then + echo "Error: customer 2 did not receive any response!" + test_result=1 + fi + + rtr_two_iface_two_customers_clean + + if [ $rc -ne 0 ] ; then + echo "Test failed: No ICMP response received within specified timeout limit!" + else + echo "Test passed." + fi + + exit $test_result +} diff --git a/tests/data_plane/vpp_lite_topo/test_driver/two_customers_topo.sh b/tests/data_plane/vpp_lite_topo/test_driver/two_customers_topo.sh index 79349b6..174a683 100644 --- a/tests/data_plane/vpp_lite_topo/test_driver/two_customers_topo.sh +++ b/tests/data_plane/vpp_lite_topo/test_driver/two_customers_topo.sh @@ -30,7 +30,7 @@ function test_eid_virtualization { ip netns exec vpp1-cus1-ns "${1}" -w 20 -c 1 "${2}" rc=$? if [ $rc -ne 0 ] ; then - echo "Error: customer 1 did not reveive any response!" + echo "Error: customer 1 did not receive any response!" fi #read -p "press any key to continue .." -n1 @@ -38,7 +38,7 @@ function test_eid_virtualization { ip netns exec vpp1-cus2-ns "${1}" -w 20 -c 1 "${2}" rc=$? if [ $rc -ne 0 ] ; then - echo "Error: customer 2 did not reveive any response!" + echo "Error: customer 2 did not receive any response!" fi # two_customers_topo_clean diff --git a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_6o46.sh index 8c16d68..fd59664 100755 --- a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_mixed.sh +++ b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_6o46.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -# Test for VPP LISP RTR functionality (4over4). +# Test for VPP LISP RTR functionality (6over46). # # IMPORTANT: This test needs to have ODL running with following config # line in etc/custom.properties: @@ -9,11 +9,10 @@ # # This test configures a topology of two XTRs and RTR. An ICMP request is # sent from host1 behind first TR to the host2 behind the second TR. -# Both host and underlaying networks are IPv4. # -VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/rtr_two_iface/mixed" -ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface/mixed/" +VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/rtr_two_iface/6o46" +ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface/6o46" source test_driver/rtr_two_iface.sh diff --git a/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_two_customers_6o46.sh b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_two_customers_6o46.sh new file mode 100755 index 0000000..eac2a7c --- /dev/null +++ b/tests/data_plane/vpp_lite_topo/test_rtr_two_iface_two_customers_6o46.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# +# Test for VPP LISP RTR functionality with EID virualization. +# +# IMPORTANT: This test needs to have ODL running with following config +# line in etc/custom.properties: +# lisp.elpPolicy = replace +# +# This test configures a topology of two XTRs and RTR. An ICMP request is +# sent from host1 behind first TR to the host2 behind the second TR. +# +# + +VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/rtr_two_iface_two_customers/6o46" +ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_two_iface_two_customers/6o46" + +source test_driver/rtr_two_iface_two_customers.sh + +test_rtr_two_iface_two_customers ping6 "6:0:4::4" diff --git a/tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface_two_customers.sh b/tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface_two_customers.sh new file mode 100644 index 0000000..ac9020d --- /dev/null +++ b/tests/data_plane/vpp_lite_topo/topologies/rtr_two_iface_two_customers.sh @@ -0,0 +1,167 @@ + +#!/usr/bin/env bash + +function rtr_two_iface_two_customers_clean { + echo "Clearing all VPP instances.." + pkill vpp --signal 9 + + rm /dev/shm/* + + echo "Cleaning RTR topology.." + ip netns exec vpp1-rtr-ns ifconfig vppbr1 down + ip netns exec vpp1-rtr-ns brctl delbr vppbr1 + ip netns exec vpp2-rtr-ns ifconfig vppbr2 down + ip netns exec vpp2-rtr-ns brctl delbr vppbr2 + ip link del dev vpp1 &> /dev/null + ip link del dev vpp2 &> /dev/null + ip link del dev vpp1_rtr &> /dev/null + ip link del dev rtr1_vpp1 &> /dev/null + ip link del dev vpp2_rtr &> /dev/null + ip link del dev rtr_vpp2 &> /dev/null + ip link del dev odl_vpp1 &> /dev/null + ip link del dev odl_vpp2 &> /dev/null + + ip netns del vpp1-cus1-ns &> /dev/null + ip netns del vpp2-cus1-ns &> /dev/null + ip netns del vpp1-cus2-ns &> /dev/null + ip netns del vpp2-cus2-ns &> /dev/null + ip netns del vpp1-rtr-ns &> /dev/null + ip netns del vpp2-rtr-ns &> /dev/null + + odl_clear_all +} + +function rtr_two_iface_two_customers_setup { + # create namespaces + ip netns add vpp1-cus1-ns + ip netns add vpp1-cus2-ns + ip netns add vpp2-cus1-ns + ip netns add vpp2-cus2-ns + ip netns add vpp1-rtr-ns + ip netns add vpp2-rtr-ns + + # create pair interfaces between vpp[1|2], rtr and odl + ip link add veth_vpp1_rtr type veth peer name vpp1_rtr + ip link add veth_rtr_vpp1 type veth peer name rtr_vpp1 + ip link add veth_vpp2_rtr type veth peer name vpp2_rtr + ip link add veth_rtr_vpp2 type veth peer name rtr_vpp2 + ip link add veth_odl_vpp1 type veth peer name odl_vpp1 + ip link add veth_odl_vpp2 type veth peer name odl_vpp2 + + # enable peer interfaces + ip link set dev vpp1_rtr up + ip link set dev rtr_vpp1 up + ip link set dev vpp2_rtr up + ip link set dev rtr_vpp2 up + ip link set dev odl_vpp1 up + ip link set dev odl_vpp2 up + + # enable veth interfaces and set them in the appropriate ip ns + ip link set dev veth_vpp1_rtr up netns vpp1-rtr-ns + ip link set dev veth_rtr_vpp1 up netns vpp1-rtr-ns + ip link set dev veth_vpp2_rtr up netns vpp2-rtr-ns + ip link set dev veth_rtr_vpp2 up netns vpp2-rtr-ns + ip link set dev veth_odl_vpp1 up netns vpp1-rtr-ns + ip link set dev veth_odl_vpp2 up netns vpp2-rtr-ns + + # vpp1, rtr and odl + ip netns exec vpp1-rtr-ns brctl addbr vppbr1 + ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_vpp1_rtr + ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_rtr_vpp1 + ip netns exec vpp1-rtr-ns brctl addif vppbr1 veth_odl_vpp1 + ip netns exec vpp1-rtr-ns ifconfig vppbr1 up + + # vpp2, rtr and odl + ip netns exec vpp2-rtr-ns brctl addbr vppbr2 + ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_vpp2_rtr + ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_rtr_vpp2 + ip netns exec vpp2-rtr-ns brctl addif vppbr2 veth_odl_vpp2 + ip netns exec vpp2-rtr-ns ifconfig vppbr2 up + + # vpp1 to client1 + ip link add veth_vpp1_cus1 type veth peer name vpp1_cus1 + ip link set dev vpp1_cus1 up + ip link set dev veth_vpp1_cus1 up netns vpp1-cus1-ns + + ip netns exec vpp1-cus1-ns \ + bash -c " + ip link set dev lo up + ip addr add 6.0.2.2/24 dev veth_vpp1_cus1 + ip addr add 6:0:2::2/64 dev veth_vpp1_cus1 + ip route add 6.0.4.0/24 via 6.0.2.1 + ip route add 6:0:4::0/64 via 6:0:2::1 + " + # vpp1 to client2 + ip link add veth_vpp1_cus2 type veth peer name vpp1_cus2 + ip link set dev vpp1_cus2 up + ip link set dev veth_vpp1_cus2 up netns vpp1-cus2-ns + + ip netns exec vpp1-cus2-ns \ + bash -c " + ip link set dev lo up + ip addr add 6.0.2.2/24 dev veth_vpp1_cus2 + ip addr add 6:0:2::2/64 dev veth_vpp1_cus2 + ip route add 6.0.4.0/24 via 6.0.2.1 + ip route add 6:0:4::0/64 via 6:0:2::1 + " + + # vpp2 to client1 + ip link add veth_vpp2_cus1 type veth peer name vpp2_cus1 + ip link set dev vpp2_cus1 up + ip link set dev veth_vpp2_cus1 up netns vpp2-cus1-ns + + ip netns exec vpp2-cus1-ns \ + bash -c " + ip link set dev lo up + ip addr add 6.0.4.4/24 dev veth_vpp2_cus1 + ip addr add 6:0:4::4/64 dev veth_vpp2_cus1 + ip route add 6.0.2.0/24 via 6.0.4.1 + ip route add 6:0:2::0/64 via 6:0:4::1 + " + # vpp2 to client2 + ip link add veth_vpp2_cus2 type veth peer name vpp2_cus2 + ip link set dev vpp2_cus2 up + ip link set dev veth_vpp2_cus2 up netns vpp2-cus2-ns + + ip netns exec vpp2-cus2-ns \ + bash -c " + ip link set dev lo up + ip addr add 6.0.4.4/24 dev veth_vpp2_cus2 + ip addr add 6:0:4::4/64 dev veth_vpp2_cus2 + ip route add 6.0.2.0/24 via 6.0.4.1 + ip route add 6:0:2::0/64 via 6:0:4::1 + " + + # vpp1 to odl + ip addr add 6.0.3.100/24 dev odl_vpp1 + ip addr add 6:0:3::100/64 dev odl_vpp1 + ethtool --offload odl_vpp1 rx off tx off + + # vpp2 to odl + ip addr add 6.0.5.100/24 dev odl_vpp2 + ip addr add 6:0:5::100/64 dev odl_vpp2 + ethtool --offload odl_vpp2 rx off tx off + + ${VPP_LITE_BIN} \ + unix { log /tmp/vpp1.log cli-listen \ + localhost:5002 full-coredump \ + exec ${VPP_LITE_CONF}/vpp1.config } \ + api-trace { on } api-segment {prefix xtr1} + + ${VPP_LITE_BIN} \ + unix { log /tmp/vpp2.log cli-listen \ + localhost:5003 full-coredump \ + exec ${VPP_LITE_CONF}/vpp2.config } \ + api-trace { on } api-segment {prefix xtr2} + + ${VPP_LITE_BIN} \ + unix { log /tmp/rtr.log cli-listen \ + localhost:5004 full-coredump \ + exec ${VPP_LITE_CONF}/rtr.config } \ + api-trace { on } api-segment {prefix rtr} + + post_curl "add-mapping" ${ODL_CONFIG_FILE1} + post_curl "add-mapping" ${ODL_CONFIG_FILE2} + post_curl "add-mapping" ${ODL_CONFIG_FILE3} + post_curl "add-mapping" ${ODL_CONFIG_FILE4} +} |