Add new test for static remote mapping 74/1174/1
authorAndrej Kozemcak <akozemca@cisco.com>
Tue, 17 May 2016 12:42:11 +0000 (14:42 +0200)
committerAndrej Kozemcak <akozemca@cisco.com>
Tue, 17 May 2016 12:43:53 +0000 (14:43 +0200)
Change-Id: I1bd6f6c754eb16ab077a53ad341ef633c56173f3
Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
20 files changed:
tests/data_plane/configs/vpp_csit_config/vpp1_6_reconf_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_csit_config/vpp1_6_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_csit_config/vpp1_reconf_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_csit_config/vpp1_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_csit_config/vpp2.conf
tests/data_plane/configs/vpp_csit_config/vpp2_6.conf
tests/data_plane/configs/vpp_csit_config/vpp2_6_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_csit_config/vpp2_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/vpp1_6_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/vpp1_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/vpp2_6_remote.conf [new file with mode: 0644]
tests/data_plane/configs/vpp_lite_config/vpp2_remote.conf [new file with mode: 0644]
tests/data_plane/csit_topo/lisp_6_remote.sh [new file with mode: 0644]
tests/data_plane/csit_topo/lisp_ip4o6.sh
tests/data_plane/csit_topo/lisp_ip6o4.sh
tests/data_plane/csit_topo/lisp_remote.sh [new file with mode: 0644]
tests/data_plane/csit_topo/lisp_test.sh
tests/data_plane/vpp_lite_topo/lisp_6_remote_mapping.sh [new file with mode: 0644]
tests/data_plane/vpp_lite_topo/lisp_remote_mapping.sh [new file with mode: 0644]
tests/data_plane/vpp_lite_topo/lisp_test.sh

diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_6_reconf_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_6_reconf_remote.conf
new file mode 100644 (file)
index 0000000..21616d3
--- /dev/null
@@ -0,0 +1,2 @@
+lisp_add_del_remote_mapping del vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::2
+lisp_add_del_remote_mapping add vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::20
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_6_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_6_remote.conf
new file mode 100644 (file)
index 0000000..cd39273
--- /dev/null
@@ -0,0 +1,10 @@
+exec set int ip address GigabitEthernet0/9/0 6:0:1::1/64
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6:0:3::1/64
+exec set int state GigabitEthernet0/a/0 up
+lisp_enable_disable enable
+
+lisp_add_del_locator_set locator-set  ls1
+lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1
+lisp_add_del_remote_mapping add vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::2
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_reconf_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_reconf_remote.conf
new file mode 100644 (file)
index 0000000..08a1641
--- /dev/null
@@ -0,0 +1,2 @@
+lisp_add_del_remote_mapping del vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2
+lisp_add_del_remote_mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.20
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp1_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp1_remote.conf
new file mode 100644 (file)
index 0000000..66b886d
--- /dev/null
@@ -0,0 +1,10 @@
+exec set int ip address GigabitEthernet0/9/0 6.0.1.1/24
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6.0.3.1/24
+exec set int state GigabitEthernet0/a/0 up
+lisp_enable_disable enable
+
+lisp_add_del_locator_set locator-set  ls1
+lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6.0.1.0/24 locator-set ls1
+lisp_add_del_remote_mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2
index 32d1be5..cf67ece 100644 (file)
@@ -6,4 +6,4 @@ lisp_enable_disable enable
 lisp_add_del_map_resolver 6.0.3.100
 lisp_add_del_locator_set locator-set  ls1
 lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
-lisp_add_del_local_eid eid 6.0.2.0/24 locator-set ls1
\ No newline at end of file
+lisp_add_del_local_eid eid 6.0.2.0/24 locator-set ls1
index 8bb999d..e6bcc17 100644 (file)
@@ -6,4 +6,4 @@ lisp_enable_disable enable
 lisp_add_del_map_resolver 6:0:3::100
 lisp_add_del_locator_set locator-set  ls1
 lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
