summaryrefslogtreecommitdiffstats
path: root/tests/data_plane/vpp_lite_topo
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-05-25 12:37:32 +0200
committerFilip Tehlar <ftehlar@cisco.com>2017-05-26 08:58:02 +0200
commitf20e6999369a2cd951247d4ef1b7a417b6a35566 (patch)
tree59a06ba1360d2b6e9471d2feb4202ad554955df6 /tests/data_plane/vpp_lite_topo
parent0b237f3cd02f6c59252e8270c97c015c7a148cd2 (diff)
Add L2 ARP test
Change-Id: Ib8cc113a5de812697ea4d927bce5c9ac77fffac1 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/config.sh3
-rw-r--r--tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py1
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/arp.sh32
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_arp_resolution.sh7
-rw-r--r--tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh14
5 files changed, 52 insertions, 5 deletions
diff --git a/tests/data_plane/vpp_lite_topo/config.sh b/tests/data_plane/vpp_lite_topo/config.sh
index 89fd908..c615707 100644
--- a/tests/data_plane/vpp_lite_topo/config.sh
+++ b/tests/data_plane/vpp_lite_topo/config.sh
@@ -116,7 +116,8 @@ function start_vpp
unix { log /tmp/$2.log \
full-coredump \
cli-listen localhost:$1 } \
- api-trace { on } api-segment { prefix "$2" }
+ api-trace { on } api-segment { prefix "$2" } \
+ plugins { plugin dpdk_plugin.so { disable } }
}
function print_status
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 7281cc1..4932617 100644
--- a/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
+++ b/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
@@ -62,6 +62,7 @@ SimpleMapping('set_if_ip', 'set int ip address', 'sw_interface_add_del_address')
SimpleMapping('lisp_rloc_probe_state', 'one rloc-probe', 'one_rloc_probe_enable_disable')
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('ipsec_sad_add_del_entry', 'TODO', 'ipsec_sad_add_del_entry')
SimpleMapping('ipsec_spd_add_del', 'todo', 'ipsec_spd_add_del')
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/arp.sh b/tests/data_plane/vpp_lite_topo/test_driver/arp.sh
new file mode 100644
index 0000000..dd6d41f
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/test_driver/arp.sh
@@ -0,0 +1,32 @@
+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_arp_resolution
+{
+ 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_arp_resolution.sh b/tests/data_plane/vpp_lite_topo/tests/test_arp_resolution.sh
new file mode 100755
index 0000000..c8817b1
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_arp_resolution.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/arp
+
+source test_driver/arp.sh
+
+test_arp_resolution ping "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 82dc734..d21732e 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
@@ -60,7 +60,9 @@ function 3_node_star_topo_clean
ip netns del vpp-ns8 &> /dev/null
ip netns del xtr-ns &> /dev/null
- odl_clear_all
+ if [ "$1" != "no_odl" ] ; then
+ odl_clear_all
+ fi
}
function set_arp
@@ -238,8 +240,12 @@ maybe_pause
echo "==="
fi
- post_curl "add-mapping" ${ODL_CONFIG_FILE1}
- post_curl "add-mapping" ${ODL_CONFIG_FILE2}
+ if [ "$1" != "no_odl" ] ; then
+ post_curl "add-mapping" ${ODL_CONFIG_FILE1}
+ post_curl "add-mapping" ${ODL_CONFIG_FILE2}
+ fi
- set_arp
+ if [ "$2" != "no_arp" ] ; then
+ set_arp
+ fi
}