CSIT-32: Add Lightweight 4over6 test.
[csit.git] / tests / suites / softwire / lightweight_4over6.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/testing_path.robot
17 | Resource | resources/libraries/robot/ipv4.robot
18 | Resource | resources/libraries/robot/ipv6.robot
19 | Resource | resources/libraries/robot/map.robot
20 | Library  | resources.libraries.python.Trace
21 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
22 | Test Setup | Run Keywords | Setup all DUTs before test
23 | ...        | AND          | Setup all TGs before traffic script
24 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
25 | Documentation | *Lightweight 4 over 6 test cases*
26 | ...
27 | ... | LW4o6 is a subset of MAP-E, with per-subscriber rules. It uses the
28 | ... | same tunneling mechanism and configuration as MAP-E. It does not use
29 | ... | embedded address bits.
30 | ...
31 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
32 | ... | between nodes.
33 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG_if1-DUT,
34 | ... | Eth-IPv6-IPv4-UDP on TG_if2_DUT.
35 | ... | *[Cfg] DUT configuration:* DUT1 is configured as lwAFTR.
36 | ... | *[Ver] TG verification:* Test UDP ICMP Echo Request in IPv4 are
37 | ... | sent to lwAFTR and are verified by TG for correctness their
38 | ... | encapsulation in IPv6 src-addr, dst-addr and MAC addresses.
39 | ... | *[Ref] Applicable standard specifications:* RFC7596 RFC7597.
40
41 *** Variables ***
42 | ${dut_ip4}= | 10.0.0.1
43 | ${dut_ip6}= | 2001:0::1
44 | ${ipv4_prefix_len}= | 24
45 | ${ipv6_prefix_len}= | 64
46
47 | ${lw_ipv4_pfx}= | 20.0.0.1/32
48 | ${lw_ipv6_pfx}= | 2001:1::/64
49 | ${lw_ipv6_src}= | 2001:1::1
50 | ${lw_psid_length}= | ${8}
51 | ${lw_psid_offset}= | ${6}
52 | ${lw_rule_psid}= | ${52}
53 | ${lw_rule_ipv6_dst}= | 2001:1::2
54 | ${test_ipv4_inside}= | 20.0.0.1
55 | ${test_ipv4_outside}= | 10.0.0.100
56 # test_port depends on psid, length, offset
57 | ${test_port}= | ${1232}
58
59 *** Test Cases ***
60 | TC01: Encapsulate IPv4 into IPv6. IPv6 dst depends on IPv4 and UDP destination
61 | | [Documentation]
62 | | ... | [Top] TG=DUT1.
63 | | ... | [Enc] Eth-IPv4-UDP on TG_if1-DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT.
64 | | ... | [Cfg] On DUT1 configure Map domain and Map rule.
65 | | ... | [Ver] Make TG send non-encapsulated UDP to DUT; verify TG received
66 | | ... |       IPv4oIPv6 encapsulated packet is correct.
67 | | ... | [Ref] RFC7596 RFC7597
68 | | ...
69 | | Given Path for 2-node testing is set
70 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
71 | | And   Interfaces in 2-node path are up
72 | | And   IP addresses are set on interfaces
73 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
74 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
75 | | And   Add IP Neighbor
76 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${lw_rule_ipv6_dst}
77 | |       ... | ${tg_to_dut_if2_mac}
78 | | ${domain_index}=
79 | | ... | When Map Add Domain
80 | |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
81 | |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
82 | |            ... | ${lw_psid_length}
83 | |       And  Map Add Rule
84 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
85 | |            ... | ${lw_rule_ipv6_dst}
86 | | Then Send IPv4 UDP and check headers for lightweight 4over6
87 | |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
88 | |      ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside}
89 | |      ... | ${test_port} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
90 | |      ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src}