summaryrefslogtreecommitdiffstats
path: root/tests/data_plane/vpp_lite_topo
diff options
context:
space:
mode:
Diffstat (limited to 'tests/data_plane/vpp_lite_topo')
-rw-r--r--tests/data_plane/vpp_lite_topo/config.sh11
-rwxr-xr-xtests/data_plane/vpp_lite_topo/run.sh2
-rw-r--r--tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py4
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/rtr_single_iface.sh8
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/src_dst.sh96
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/src_dst_overwrite.sh92
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o4.sh2
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o6.sh2
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o4.sh2
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o6.sh2
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_4o4.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_6o6.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_4o4.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_6o4.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_l2o4.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_4o4.sh10
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_6o4.sh10
-rw-r--r--tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh240
-rw-r--r--tests/data_plane/vpp_lite_topo/topologies/basic_topo_l2.sh2
-rw-r--r--tests/data_plane/vpp_lite_topo/topologies/rtr_single_iface.sh108
20 files changed, 521 insertions, 120 deletions
diff --git a/tests/data_plane/vpp_lite_topo/config.sh b/tests/data_plane/vpp_lite_topo/config.sh
index a4709f0..2c58007 100644
--- a/tests/data_plane/vpp_lite_topo/config.sh
+++ b/tests/data_plane/vpp_lite_topo/config.sh
@@ -135,6 +135,17 @@ function assert_rc_ok
# assert_rc_ok rc cleanup_fcn error_msg
if [ $1 -ne 0 ] ; then
echo $3
+ maybe_pause
+ $2
+ exit $test_result
+ fi
+}
+
+function assert_rc_not_ok
+{
+ if [ $1 -eq 0 ] ; then
+ echo $3
+ maybe_pause
$2
exit $test_result
fi
diff --git a/tests/data_plane/vpp_lite_topo/run.sh b/tests/data_plane/vpp_lite_topo/run.sh
index f57e4a2..942acf8 100755
--- a/tests/data_plane/vpp_lite_topo/run.sh
+++ b/tests/data_plane/vpp_lite_topo/run.sh
@@ -85,7 +85,7 @@ do
# run the test case
base_name=`basename -a "$test_case"`
- printf "*** %2d/%d : %-45s" $count $test_num "$base_name"
+ printf "*** %2d/%d : %-48s" $count $test_num "$base_name"
if [ $verbose -ne 0 ] ; then
"$test_case"
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 d0d9f0f..62cde11 100644
--- a/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
+++ b/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
@@ -37,9 +37,6 @@ class CustomMapping(SimpleMapping):
class RepeatableLocators(SimpleMapping):
- def append_locs(self, locs):
- pass
-
def generate(self, mode, args):
name = args[:args.index(' ')] # first word is ls name
locs = args[args.index(' '):]
@@ -59,6 +56,7 @@ SimpleMapping('lisp_local_eid', 'lisp eid-table', 'lisp_add_del_local_eid')
SimpleMapping('lisp_remote_mapping', 'lisp remote-mapping', 'lisp_add_del_remote_mapping')
SimpleMapping('lisp_pitr', 'lisp pitr ls', 'lisp_pitr_set_locator_set locator-set')
SimpleMapping('lisp_adjacency', 'lisp adjacency', 'lisp_add_del_adjacency')
+SimpleMapping('lisp_map_request_mode', 'lisp map-request mode', 'lisp_map_request_mode')
SimpleMapping('set_if_ip', 'set int ip address', 'sw_interface_add_del_address')
CustomMapping('lisp_eid_map_bd',
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/rtr_single_iface.sh b/tests/data_plane/vpp_lite_topo/test_driver/rtr_single_iface.sh
index 8ec9320..692e9d4 100644
--- a/tests/data_plane/vpp_lite_topo/test_driver/rtr_single_iface.sh
+++ b/tests/data_plane/vpp_lite_topo/test_driver/rtr_single_iface.sh
@@ -1,14 +1,14 @@
source config.sh
source odl_utils.sh
-source topologies/rtr_single_iface.sh
+source topologies/3_node_star.sh
# set odl config json file names; they are common among all rtr tests
ODL_CONFIG_FILE1="elp1.json"
ODL_CONFIG_FILE2="elp2.json"
if [ "$1" == "clean" ] ; then
- rtr_single_iface_clean
+ 3_node_star_topo_clean
exit 0
fi
@@ -18,7 +18,7 @@ if [[ $(id -u) != 0 ]]; then
fi
function test_rtr_single_iface {
- rtr_single_iface_setup
+ 3_node_star_topo_setup
maybe_pause
@@ -28,7 +28,7 @@ function test_rtr_single_iface {
rc=$?
maybe_pause
- rtr_single_iface_clean
+ 3_node_star_topo_clean
print_status $rc "No ICMP response!"
exit $test_result
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/src_dst.sh b/tests/data_plane/vpp_lite_topo/test_driver/src_dst.sh
new file mode 100644
index 0000000..14654ad
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/test_driver/src_dst.sh
@@ -0,0 +1,96 @@
+source config.sh
+source odl_utils.sh
+source topologies/3_node_star.sh
+
+ODL_CONFIG_FILE1="map1.json"
+ODL_CONFIG_FILE2="map2.json"
+
+if [ "$1" == "clean" ] ; then
+ 3_node_star_topo_clean
+ exit 0
+fi
+
+if [[ $(id -u) != 0 ]]; then
+ echo "Error: run this as a root."
+ exit 1
+fi
+
+function send_ping_from_ns
+{
+ ip netns exec "${1}" "${2}" -w 20 -c 1 "${3}"
+ assert_rc_ok $? 3_node_star_topo_clean "No ICMP Response!"
+}
+
+function test_src_dst
+{
+ 3_node_star_topo_setup
+ post_curl "add-mapping" "map3.json"
+ post_curl "add-mapping" "map4.json"
+
+ maybe_pause
+
+ test_result=1
+
+ # send ping for first EID
+ send_ping_from_ns vpp-ns1 ${1} ${2}
+
+ # TODO assert counters
+
+ maybe_pause
+
+ # send ping for second EID
+ send_ping_from_ns vpp-ns3 ${1} ${2}
+
+ maybe_pause
+
+ # verify first tunnel still works
+ send_ping_from_ns vpp-ns1 ${1} ${2}
+
+ maybe_pause
+
+ # verify second tunnel still works
+ send_ping_from_ns vpp-ns3 ${1} ${2}
+ rc=$?
+
+ maybe_pause
+ 3_node_star_topo_clean
+ print_status $rc "No ICM response!"
+ exit $test_result
+}
+
+function test_src_dst_l2
+{
+ 3_node_star_topo_setup
+ post_curl "add-mapping" "map3.json"
+ post_curl "add-mapping" "map4.json"
+
+ maybe_pause
+
+ test_result=1
+
+ # send ping for first EID
+ send_ping_from_ns vpp-ns5 ${1} ${2}
+
+ # TODO assert counters
+
+ maybe_pause
+
+ # send ping for second EID
+ send_ping_from_ns vpp-ns8 ${1} ${2}
+
+ maybe_pause
+
+ # verify first tunnel still works
+ send_ping_from_ns vpp-ns5 ${1} ${2}
+
+ maybe_pause
+
+ # verify second tunnel still works
+ send_ping_from_ns vpp-ns8 ${1} ${2}
+ rc=$?
+
+ maybe_pause
+ 3_node_star_topo_clean
+ print_status $rc "No ICM response!"
+ exit $test_result
+}
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/src_dst_overwrite.sh b/tests/data_plane/vpp_lite_topo/test_driver/src_dst_overwrite.sh
new file mode 100644
index 0000000..e7bf1a2
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/test_driver/src_dst_overwrite.sh
@@ -0,0 +1,92 @@
+source config.sh
+source odl_utils.sh
+source topologies/2_node_topo.sh
+
+ODL_CONFIG_FILE1="map1.json"
+ODL_CONFIG_FILE2="map2.json"
+
+if [ "$1" == "clean" ] ; then
+ 2_node_topo_clean
+ exit 0
+fi
+
+if [[ $(id -u) != 0 ]]; then
+ echo "Error: run this as a root."
+ exit 1
+fi
+
+function send_ping_from_ns
+{
+ ip netns exec "${1}" "${2}" -w 20 -c 1 "${3}"
+ assert_rc_ok $? 2_node_topo_clean "No ICMP Response!"
+}
+
+function send_ping_from_ns_expect_failure
+{
+ ip netns exec "${1}" "${2}" -w 10 -c 1 "${3}"
+ assert_rc_not_ok $? 2_node_topo_clean "Reply received, but failure expected!"
+}
+
+function remove_sd_mapping {
+ curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 1e4f00f4-74eb-20d7-97da-89963f37713b" -d '{
+ "input": {
+ "eid": {
+ "address-type": "ietf-lisp-address-types:source-dest-key-lcaf",
+ "source-dest-key": {
+ "source": "'$1'",
+ "dest": "'$2'"
+ }
+ }
+ }
+}' "http://${ODL_IP}:8181/restconf/operations/odl-mappingservice:remove-mapping"
+}
+
+function remove_mapping1 {
+curl -X DELETE -H "Content-Type: application/json" -H "Cache-Control: no-cache" "http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database/virtual-network-identifier/0/mapping/${1}/northbound/"
+}
+
+function test_src_dst_overwrite
+{
+ 2_node_topo_setup
+
+ maybe_pause
+
+ test_result=1
+
+ # send ping request
+ send_ping_from_ns vppns1 ${1} ${2}
+
+ maybe_pause
+
+ # Replace ODL mapping with negative one
+ post_curl "add-mapping" "replace1.json"
+ remove_sd_mapping "6.0.1.0/24" "6.0.2.0/24"
+
+ # wait for SMR being resolved
+ sleep 2
+
+ maybe_pause
+
+ # now ping should fail
+ send_ping_from_ns_expect_failure vppns1 ${1} ${2}
+
+ maybe_pause
+
+ # Replace ODL mapping with positive one
+ post_curl "add-mapping" "replace2.json"
+ remove_sd_mapping "6.0.0.0/16" "6.0.2.0/24"
+
+ # wait for SMR being resolved
+ sleep 2
+
+ maybe_pause
+
+ # expect ping reply again
+ send_ping_from_ns vppns1 ${1} ${2}
+ rc=$?
+
+ maybe_pause
+ 2_node_topo_clean
+ print_status $rc "No ICM response!"
+ exit $test_result
+}
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o4.sh
index 465a014..2ccf008 100755
--- a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o4.sh
+++ b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o4.sh
@@ -17,4 +17,4 @@ ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/4o4"
source test_driver/rtr_single_iface.sh
-test_rtr_single_iface ping "6.0.4.4"
+test_rtr_single_iface ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o6.sh b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o6.sh
index 1bc2474..f23bc32 100755
--- a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o6.sh
+++ b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_4o6.sh
@@ -17,4 +17,4 @@ ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/4o6"
source test_driver/rtr_single_iface.sh
-test_rtr_single_iface ping "6.0.4.4"
+test_rtr_single_iface ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o4.sh
index ced8729..b1424ee 100755
--- a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o4.sh
+++ b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o4.sh
@@ -16,4 +16,4 @@ ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/6o4"
source test_driver/rtr_single_iface.sh
-test_rtr_single_iface ping6 "6:0:4::4"
+test_rtr_single_iface ping6 "6:0:2::2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o6.sh b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o6.sh
index 184c4ac..3445fa8 100755
--- a/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o6.sh
+++ b/tests/data_plane/vpp_lite_topo/tests/test_rtr_single_iface_6o6.sh
@@ -17,4 +17,4 @@ ODL_CONFIG_DIR=`pwd`"/../configs/odl/rtr_single_iface/6o6"
source test_driver/rtr_single_iface.sh
-test_rtr_single_iface ping6 "6:0:4::4"
+test_rtr_single_iface ping6 "6:0:2::2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_4o4.sh
new file mode 100755
index 0000000..2786328
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_4o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test LISP source/destination feature (ip4 over ip4)
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/4o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/4o4
+
+source test_driver/src_dst.sh
+
+test_src_dst ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_6o6.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_6o6.sh
new file mode 100755
index 0000000..baaa8f2
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_6o6.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test LISP source/destination feature (ip4 over ip4)
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/6o6
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/6o6
+
+source test_driver/src_dst.sh
+
+test_src_dst ping6 "6:0:2::2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_4o4.sh
new file mode 100755
index 0000000..5909e88
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_4o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test for overwriting remote mappings from the LISP map-cache
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/overwrite/4o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/overwrite/4o4
+
+source test_driver/src_dst_overwrite.sh
+
+test_src_dst_overwrite ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_6o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_6o4.sh
new file mode 100755
index 0000000..6ec47db
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_identical_ippref_overwrite_6o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test for overwriting remote mappings from the LISP map-cache
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/overwrite/6o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/overwrite/6o4
+
+source test_driver/src_dst_overwrite.sh
+
+test_src_dst_overwrite ping6 "6:0:2::2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_l2o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_l2o4.sh
new file mode 100755
index 0000000..38c1261
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_l2o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test LISP source/destination feature (ip4 over ip4)
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/l2o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/l2o4
+
+source test_driver/src_dst.sh
+
+test_src_dst_l2 ping "6.0.10.22"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_4o4.sh
new file mode 100755
index 0000000..d62aff6
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_4o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test for overwriting remote mappings from the LISP map-cache
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/overwrite/4o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/overwrite_superset/4o4
+
+source test_driver/src_dst_overwrite.sh
+
+test_src_dst_overwrite ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_6o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_6o4.sh
new file mode 100755
index 0000000..752ea9b
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_src_dst_superset_ippref_overwrite_6o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test for overwriting remote mappings from the LISP map-cache
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/sd/overwrite/6o4
+ODL_CONFIG_DIR=`pwd`/../configs/odl/sd/overwrite_superset/6o4
+
+source test_driver/src_dst_overwrite.sh
+
+test_src_dst_overwrite ping6 "6:0:2::2"
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
new file mode 100644
index 0000000..9f23315
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/topologies/3_node_star.sh
@@ -0,0 +1,240 @@
+#!/usr/bin/env bash
+
+# +--------+
+# | |
+# 6.0.10.25 | MR |
+# 08:55:55:55:55:55 | |
+# + +--------+
+# | |6.0.3.100
+# 6:0:1::2 |vpp8 |6:0:3::100
+# 6.0.1.2 vpp1 +-+------+ | +--------+
+# +---------+ |xtr1 | xtr2 | |vpp2
+# | VPP1 +----------+---------+ VPP2 +---------+
+# +---------+ | | | | 6.0.2.2
+# 6.0.5.5 vpp3 +-+------+ | +-----+--+ 6:0:2::2
+# 6:0:5::5 |vpp5 |xtr3 |vpp7
+# | +--------+ |
+# + | | + 6.0.10.22
+# 6.0.10.21 | VPP3 | 08:22:22:22:22:22
+# 08:11:11:11:11:11 | |
+# +-+----+-+
+# vpp6| |vpp4
+# | |
+# | +6.0.2.2
+# + 6:0:2::2
+# 6.0.10.22
+# 08:22:22:22:22:22
+#
+
+
+function 3_node_star_topo_clean
+{
+ echo "Clearing all VPP instances.."
+ pkill vpp --signal 9
+
+ rm /dev/shm/*
+
+ echo "Cleaning 3 node star topology..."
+ ip netns exec xtr-ns ifconfig vppbr1 down
+ ip netns exec xtr-ns brctl delbr vppbr1
+ ip link del dev vpp1 &> /dev/null
+ ip link del dev vpp2 &> /dev/null
+ ip link del dev vpp3 &> /dev/null
+ ip link del dev vpp4 &> /dev/null
+ ip link del dev vpp5 &> /dev/null
+ ip link del dev vpp6 &> /dev/null
+ ip link del dev vpp7 &> /dev/null
+ ip link del dev vpp8 &> /dev/null
+ ip link del dev xtr1 &> /dev/null
+ ip link del dev xtr2 &> /dev/null
+ ip link del dev xtr3 &> /dev/null
+ ip link del dev odl &> /dev/null
+
+ ip netns del vpp-ns1 &> /dev/null
+ ip netns del vpp-ns2 &> /dev/null
+ ip netns del vpp-ns3 &> /dev/null
+ ip netns del vpp-ns4 &> /dev/null
+ ip netns del vpp-ns5 &> /dev/null
+ ip netns del vpp-ns6 &> /dev/null
+ ip netns del vpp-ns7 &> /dev/null
+ ip netns del vpp-ns8 &> /dev/null
+ ip netns del xtr-ns &> /dev/null
+
+ odl_clear_all
+}
+
+function set_arp
+{
+ mac1=`ip netns exec vpp-ns5 ip a show dev veth_vpp5 | grep "link/ether" | awk '{print $2}'`
+ ip netns exec vpp-ns6 arp -s 6.0.10.21 $mac1
+
+ mac2=`ip netns exec vpp-ns8 ip a show dev veth_vpp8 | grep "link/ether" | awk '{print $2}'`
+ ip netns exec vpp-ns7 arp -s 6.0.10.25 $mac2
+
+ mac3=`ip netns exec vpp-ns7 ip a show dev veth_vpp7 | grep "link/ether" | awk '{print $2}'`
+ ip netns exec vpp-ns5 arp -s 6.0.10.22 $mac3
+ ip netns exec vpp-ns8 arp -s 6.0.10.22 $mac3
+}
+
+function 3_node_star_topo_setup
+{
+ ip netns add vpp-ns1
+ ip netns add vpp-ns2
+ ip netns add vpp-ns3
+ ip netns add vpp-ns4
+ ip netns add vpp-ns5
+ ip netns add vpp-ns6
+ ip netns add vpp-ns7
+ ip netns add vpp-ns8
+ ip netns add xtr-ns
+
+ ip link add veth_xtr1 type veth peer name xtr1
+ ip link add veth_xtr2 type veth peer name xtr2
+ ip link add veth_xtr3 type veth peer name xtr3
+ ip link add veth_odl type veth peer name odl
+ ip link set dev xtr1 up
+ ip link set dev xtr2 up
+ ip link set dev xtr3 up
+ ip link set dev odl up
+
+ ip link set dev veth_xtr1 up netns xtr-ns
+ ip link set dev veth_xtr2 up netns xtr-ns
+ ip link set dev veth_xtr3 up netns xtr-ns
+ ip link set dev veth_odl up netns xtr-ns
+
+ ip netns exec xtr-ns brctl addbr vppbr1
+ ip netns exec xtr-ns brctl addif vppbr1 veth_xtr1
+ ip netns exec xtr-ns brctl addif vppbr1 veth_xtr2
+ ip netns exec xtr-ns brctl addif vppbr1 veth_xtr3
+ ip netns exec xtr-ns brctl addif vppbr1 veth_odl
+ ip netns exec xtr-ns ifconfig vppbr1 up
+
+ ip link add veth_vpp1 type veth peer name vpp1
+ ip link set dev vpp1 up
+ ip link set dev veth_vpp1 up netns vpp-ns1
+
+ ip netns exec vpp-ns1 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.1.2/24 dev veth_vpp1
+ ip addr add 6:0:1::2/64 dev veth_vpp1
+ ip route add 6.0.2.0/24 via 6.0.1.1
+ ip route add 6:0:2::0/64 via 6:0:1::1
+ "
+
+ ip link add veth_vpp2 type veth peer name vpp2
+ ip link set dev vpp2 up
+ ip link set dev veth_vpp2 up netns vpp-ns2
+
+ ip netns exec vpp-ns2 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.2.2/24 dev veth_vpp2
+ ip addr add 6:0:2::2/64 dev veth_vpp2
+ ip route add 6.0.1.0/24 via 6.0.2.1
+ ip route add 6:0:1::0/64 via 6:0:2::1
+ "
+
+ ip link add veth_vpp3 type veth peer name vpp3
+ ip link set dev vpp3 up
+ ip link set dev veth_vpp3 up netns vpp-ns3
+
+ ip netns exec vpp-ns3 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.5.5/24 dev veth_vpp3
+ ip addr add 6:0:5::5/64 dev veth_vpp3
+ ip route add 6.0.2.0/24 via 6.0.5.1
+ ip route add 6:0:2::0/64 via 6:0:5::1
+ "
+
+ ip link add veth_vpp4 type veth peer name vpp4
+ ip link set dev vpp4 up
+ ip link set dev veth_vpp4 up netns vpp-ns4
+
+ ip netns exec vpp-ns4 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.2.2/24 dev veth_vpp4
+ ip addr add 6:0:2::2/64 dev veth_vpp4
+ ip route add 6.0.5.0/24 via 6.0.2.1
+ ip route add 6:0:5::0/64 via 6:0:2::1
+ "
+
+ ip link add veth_vpp5 type veth peer name vpp5
+ ip link set dev vpp5 up
+ ip link set dev veth_vpp5 address 08:11:11:11:11:11
+ ip link set dev veth_vpp5 up netns vpp-ns5
+
+ ip netns exec vpp-ns5 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.10.21/24 dev veth_vpp5
+ "
+
+ ip link add veth_vpp6 type veth peer name vpp6
+ ip link set dev vpp6 up
+ ip link set dev veth_vpp6 address 08:22:22:22:22:22
+ ip link set dev veth_vpp6 up netns vpp-ns6
+
+ ip netns exec vpp-ns6 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.10.22/24 dev veth_vpp6
+ "
+
+ ip link add veth_vpp7 type veth peer name vpp7
+ ip link set dev vpp7 up
+ ip link set dev veth_vpp7 address 08:22:22:22:22:22
+ ip link set dev veth_vpp7 up netns vpp-ns7
+
+ ip netns exec vpp-ns7 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.10.22/24 dev veth_vpp7
+ "
+
+ ip link add veth_vpp8 type veth peer name vpp8
+ ip link set dev vpp8 up
+ ip link set dev veth_vpp8 address 08:55:55:55:55:55
+ ip link set dev veth_vpp8 up netns vpp-ns8
+
+ ip netns exec vpp-ns8 \
+ bash -c "
+ ip link set dev lo up
+ ip addr add 6.0.10.25/24 dev veth_vpp8
+ "
+
+ ip addr add 6.0.3.100/24 dev odl
+ ip addr add 6:0:3::100/64 dev odl
+ ethtool --offload odl rx off tx off
+maybe_pause
+ # generate config files
+ ./scripts/generate_config.py ${VPP_LITE_CONF} ${CFG_METHOD}
+
+ start_vpp 5002 vpp1
+ start_vpp 5003 vpp2
+ start_vpp 5004 vpp3
+
+ echo "* Selected configuration method: $CFG_METHOD"
+ if [ "$CFG_METHOD" == "cli" ] ; then
+ 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
+ elif [ "$CFG_METHOD" == "vat" ] ; then
+ sleep 2
+ ${VPP_API_TEST} chroot prefix vpp1 script in ${VPP_LITE_CONF}/vpp1.vat
+ ${VPP_API_TEST} chroot prefix vpp2 script in ${VPP_LITE_CONF}/vpp2.vat
+ ${VPP_API_TEST} chroot prefix vpp3 script in ${VPP_LITE_CONF}/vpp3.vat
+ else
+ echo "=== WARNING:"
+ echo "=== Invalid configuration method selected!"
+ echo "=== To resolve this set env variable CFG_METHOD to vat or cli."
+ echo "==="
+ fi
+
+ post_curl "add-mapping" ${ODL_CONFIG_FILE1}
+ post_curl "add-mapping" ${ODL_CONFIG_FILE2}
+
+ set_arp
+}
diff --git a/tests/data_plane/vpp_lite_topo/topologies/basic_topo_l2.sh b/tests/data_plane/vpp_lite_topo/topologies/basic_topo_l2.sh
index 630651f..15ad7af 100644
--- a/tests/data_plane/vpp_lite_topo/topologies/basic_topo_l2.sh
+++ b/tests/data_plane/vpp_lite_topo/topologies/basic_topo_l2.sh
@@ -95,6 +95,8 @@ function basic_topo_setup
start_vpp 5002 vpp1
start_vpp 5003 vpp2
+ maybe_pause
+
echo "* Selected configuration method: $CFG_METHOD"
if [ "$CFG_METHOD" == "cli" ] ; then
echo "exec ${VPP_LITE_CONF}/vpp1.cli" | nc 0 5002
diff --git a/tests/data_plane/vpp_lite_topo/topologies/rtr_single_iface.sh b/tests/data_plane/vpp_lite_topo/topologies/rtr_single_iface.sh
deleted file mode 100644
index 4c3e9ca..0000000
--- a/tests/data_plane/vpp_lite_topo/topologies/rtr_single_iface.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/env bash
-
-function rtr_single_iface_clean {
- echo "Clearing all VPP instances.."
- pkill vpp --signal 9
-
- rm /dev/shm/*
-
- echo "Cleaning RTR topology.."
- ip netns exec xtr-rtr-ns ifconfig vppbr1 down
- ip netns exec xtr-rtr-ns brctl delbr vppbr1
- ip link del dev vpp1 &> /dev/null
- ip link del dev vpp2 &> /dev/null
- ip link del dev xtr_rtr1 &> /dev/null
- ip link del dev xtr_rtr2 &> /dev/null
- ip link del dev xtr_rtr3 &> /dev/null
- ip link del dev odl &> /dev/null
-
- ip netns del vpp-ns1 &> /dev/null
- ip netns del vpp-ns2 &> /dev/null
- ip netns del xtr-rtr-ns &> /dev/null
-
- odl_clear_all
-}
-
-function rtr_single_iface_setup {
- ip netns add vpp-ns1
- ip netns add vpp-ns2
- ip netns add xtr-rtr-ns
-
- ip link add veth_xtr_rtr1 type veth peer name xtr_rtr1
- ip link add veth_xtr_rtr2 type veth peer name xtr_rtr2
- ip link add veth_xtr_rtr3 type veth peer name xtr_rtr3
- ip link add veth_odl type veth peer name odl
- ip link set dev xtr_rtr1 up
- ip link set dev xtr_rtr2 up
- ip link set dev xtr_rtr3 up
- ip link set dev odl up
-
- ip link set dev veth_xtr_rtr1 up netns xtr-rtr-ns
- ip link set dev veth_xtr_rtr2 up netns xtr-rtr-ns
- ip link set dev veth_xtr_rtr3 up netns xtr-rtr-ns
- ip link set dev veth_odl up netns xtr-rtr-ns
-
- ip netns exec xtr-rtr-ns brctl addbr vppbr1
- ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr1
- ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr2
- ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_xtr_rtr3
- ip netns exec xtr-rtr-ns brctl addif vppbr1 veth_odl
- ip netns exec xtr-rtr-ns ifconfig vppbr1 up
-
- ip link add veth_vpp1 type veth peer name vpp1
- ip link set dev vpp1 up
- ip link set dev veth_vpp1 up netns vpp-ns1
-
- ip netns exec vpp-ns1 \
- bash -c "
- ip link set dev lo up
- ip addr add 6.0.2.2/24 dev veth_vpp1
- ip addr add 6:0:2::2/64 dev veth_vpp1
- ip route add 6.0.4.0/24 via 6.0.2.1
- ip route add 6:0:4::0/64 via 6:0:2::1
- "
-
- ip link add veth_vpp2 type veth peer name vpp2
- ip link set dev vpp2 up
- ip link set dev veth_vpp2 up netns vpp-ns2
-
- ip netns exec vpp-ns2 \
- bash -c "
- ip link set dev lo up
- ip addr add 6.0.4.4/24 dev veth_vpp2
- ip addr add 6:0:4::4/64 dev veth_vpp2
- ip route add 6.0.2.0/24 via 6.0.4.1
- ip route add 6:0:2::0/64 via 6:0:4::1
- "
-
- ip addr add 6.0.3.100/24 dev odl
- ip addr add 6:0:3::100/64 dev odl
- ethtool --offload odl rx off tx off
-
- # generate config files
- ./scripts/generate_config.py ${VPP_LITE_CONF} ${CFG_METHOD}
-
- start_vpp 5002 vpp1
- start_vpp 5003 vpp2
- start_vpp 5004 vpp3
-
- echo "* Selected configuration method: $CFG_METHOD"
- if [ "$CFG_METHOD" == "cli" ] ; then
- 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
- elif [ "$CFG_METHOD" == "vat" ] ; then
- sleep 2
- ${VPP_API_TEST} chroot prefix vpp1 script in ${VPP_LITE_CONF}/vpp1.vat
- ${VPP_API_TEST} chroot prefix vpp2 script in ${VPP_LITE_CONF}/vpp2.vat
- ${VPP_API_TEST} chroot prefix vpp3 script in ${VPP_LITE_CONF}/vpp3.vat
- else
- echo "=== WARNING:"
- echo "=== Invalid configuration method selected!"
- echo "=== To resolve this set env variable CFG_METHOD to vat or cli."
- echo "==="
- fi
-
- post_curl "add-mapping" ${ODL_CONFIG_FILE1}
- post_curl "add-mapping" ${ODL_CONFIG_FILE2}
-}