summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-09-19 15:44:32 +0200
committerFilip Tehlar <ftehlar@cisco.com>2017-09-20 10:22:55 +0200
commit3db341de1dae5caedbe805ed7f3871a57dc8dbcb (patch)
treebc0e1f506dd2fb22fda487153669aed322de5bb4
parentebfd5b56b3c336b87a919898174a7ee7aafe3364 (diff)
Add neighbor discovery test
Change-Id: I88aa86ba917a43903b04aec44427ad0cc20439b3 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--tests/data_plane/configs/vpp_lite_config/ndp/vpp1.config11
-rw-r--r--tests/data_plane/configs/vpp_lite_config/ndp/vpp2.config1
-rw-r--r--tests/data_plane/configs/vpp_lite_config/ndp/vpp3.config11
-rw-r--r--tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py1
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh2
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/ndp.sh33
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_neighbor_solicitation_static.sh7
-rw-r--r--tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh6
8 files changed, 70 insertions, 2 deletions
diff --git a/tests/data_plane/configs/vpp_lite_config/ndp/vpp1.config b/tests/data_plane/configs/vpp_lite_config/ndp/vpp1.config
new file mode 100644
index 0000000..9175801
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/ndp/vpp1.config
@@ -0,0 +1,11 @@
+create_host_iface vpp5 6:0:10::11/64
+set_if_l2_bridge host-vpp5 20
+create_host_iface xtr1 6.0.3.1/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-xtr1 1 1
+lisp_eid_map_bd 20 20
+lisp_local_eid vni 20 eid 08:11:11:11:11:11 locator-set ls1
+lisp_remote_mapping vni 20 eid 08:22:22:22:22:22 rloc 6.0.3.3
+lisp_adjacency vni 20 leid 08:11:11:11:11:11 reid 08:22:22:22:22:22
+lisp_ndp_entry bd 20 ip 6:0:10::22 mac 08:22:22:22:22:22
diff --git a/tests/data_plane/configs/vpp_lite_config/ndp/vpp2.config b/tests/data_plane/configs/vpp_lite_config/ndp/vpp2.config
new file mode 100644
index 0000000..ec80ccb
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/ndp/vpp2.config
@@ -0,0 +1 @@
+# unused config
diff --git a/tests/data_plane/configs/vpp_lite_config/ndp/vpp3.config b/tests/data_plane/configs/vpp_lite_config/ndp/vpp3.config
new file mode 100644
index 0000000..7a4d8e8
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/ndp/vpp3.config
@@ -0,0 +1,11 @@
+create_host_iface vpp6 6:0:10::12/64
+set_if_l2_bridge host-vpp6 20
+create_host_iface xtr3 6.0.3.3/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-xtr3 1 1
+lisp_eid_map_bd 20 20
+lisp_local_eid vni 20 eid 08:22:22:22:22:22 locator-set ls1
+lisp_remote_mapping vni 20 eid 08:11:11:11:11:11 rloc 6.0.3.1
+lisp_adjacency vni 20 reid 08:11:11:11:11:11 leid 08:22:22:22:22:22
+lisp_ndp_entry bd 20 ip 6:0:10::21 mac 08:11:11:11:11:11
diff --git a/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py b/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
index 9bf2c15..864b486 100644
--- a/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
+++ b/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
@@ -63,6 +63,7 @@ SimpleMapping('lisp_rloc_probe_state', 'one rloc-probe', 'one_rloc_probe_enable_
SimpleMapping('lisp_map_register_state', 'one map-register', 'one_map_register_enable_disable')
SimpleMapping('lisp_stats', 'one statistics', 'one_stats_enable_disable')
SimpleMapping('lisp_l2_arp', 'one l2 arp', 'one_add_del_l2_arp_entry')
+SimpleMapping('lisp_ndp_entry', 'one ndp', 'one_add_del_ndp_entry')
SimpleMapping('lisp_nsh_set_ls', 'one nsh-mapping', 'one_nsh_set_locator_set')
SimpleMapping('ipsec_sad_add_del_entry', 'TODO', 'ipsec_sad_add_del_entry')
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh b/tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh
index 8a1ac51..06f355b 100644
--- a/tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh
+++ b/tests/data_plane/vpp_lite_topo/test_driver/basic_no_odl.sh
@@ -33,7 +33,7 @@ function test_basic_no_odl
echo "set int ip address del host-intervpp2 6:0:3::2/64" | nc 0 5003
echo "set int ip address host-intervpp2 6:0:3::20/64" | nc 0 5003
- if [ ${3} == "switch_rlocs" ] ; then
+ if [ "${3}" == "switch_rlocs" ] ; then
echo "lisp remote-mapping del vni 0 eid 6.0.2.0/24" | nc 0 5002
echo "lisp remote-mapping add vni 0 eid 6.0.2.0/24 rloc 6:0:3::20" | nc 0 5002
echo "lisp remote-mapping del vni 0 eid 6:0:2::0/64" | nc 0 5002
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/ndp.sh b/tests/data_plane/vpp_lite_topo/test_driver/ndp.sh
new file mode 100644
index 0000000..5280c67
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/test_driver/ndp.sh
@@ -0,0 +1,33 @@
+source config.sh
+source odl_utils.sh
+source topologies/3_node_star.sh
+
+if [ "$1" == "clean" ] ; then
+ 3_node_star_topo_clean no_odl
+ exit 0
+fi
+
+if [[ $(id -u) != 0 ]]; then
+ echo "Error: run this as root."
+ exit 1
+fi
+
+function send_icmp_from_namespace
+{
+ ip netns exec "$1" "$2" -w 15 -c 1 "$3"
+}
+
+
+function test_neighbor_discovery
+{
+ 3_node_star_topo_setup no_odl no_arp
+
+ maybe_pause
+ send_icmp_from_namespace vpp-ns5 "$1" "$2"
+ rc=$?
+
+ maybe_pause
+ 3_node_star_topo_clean no_odl
+ print_status $rc "No ICMP response!"
+ exit $test_result
+}
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_neighbor_solicitation_static.sh b/tests/data_plane/vpp_lite_topo/tests/test_neighbor_solicitation_static.sh
new file mode 100755
index 0000000..fbea78d
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_neighbor_solicitation_static.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/ndp
+
+source test_driver/ndp.sh
+
+test_neighbor_discovery ping6 "6:0:10::22"
diff --git a/tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh b/tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh
index d21732e..6b67a00 100644
--- a/tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh
+++ b/tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh
@@ -17,12 +17,13 @@
# + | | + 6.0.10.22
# 6.0.10.21 | VPP3 | 08:22:22:22:22:22
# 08:11:11:11:11:11 | |
-# +-+----+-+
+# 6:0:10::21 +-+----+-+
# vpp6| |vpp4
# | |
# | +6.0.2.2
# + 6:0:2::2
# 6.0.10.22
+# 6:0:10::22
# 08:22:22:22:22:22
#
@@ -177,6 +178,7 @@ function 3_node_star_topo_setup
bash -c "
ip link set dev lo up
ip addr add 6.0.10.21/24 dev veth_vpp5
+ ip addr add 6:0:10::21/64 dev veth_vpp5
"
ip link add veth_vpp6 type veth peer name vpp6
@@ -188,6 +190,7 @@ function 3_node_star_topo_setup
bash -c "
ip link set dev lo up
ip addr add 6.0.10.22/24 dev veth_vpp6
+ ip addr add 6:0:10::22/64 dev veth_vpp6
"
ip link add veth_vpp7 type veth peer name vpp7
@@ -225,6 +228,7 @@ maybe_pause
echo "* Selected configuration method: $CFG_METHOD"
if [ "$CFG_METHOD" == "cli" ] ; then
+ sleep 1
echo "exec ${VPP_LITE_CONF}/vpp1.cli" | nc 0 5002
echo "exec ${VPP_LITE_CONF}/vpp2.cli" | nc 0 5003
echo "exec ${VPP_LITE_CONF}/vpp3.cli" | nc 0 5004