From 46e4b31a8a57e9af1be2cdbc0c67c153ec9cd9b3 Mon Sep 17 00:00:00 2001 From: Andrej Kozemcak Date: Mon, 16 May 2016 15:46:18 +0200 Subject: Add new test for IP4 over IP6 and IP6 over IP4 Change-Id: Icc411c22f041c447d595cb158102675f4055a7de Signed-off-by: Andrej Kozemcak --- tests/data_plane/vpp_lite_topo/lisp_test.sh | 48 +++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'tests/data_plane/vpp_lite_topo/lisp_test.sh') diff --git a/tests/data_plane/vpp_lite_topo/lisp_test.sh b/tests/data_plane/vpp_lite_topo/lisp_test.sh index 9d33283..9e3070e 100755 --- a/tests/data_plane/vpp_lite_topo/lisp_test.sh +++ b/tests/data_plane/vpp_lite_topo/lisp_test.sh @@ -1,5 +1,15 @@ #!/usr/bin/env bash +if [ "$1" == "-h" ] || [ "$1" == "-help" ] ; then + echo "lisp_test.sh [ip4] [ip6] [ip4_ip6] [4o6] [6o4]" + echo " ip4 - test ip4 topology" + echo " ip6 - test ip6 topology" + echo " ip4_ip6 - test ip4 and ip6 topology" + echo " 4o6 - test ip4 over ip6" + echo " 6o4 - test ip6 over ip4" + exit 0 +fi + set -x # path to vpp executable and configurations folder @@ -10,17 +20,29 @@ VPP1_CONF="vpp1.conf" VPP2_CONF="vpp2.conf" ODL_CONFIG_DIR="../configs/odl/" ODL_ADD_CONFIG1="add_ipv4_odl1.txt" +ODL_ADD_CONFIG1_4o6="add_ipv4o6_odl1.txt" ODL_ADD_CONFIG1_6="add_ipv6_odl1.txt" +ODL_ADD_CONFIG1_6o4="add_ipv6o4_odl1.txt" ODL_ADD_CONFIG2="add_ipv4_odl2.txt" +ODL_ADD_CONFIG2_4o6="add_ipv4o6_odl2.txt" ODL_ADD_CONFIG2_6="add_ipv6_odl2.txt" +ODL_ADD_CONFIG2_6o4="add_ipv6o4_odl2.txt" ODL_REPLACE_CONFIG2="replace_ipv4_odl2.txt" +ODL_REPLACE_CONFIG2_4o6="replace_ipv4o6_odl2.txt" ODL_REPLACE_CONFIG2_6="replace_ipv6_odl2.txt" +ODL_REPLACE_CONFIG2_6o4="replace_ipv6o4_odl2.txt" ODL_USER="admin" ODL_PASSWD="admin" ODL_IP="127.0.0.1" ODL_PORT="8181" +function post_curl { + curl -X POST http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:${1} \ + -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}${2}" \ + -u ${ODL_USER}:${ODL_PASSWD} +} + # make sure there are no vpp instances running sudo pkill vpp @@ -36,6 +58,9 @@ sudo ip netns del vppns1 &> /dev/null sudo ip netns del vppns2 &> /dev/null sudo ip netns del intervppns &> /dev/null +curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \ + -u ${ODL_USER}:${ODL_PASSWD} + if [ "$1" == "clean" ] ; then exit 0; fi @@ -83,11 +108,21 @@ if [ "$1" == "ip6" ] ; then VPP2_CONF="vpp2_6.conf" fi -if [ "$1" == "all" ] ; then +if [ "$1" == "ip4_ip6" ] ; then VPP1_CONF="vpp1_ip4_6.conf" VPP2_CONF="vpp2_ip4_6.conf" fi +if [ "$1" == "4o6" ] ; then + VPP1_CONF="vpp1_4o6.conf" + VPP2_CONF="vpp2_4o6.conf" +fi + +if [ "$1" == "6o4" ] ; then + VPP1_CONF="vpp1_6o4.conf" + VPP2_CONF="vpp2_6o4.conf" +fi + # start vpp1 and vpp2 in separate chroot sudo $VPP_LITE_BIN \ unix { log /tmp/vpp1.log cli-listen \ @@ -110,7 +145,7 @@ if [ "$1" == "ip6" ] ; then source lisp_ip6.sh fi -if [ "$1" == "all" ] ; then +if [ "$1" == "ip4_ip6" ] ; then source lisp_ip4.sh source lisp_ip6.sh @@ -118,5 +153,12 @@ if [ "$1" == "all" ] ; then ping_lisp6 fi -echo "Success" +if [ "$1" == "4o6" ] ; then + source lisp_ip4o6.sh +fi +if [ "$1" == "6o4" ] ; then + source lisp_ip6o4.sh +fi + +echo "Success" -- cgit 1.2.3-korg