-lisp_add_del_local_eid eid 6:0:2::0/64 locator-set ls1
\ No newline at end of file
+lisp_add_del_local_eid eid 6:0:2::0/64 locator-set ls1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_6_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_6_remote.conf
new file mode 100644 (file)
index 0000000..20e91a3
--- /dev/null
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6:0:2::1/64
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6:0:3::2/64
+exec set int state GigabitEthernet0/a/0 up
+lisp_enable_disable enable
+lisp_add_del_locator_set locator-set  ls1
+lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6:0:2::0/64 locator-set ls1
+lisp_add_del_remote_mapping add vni 0 deid 6:0:1::0/64 seid 6:0:2::0/64 rloc 6:0:3::1
diff --git a/tests/data_plane/configs/vpp_csit_config/vpp2_remote.conf b/tests/data_plane/configs/vpp_csit_config/vpp2_remote.conf
new file mode 100644 (file)
index 0000000..d4da655
--- /dev/null
@@ -0,0 +1,9 @@
+exec set int ip address GigabitEthernet0/9/0 6.0.2.1/24
+exec set int state GigabitEthernet0/9/0 up
+exec set int ip address GigabitEthernet0/a/0 6.0.3.2/24
+exec set int state GigabitEthernet0/a/0 up
+lisp_enable_disable enable
+lisp_add_del_locator_set locator-set  ls1
+lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
+lisp_add_del_local_eid eid 6.0.2.0/24 locator-set ls1
+lisp_add_del_remote_mapping add vni 0 deid 6.0.1.0/24 seid 6.0.2.0/24 rloc 6.0.3.1
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp1_6_remote.conf b/tests/data_plane/configs/vpp_lite_config/vpp1_6_remote.conf
new file mode 100644 (file)
index 0000000..4a45cec
--- /dev/null
@@ -0,0 +1,13 @@
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6:0:1::1/64
+
+create host-interface name intervpp1
+set int state host-intervpp1 up
+set int ip address host-intervpp1 6:0:3::1/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
+lisp eid-table add eid 6:0:1::0/64 locator-set ls1
+lisp remote-mapping add vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::2
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp1_remote.conf b/tests/data_plane/configs/vpp_lite_config/vpp1_remote.conf
new file mode 100644 (file)
index 0000000..f6588c9
--- /dev/null
@@ -0,0 +1,13 @@
+create host-interface name vpp1
+set int state host-vpp1 up
+set int ip address host-vpp1 6.0.1.1/24
+
+create host-interface name intervpp1
+set int state host-intervpp1 up
+set int ip address host-intervpp1 6.0.3.1/24
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
+lisp eid-table add eid 6.0.1.0/24 locator-set ls1
+lisp remote-mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp2_6_remote.conf b/tests/data_plane/configs/vpp_lite_config/vpp2_6_remote.conf
new file mode 100644 (file)
index 0000000..ec4bb6d
--- /dev/null
@@ -0,0 +1,13 @@
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6:0:2::1/64
+
+create host-interface name intervpp2
+set int state host-intervpp2 up
+set int ip address host-intervpp2 6:0:3::2/64
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp2 p 1 w 1
+lisp eid-table add eid 6:0:2::0/64 locator-set ls1
+lisp remote-mapping add vni 0 deid 6:0:1::0/64 seid 6:0:2::0/64 rloc 6:0:3::1
diff --git a/tests/data_plane/configs/vpp_lite_config/vpp2_remote.conf b/tests/data_plane/configs/vpp_lite_config/vpp2_remote.conf
new file mode 100644 (file)
index 0000000..5361325
--- /dev/null
@@ -0,0 +1,13 @@
+create host-interface name vpp2
+set int state host-vpp2 up
+set int ip address host-vpp2 6.0.2.1/24
+
+create host-interface name intervpp2
+set int state host-intervpp2 up
+set int ip address host-intervpp2 6.0.3.2/24
+
+lisp enable
+
+lisp locator-set add ls1 iface host-intervpp2 p 1 w 1
+lisp eid-table add eid 6.0.2.0/24 locator-set ls1
+lisp remote-mapping add vni 0 deid 6.0.1.0/24 seid 6.0.2.0/24 rloc 6.0.3.1
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 (file)
index 0000000..13ff99f
--- /dev/null
@@ -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
index 3cafb6e..8d96165 100644 (file)
@@ -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
index 4e620f7..816a628 100644 (file)
@@ -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 (file)
index 0000000..82c9300
--- /dev/null
@@ -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
index 06ea7fb..6de22e5 100755 (executable)
 #         +------+
 
 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}"
