summaryrefslogtreecommitdiffstats
path: root/tests/data_plane/csit_topo
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-05-17 14:42:11 +0200
committerAndrej Kozemcak <akozemca@cisco.com>2016-05-17 14:43:53 +0200
commitd746f9639a45f53cd927609c6e1800e3ca4dc041 (patch)
treea187c192d7e6cb8730416d95f6f72f546efd1120 /tests/data_plane/csit_topo
parent46e4b31a8a57e9af1be2cdbc0c67c153ec9cd9b3 (diff)
Add new test for static remote mapping
Change-Id: I1bd6f6c754eb16ab077a53ad341ef633c56173f3 Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'tests/data_plane/csit_topo')
-rw-r--r--tests/data_plane/csit_topo/lisp_6_remote.sh36
-rw-r--r--tests/data_plane/csit_topo/lisp_ip4o6.sh12
-rw-r--r--tests/data_plane/csit_topo/lisp_ip6o4.sh12
-rw-r--r--tests/data_plane/csit_topo/lisp_remote.sh36
-rwxr-xr-xtests/data_plane/csit_topo/lisp_test.sh62
5 files changed, 131 insertions, 27 deletions
diff --git a/tests/data_plane/csit_topo/lisp_6_remote.sh b/tests/data_plane/csit_topo/lisp_6_remote.sh
new file mode 100644
index 0000000..13ff99f
--- /dev/null
+++ b/tests/data_plane/csit_topo/lisp_6_remote.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+function ping_lisp6 {
+ local RESULTS
+ RESULTS=$(ssh_tg "ping6 -c 10 6:0:2::2")
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ ssh_vpp1 "sudo rm -r ${TMP_DIR}"
+ ssh_vpp2 "sudo rm -r ${TMP_DIR}"
+ exit -1
+ fi
+}
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_6.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_6.conf"
+
+ssh_tg "sudo ip addr add 6:0:1::2/64 dev ${TG_INT1}"
+ssh_tg "sudo ip link set ${TG_INT1} up"
+ssh_tg "sudo ip route add 6:0:2::0/64 via 6:0:1::1 || exit 0"
+ssh_tg "sudo ip netns exec net2 ip addr add 6:0:2::2/64 dev ${TG_INT2}"
+ssh_tg "sudo ip netns exec net2 ip link set lo up"
+ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
+ssh_tg "sudo ip netns exec net2 ip route add 6:0:1::/64 via 6:0:2::1"
+
+ping_lisp6
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_reconf.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_reconf.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
+
+ping_lisp6
diff --git a/tests/data_plane/csit_topo/lisp_ip4o6.sh b/tests/data_plane/csit_topo/lisp_ip4o6.sh
index 3cafb6e..8d96165 100644
--- a/tests/data_plane/csit_topo/lisp_ip4o6.sh
+++ b/tests/data_plane/csit_topo/lisp_ip4o6.sh
@@ -11,11 +11,11 @@ function ping_lisp {
fi
}
-post_curl "add-mapping" ${ODL_ADD_CONFIG1_4o6}
-post_curl "add-mapping" ${ODL_ADD_CONFIG2_4o6}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2}
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_4o6} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_4o6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1.conf"
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2.conf"
@@ -30,10 +30,10 @@ ssh_tg "sudo ip netns exec net2 ip route add 6.0.1.0/24 via 6.0.2.1"
ping_lisp
-rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_4o6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf.conf
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf.conf"
-post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_4o6}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2}
ping_lisp
diff --git a/tests/data_plane/csit_topo/lisp_ip6o4.sh b/tests/data_plane/csit_topo/lisp_ip6o4.sh
index 4e620f7..816a628 100644
--- a/tests/data_plane/csit_topo/lisp_ip6o4.sh
+++ b/tests/data_plane/csit_topo/lisp_ip6o4.sh
@@ -11,11 +11,11 @@ function ping_lisp6 {
fi
}
-post_curl "add-mapping" ${ODL_ADD_CONFIG1_6o4}
-post_curl "add-mapping" ${ODL_ADD_CONFIG2_6o4}
+post_curl "add-mapping" ${ODL_ADD_CONFIG1}
+post_curl "add-mapping" ${ODL_ADD_CONFIG2}
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_6o4} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
-rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_6o4} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_6.conf"
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_6.conf"
@@ -30,10 +30,10 @@ ssh_tg "sudo ip netns exec net2 ip route add 6:0:1::/64 via 6:0:2::1"
ping_lisp6
-rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_6o4} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
-post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6o4}
+post_curl "update-mapping" ${ODL_REPLACE_CONFIG2}
ping_lisp6
diff --git a/tests/data_plane/csit_topo/lisp_remote.sh b/tests/data_plane/csit_topo/lisp_remote.sh
new file mode 100644
index 0000000..82c9300
--- /dev/null
+++ b/tests/data_plane/csit_topo/lisp_remote.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+function ping_lisp {
+ local RESULTS
+ RESULTS=$(ssh_tg "ping -c 10 6.0.2.2")
+ if [ $? -ne 0 ] ; then
+ echo "Can not ping other machine"
+ ssh_vpp1 "sudo rm -r ${TMP_DIR}"
+ ssh_vpp2 "sudo rm -r ${TMP_DIR}"
+ exit -1
+ fi
+}
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2.conf"
+
+ssh_tg "sudo ip addr add 6.0.1.2/24 dev ${TG_INT1}"
+ssh_tg "sudo ip link set ${TG_INT1} up"
+ssh_tg "sudo ip route add 6.0.2.0/24 via 6.0.1.1"
+ssh_tg "sudo ip netns exec net2 ip addr add 6.0.2.2/24 dev ${TG_INT2}"
+ssh_tg "sudo ip netns exec net2 ip link set lo up"
+ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
+ssh_tg "sudo ip netns exec net2 ip route add 6.0.1.0/24 via 6.0.2.1"
+
+ping_lisp
+
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_reconf.conf
+rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf.conf
+
+ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_reconf.conf"
+ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf.conf"
+
+ping_lisp
diff --git a/tests/data_plane/csit_topo/lisp_test.sh b/tests/data_plane/csit_topo/lisp_test.sh
index 06ea7fb..6de22e5 100755
--- a/tests/data_plane/csit_topo/lisp_test.sh
+++ b/tests/data_plane/csit_topo/lisp_test.sh
@@ -19,12 +19,14 @@
# +------+
if [ "$1" == "-h" ] || [ "$1" == "-help" ] ; then
- echo "lisp_test.sh [ip4] [ip6] [ip4_ip6] [4o6] [6o4]"
+ echo "lisp_test.sh [ip4] [ip6] [ip4_ip6] [4o6] [6o4] [remote] [remote6]"
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"
+ echo " remote - test statick mapping, whit out ODL"
+ echo " remote6 - test statick mapping for IPv6, whit out ODL"
exit 0
fi
@@ -45,30 +47,50 @@ ODL_M_USER="user"
ODL_INT="eth2"
VPP_CONFIG_DIR="../configs/vpp_csit_config/"
VPP_CONFIG1="vpp1.conf"
-VPP_CONFIG1_4o6="vpp1_4o6.conf"
VPP_CONFIG1_6="vpp1_6.conf"
-VPP_CONFIG1_6o4="vpp1_6o4.conf"
VPP_CONFIG2="vpp2.conf"
-VPP_CONFIG2_4o6="vpp2_4o6.conf"
VPP_CONFIG2_6="vpp2_6.conf"
-VPP_CONFIG2_6o4="vpp2_6o4.conf"
VPP_RECONF2="vpp2_reconf.conf"
VPP_RECONF2_6="vpp2_reconf_6.conf"
-VPP_RECONF2_4o6="vpp2_reconf_4o6.conf"
-VPP_RECONF2_6o4="vpp2_reconf_6o4.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_6="replace_ipv6_odl2.txt"
-ODL_REPLACE_CONFIG2_4o6="replace_ipv4o6_odl2.txt"
-ODL_REPLACE_CONFIG2_6o4="replace_ipv6o4_odl2.txt"
+
+if [ "$1" == "remote" ] ; then
+ VPP_CONFIG1="vpp1_remote.conf"
+ VPP_CONFIG2="vpp2_remote.conf"
+ VPP_RECONF1="vpp1_reconf_remote.conf"
+ VPP_RECONF2="vpp2_reconf.conf"
+fi
+
+if [ "$1" == "remote6" ] ; then
+ VPP_CONFIG1="vpp1_6_remote.conf"
+ VPP_CONFIG2="vpp2_6_remote.conf"
+ VPP_RECONF1="vpp1_6_reconf_remote.conf"
+ VPP_RECONF2="vpp2_reconf_6.conf"
+fi
+
+if [ "$1" == "4o6" ] ; then
+ VPP_CONFIG1="vpp1_4o6.conf"
+ VPP_CONFIG2="vpp2_4o6.conf"
+ VPP_RECONF2="vpp2_reconf_4o6.conf"
+ ODL_ADD_CONFIG1="add_ipv4o6_odl1.txt"
+ ODL_ADD_CONFIG2="add_ipv4o6_odl2.txt"
+ ODL_REPLACE_CONFIG2="replace_ipv4o6_odl2.txt"
+fi
+
+if [ "$1" == "6o4" ] ; then
+ VPP_CONFIG1="vpp1_6o4.conf"
+ VPP_CONFIG2="vpp2_6o4.conf"
+ VPP_RECONF2="vpp2_reconf_6o4.conf"
+ ODL_ADD_CONFIG1="add_ipv6o4_odl1.txt"
+ ODL_ADD_CONFIG2="add_ipv6o4_odl2.txt"
+ ODL_REPLACE_CONFIG2="replace_ipv6o4_odl2.txt"
+fi
function ssh_vpp1 {
ssh ${USER}@${VPP1_IP} ${@} || exit
@@ -92,8 +114,10 @@ function post_curl {
-u ${ODL_USER}:${ODL_PASSWD}
}
-curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
- -u ${ODL_USER}:${ODL_PASSWD}
+if [ "$1" != "remote" ] && [ "$1" != "remote6" ] ; then
+ curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
+ -u ${ODL_USER}:${ODL_PASSWD}
+fi
ssh_tg "sudo ip netns del net2 &> /dev/null || exit 0"
ssh_tg "sudo ip addr flush dev ${TG_INT1} &> /dev/null || exit 0"
@@ -142,6 +166,14 @@ if [ "$1" == "ip4_ip6" ] ; then
ping_lisp6
fi
+if [ "$1" == "remote" ] ; then
+ source lisp_remote.sh
+fi
+
+if [ "$1" == "remote6" ] ; then
+ source lisp_6_remote.sh
+fi
+
#clean tmp file
ssh_vpp1 "sudo rm -r ${TMP_DIR}"
ssh_vpp2 "sudo rm -r ${TMP_DIR}"