X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=tests%2Fvpp%2Ffunc%2Fip4_tunnels%2Fsoftwire%2Feth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot;fp=tests%2Fvpp%2Ffunc%2Fip4_tunnels%2Fsoftwire%2Feth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot;h=378accb922f89d52a98620135832ec92cada28fe;hp=0000000000000000000000000000000000000000;hb=6721e7f09aa95bff6622068332a3f56afad9c87b;hpb=859157b5db45927c7b4bb0b2d575e68805777a86 diff --git a/tests/vpp/func/ip4_tunnels/softwire/eth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot b/tests/vpp/func/ip4_tunnels/softwire/eth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot new file mode 100644 index 0000000000..378accb922 --- /dev/null +++ b/tests/vpp/func/ip4_tunnels/softwire/eth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot @@ -0,0 +1,209 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/ip/ip4.robot +| Resource | resources/libraries/robot/ip/ip6.robot +| Resource | resources/libraries/robot/ip/map.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO +| Test Setup | Set up functional test +| Test Teardown | Tear down functional test +| Documentation | *Lightweight 4 over 6 test cases* +| ... +| ... | LW4o6 is a subset of MAP-E, with per-subscriber rules. It uses the +| ... | same tunneling mechanism and configuration as MAP-E. It does not use +| ... | embedded address bits. +| ... +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG_if1-DUT, +| ... | Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| ... | *[Cfg] DUT configuration:* DUT1 is configured as lwAFTR. +| ... | *[Ver] TG verification:* Test UDP ICMP Echo Request in IPv4 are +| ... | sent to lwAFTR and are verified by TG for correctness their +| ... | encapsulation in IPv6 src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7596 RFC7597. + +*** Variables *** +| ${dut_ip4}= | 10.0.0.1 +| ${dut_ip6}= | 2001:0::1 +| ${tg_ip6}= | 2001:0::2 +| ${ipv4_prefix_len}= | 24 +| ${ipv6_prefix_len}= | 64 + +| ${lw_ipv4_pfx}= | 20.0.0.1/32 +| ${lw_ipv6_pfx}= | 2001:1::/64 +| ${lw_ipv6_src}= | 2001:1::1 +| ${lw_psid_length}= | ${8} +| ${lw_psid_offset}= | ${6} +| ${lw_rule_psid}= | ${52} +| ${lw_rule_ipv6_dst}= | 2001:1::2 +| ${lw_rule_2_psid}= | ${22} +| ${lw_rule_2_ipv6_dst}= | 2001:1::3 +| ${test_ipv4_inside}= | 20.0.0.1 +| ${test_ipv4_outside}= | 10.0.0.100 +# test_port depends on psid, length, offset +| ${test_port}= | ${1232} +| ${test_icmp_id}= | ${1232} +| ${test_2_port}= | ${6232} + +*** Test Cases *** +| TC01: Encapsulate IPv4 into IPv6. IPv6 dst depends on IPv4 and UDP destination +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv4-UDP on TG_if1-DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send non-encapsulated UDP to DUT; verify TG received +| | ... | IPv4oIPv6 encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Configure IP addresses on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6} +| | ... | ${tg_to_dut_if2_mac} +| | And Vpp Route Add +| | ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128 +| | ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 UDP and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside} +| | ... | ${test_port} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src} + +TC02: Encapsulate IPv4 ICMP into IPv6. IPv6 dst depends on IPv4 addr and ICMP ID +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv4-ICMP(type 0 and 8) on TG_if1-DUT, Eth-IPv6-IPv4-ICMP +| | ... | on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send non-encapsulated ICMP to DUT; verify TG received +| | ... | IPv4oIPv6 encapsulated packet is correct. Checks IPv6 +| | ... | destination based on ICMP Identifier field. +| | ... | [Ref] RFC7596 section 8.1 +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Configure IP addresses on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6} +| | ... | ${tg_to_dut_if2_mac} +| | And Vpp Route Add +| | ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128 +| | ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 ICMP and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside} +| | ... | ${test_icmp_id} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src} + +TC03: Decapsulate IPv4 UDP from IPv6. +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv4-UDP on TG_if1-DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received +| | ... | IPv4 non-encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Configure IP addresses on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add Arp on DUT +| | ... | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${test_ipv4_outside} +| | ... | ${tg_to_dut_if1_mac} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac} +| | ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst} +| | ... | ${test_ipv4_outside} | ${test_ipv4_inside} | ${test_port} +| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} + +TC04: Hairpinning of traffic between two lwB4 +| | [Documentation] +| | ... | [Top] DUT1-TG. +| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and two Map rules. +| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received +| | ... | encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Configure IP addresses on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6} +| | ... | ${tg_to_dut_if2_mac} +| | And Vpp Route Add +| | ... | ${dut_node} | ${lw_rule_2_ipv6_dst} | 128 +| | ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_2_psid} +| | ... | ${lw_rule_2_ipv6_dst} +| | Then Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if2_mac} +| | ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst} +| | ... | ${test_ipv4_inside} | ${test_ipv4_inside} +| | ... | ${test_2_port} | ${test_port} +| | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_2_ipv6_dst} | ${lw_ipv6_src}