diff --git a/tests/data_plane/vpp_lite_topo/lisp_6_remote_mapping.sh b/tests/data_plane/vpp_lite_topo/lisp_6_remote_mapping.sh
new file mode 100644 (file)
index 0000000..f25e8ec
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+function ping_lisp6 {
+  sudo ip netns exec vppns1 ping6 -c 10 6:0:2::2
+  if [ $? -ne 0 ] ; then
+      echo "Can not ping other machine"
+      exit -1
+  fi
+}
+
+sudo ip netns exec vppns1 \
+  bash -c "
+    ip link set dev lo up
+    ip addr add 6:0:1::2/64 dev veth_vpp1
+    ip route add 6:0:2::0/64 via 6:0:1::1
+"
+
+sudo ip netns exec vppns2 \
+  bash -c "
+    ip link set dev lo up
+    ip addr add 6:0:2::2/64 dev veth_vpp2
+    ip route add 6:0:1::0/64 via 6:0:2::1
+"
+
+ping_lisp6
+
+expect << EOF
+spawn telnet localhost 5003
+expect -re ".*>"
+send "set int ip address del host-intervpp2 6:0:3::2/64\r"
+expect -re ".*>"
+send "set int ip address host-intervpp2 6:0:3::20/64\r"
+expect -re ".*>"
+EOF
+
+expect << EOF
+spawn telnet localhost 5002
+expect -re ".*>"
+send "lisp remote-mapping del vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::2\r"
+expect -re ".*>"
+send "lisp remote-mapping add vni 0 deid 6:0:2::0/64 seid 6:0:1::0/64 rloc 6:0:3::20\r"
+expect -re ".*>"
+EOF
+
+ping_lisp6
diff --git a/tests/data_plane/vpp_lite_topo/lisp_remote_mapping.sh b/tests/data_plane/vpp_lite_topo/lisp_remote_mapping.sh
new file mode 100644 (file)
index 0000000..3ee6f07
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+function ping_lisp {
+  sudo ip netns exec vppns1 ping -c 10 6.0.2.2
+  if [ $? -ne 0 ] ; then
+      echo "Can not ping other machine"
+      exit -1
+  fi
+}
+
+sudo ip netns exec vppns1 \
+  bash -c "
+    ip link set dev lo up
+    ip addr add 6.0.1.2/24 dev veth_vpp1
+    ip route add 6.0.2.0/24 via 6.0.1.1
+"
+
+sudo ip netns exec vppns2 \
+  bash -c "
+    ip link set dev lo up
+    ip addr add 6.0.2.2/24 dev veth_vpp2
+    ip route add 6.0.1.0/24 via 6.0.2.1
+"
+
+ping_lisp
+
+expect << EOF
+spawn telnet localhost 5003
+expect -re ".*>"
+send "set int ip address del host-intervpp2 6.0.3.2/24\r"
+expect -re ".*>"
+send "set int ip address host-intervpp2 6.0.3.20/24\r"
+expect -re ".*>"
+EOF
+
+expect << EOF
+spawn telnet localhost 5002
+expect -re ".*>"
+send "lisp remote-mapping del vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2\r"
+expect -re ".*>"
+send "lisp remote-mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.20\r"
+expect -re ".*>"
+EOF
+
+ping_lisp
index 9e3070e..7f01f5a 100755 (executable)
@@ -1,12 +1,14 @@
 #!/usr/bin/env bash
 
 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
 
@@ -58,8 +60,10 @@ 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" != "remote" ] && [ "$1" != "remote6" ]  ; then
+  curl -X DELETE http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/ \
+       -u ${ODL_USER}:${ODL_PASSWD}
+fi
 
 if [ "$1" == "clean" ] ; then
   exit 0;
@@ -123,6 +127,16 @@ if [ "$1" == "6o4" ] ; then
   VPP2_CONF="vpp2_6o4.conf"
 fi
 
+if [ "$1" == "remote" ] ; then
+  VPP1_CONF="vpp1_remote.conf"
+  VPP2_CONF="vpp2_remote.conf"
+fi
+
+if [ "$1" == "remote6" ] ; then
+  VPP1_CONF="vpp1_6_remote.conf"
+  VPP2_CONF="vpp2_6_remote.conf"
+fi
+
 # start vpp1 and vpp2 in separate chroot
 sudo $VPP_LITE_BIN                              \
   unix { log /tmp/vpp1.log cli-listen           \
@@ -161,4 +175,12 @@ if [ "$1" == "6o4" ] ; then
   source lisp_ip6o4.sh
 fi
 
+if [ "$1" == "remote" ] ; then
+  source lisp_remote_mapping.sh
+fi
+
+if [ "$1" == "remote6" ] ; then
+  source lisp_6_remote_mapping.sh
+fi
+
 echo "Success"