From d65394be7ad78b9a923f2149ccdf74fb91a747d1 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Tue, 22 Nov 2016 14:05:49 +0100 Subject: Add map register and rloc probe tests Change-Id: I7b2908ee9e6058bc5bad9ea82ca69e51e3bb2534 Signed-off-by: Filip Tehlar --- .../configs/odl/basic/4o4_map_register/vpp1.json | 12 ++++++ .../configs/odl/basic/4o4_map_register/vpp2.json | 12 ++++++ .../basic/4o4_map_register/vpp1.config | 9 +++++ .../basic/4o4_map_register/vpp2.config | 9 +++++ .../basic/4o4_rloc_probe/vpp1.config | 8 ++++ .../basic/4o4_rloc_probe/vpp2.config | 7 ++++ tests/data_plane/vpp_lite_topo/odl_utils.sh | 1 + .../vpp_lite_topo/scripts/cmd_mappings.py | 3 ++ .../data_plane/vpp_lite_topo/test_driver/basic.sh | 46 ++++++++++++++++++++++ .../tests/manual_test_rloc_probe_4o4.sh | 18 +++++++++ .../vpp_lite_topo/tests/test_map_register_4o4.sh | 10 +++++ 11 files changed, 135 insertions(+) create mode 100644 tests/data_plane/configs/odl/basic/4o4_map_register/vpp1.json create mode 100644 tests/data_plane/configs/odl/basic/4o4_map_register/vpp2.json create mode 100644 tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp1.config create mode 100644 tests/data_plane/configs/vpp_lite_config/basic/4o4_map_register/vpp2.config create mode 100644 tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp1.config create mode 100644 tests/data_plane/configs/vpp_lite_config/basic/4o4_rloc_probe/vpp2.config create mode 100755 tests/data_plane/vpp_lite_topo/tests/manual_test_rloc_probe_4o4.sh create mode 100755 tests/data_plane/vpp_lite_topo/tests/test_map_register_4o4.sh 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" -- cgit 1.2.3-korg