summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <florin.coras@gmail.com>2016-12-07 08:06:24 +0000
committerGerrit Code Review <gerrit@fd.io>2016-12-07 08:06:24 +0000
commit4ff1fc154b4b7460beeda06612b907004b7838c8 (patch)
treed3cf4903f51b0f1731ff509152dc02ee8df4529b
parentad879eb612c0bebd981e58fb74d8c0269952f2bd (diff)
parentd65394be7ad78b9a923f2149ccdf74fb91a747d1 (diff)
Merge "Add map register and rloc probe tests"
-rw-r--r--tests/data_plane/configs/odl/basic/4o4_map_register/vpp1.json12
-rw-r--r--tests/data_plane/configs/odl/basic/4o4_map_register/vpp2.json12
-rw-r--r--tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp1.config9
-rw-r--r--tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp2.config9
-rw-r--r--tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp1.config8
-rw-r--r--tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp2.config7
-rw-r--r--tests/data_plane/vpp_lite_topo/odl_utils.sh1
-rw-r--r--tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py3
-rw-r--r--tests/data_plane/vpp_lite_topo/test_driver/basic.sh46
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/manual_test_rloc_probe_4o4.sh18
-rwxr-xr-xtests/data_plane/vpp_lite_topo/tests/test_map_register_4o4.sh10
11 files changed, 135 insertions, 0 deletions
diff --git a/tests/data_plane/configs/odl/basic/4o4_map_register/vpp1.json b/tests/data_plane/configs/odl/basic/4o4_map_register/vpp1.json
new file mode 100644
index 0000000..c62dd6b
--- /dev/null
+++ b/tests/data_plane/configs/odl/basic/4o4_map_register/vpp1.json
@@ -0,0 +1,12 @@
+{
+ "input": {
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.1.0/24"
+ },
+ "mapping-authkey": {
+ "key-string": "password",
+ "key-type": 1
+ }
+ }
+}
diff --git a/tests/data_plane/configs/odl/basic/4o4_map_register/vpp2.json b/tests/data_plane/configs/odl/basic/4o4_map_register/vpp2.json
new file mode 100644
index 0000000..4e03188
--- /dev/null
+++ b/tests/data_plane/configs/odl/basic/4o4_map_register/vpp2.json
@@ -0,0 +1,12 @@
+{
+ "input": {
+ "eid": {
+ "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+ "ipv4-prefix": "6.0.2.0/24"
+ },
+ "mapping-authkey": {
+ "key-string": "password2",
+ "key-type": 2
+ }
+ }
+}
diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp1.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp1.config
new file mode 100644
index 0000000..ad9f845
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp1.config
@@ -0,0 +1,9 @@
+create_host_iface vpp1 6.0.1.1/24
+create_host_iface intervpp1 6.0.3.1/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp1 1 1
+lisp_local_eid eid 6.0.1.0/24 locator-set ls1 secret-key password key-id sha1
+lisp_map_resolver 6.0.3.100
+lisp_map_server 6.0.3.100
+lisp_map_register_state enable
diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp2.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp2.config
new file mode 100644
index 0000000..512bf62
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp2.config
@@ -0,0 +1,9 @@
+create_host_iface vpp2 6.0.2.1/24
+create_host_iface intervpp2 6.0.3.2/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp2 1 1
+lisp_local_eid eid 6.0.2.0/24 locator-set ls1 secret-key password2 key-id sha256
+lisp_map_server 6.0.3.100
+lisp_map_resolver 6.0.3.100
+lisp_map_register_state enable
diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp1.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp1.config
new file mode 100644
index 0000000..24239d0
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp1.config
@@ -0,0 +1,8 @@
+create_host_iface vpp1 6.0.1.1/24
+create_host_iface intervpp1 6.0.3.1/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp1 1 1
+lisp_local_eid eid 6.0.1.0/24 locator-set ls1
+lisp_map_resolver 6.0.3.100
+lisp_rloc_probe_state enable
diff --git a/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp2.config b/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp2.config
new file mode 100644
index 0000000..c2edf63
--- /dev/null
+++ b/tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp2.config
@@ -0,0 +1,7 @@
+create_host_iface vpp2 6.0.2.1/24
+create_host_iface intervpp2 6.0.3.2/24
+
+lisp_state enable
+lisp_locator_set_with_locator ls1 host-intervpp2 1 1
+lisp_local_eid eid 6.0.2.0/24 locator-set ls1
+lisp_map_resolver 6.0.3.100
diff --git a/tests/data_plane/vpp_lite_topo/odl_utils.sh b/tests/data_plane/vpp_lite_topo/odl_utils.sh
index 44064c0..f6f9957 100644
--- a/tests/data_plane/vpp_lite_topo/odl_utils.sh
+++ b/tests/data_plane/vpp_lite_topo/odl_utils.sh
@@ -13,6 +13,7 @@ function odl_clear_all {
echo "Deleting all ODL mappings.."
curl -X DELETE "http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database" \
-u ${ODL_USER}:${ODL_PASSWD}
+ # TODO how to delete operational mappings?
}
function check_odl_running {
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 62cde11..d6bde91 100644
--- a/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
+++ b/tests/data_plane/vpp_lite_topo/scripts/cmd_mappings.py
@@ -52,12 +52,15 @@ class RepeatableLocators(SimpleMapping):
SimpleMapping('lisp_state', 'lisp', 'lisp_enable_disable')
SimpleMapping('lisp_map_resolver', 'lisp map-resolver', 'lisp_add_del_map_resolver')
+SimpleMapping('lisp_map_server', 'lisp map-server', 'lisp_add_del_map_server')
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')
+SimpleMapping('lisp_rloc_probe_state', 'lisp rloc-probe', 'lisp_rloc_probe_enable_disable')
+SimpleMapping('lisp_map_register_state', 'lisp map-register', 'lisp_map_register_enable_disable')
CustomMapping('lisp_eid_map_bd',
'lisp eid-table map vni {0} bd {1}',
diff --git a/tests/data_plane/vpp_lite_topo/test_driver/basic.sh b/tests/data_plane/vpp_lite_topo/test_driver/basic.sh
index 88753bf..309ff64 100644
--- a/tests/data_plane/vpp_lite_topo/test_driver/basic.sh
+++ b/tests/data_plane/vpp_lite_topo/test_driver/basic.sh
@@ -46,3 +46,49 @@ function test_basic
print_status $rc "No ICMP response!"
exit $test_result
}
+
+function test_basic_map_register
+{
+ 2_node_topo_setup no_odl
+ post_curl "add-key" ${ODL_CONFIG_FILE1}
+ post_curl "add-key" ${ODL_CONFIG_FILE2}
+
+ maybe_pause
+
+ test_result=1
+
+ wait_for_map_register=10
+ echo "Waiting for map registration $wait_for_map_register seconds .."
+ sleep $wait_for_map_register
+
+ ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
+ rc=$?
+
+ maybe_pause
+
+ # test done
+ 2_node_topo_clean
+ print_status $rc "No ICMP response!"
+ exit $test_result
+}
+
+function test_rloc_probe
+{
+ 2_node_topo_setup
+
+ maybe_pause
+ test_result=1
+
+ ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
+ rc=$?
+ assert_rc_ok $rc 2_node_topo_clean "No ICMP response!"
+
+ read -p "Please check RLOC probe messages manually .." -n1
+
+ # test done
+
+ maybe_pause
+ 2_node_topo_clean
+ print_status $rc "No ICMP response!"
+ exit $test_result
+}
diff --git a/tests/data_plane/vpp_lite_topo/tests/manual_test_rloc_probe_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/manual_test_rloc_probe_4o4.sh
new file mode 100755
index 0000000..e7f2f2c
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/manual_test_rloc_probe_4o4.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# Manual test for LISP RLOC probe
+#
+# Test procedure:
+# 1) run the test
+# 2) the test stops its execution after few seconds.
+# At that moment there should be a LISP tunnel configured
+# 3) Attach wireshark to intervpp1 or intervpp2 interface and check if there
+# are map-requests and map-replies coming forth and back with RLOC probe
+# bit set in the LISP header.
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/4o4_rloc_probe
+ODL_CONFIG_DIR=`pwd`/../configs/odl/basic/4o4
+
+source test_driver/basic.sh
+
+test_rloc_probe ping "6.0.2.2"
diff --git a/tests/data_plane/vpp_lite_topo/tests/test_map_register_4o4.sh b/tests/data_plane/vpp_lite_topo/tests/test_map_register_4o4.sh
new file mode 100755
index 0000000..4bc471b
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/tests/test_map_register_4o4.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Test LISP map register feature (ip4 over ip4)
+
+VPP_LITE_CONF=`pwd`/../configs/vpp_lite_config/basic/4o4_map_register
+ODL_CONFIG_DIR=`pwd`/../configs/odl/basic/4o4_map_register
+
+source test_driver/basic.sh
+
+test_basic_map_register ping "6.0.2.2"