Improve doc in data driven perf tests
[csit.git] / tests / func / softwire / eth2p-ethip4--ethip6ip4-ip4base--ip6base-swiremapt-func.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
15 *** Settings ***
16 | Resource | resources/libraries/robot/default.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/ipv6.robot
20 | Resource | resources/libraries/robot/map.robot
21 | Library  | resources.libraries.python.IPUtil
22 | Library  | resources.libraries.python.Trace
23 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
24 | Test Setup | Run Keywords | Func Test Setup
25 | ... | AND | Set interfaces IP addresses and routes
26 | Test Teardown | Func Test Teardown
27 | Documentation | *Test for Basic mapping rule for MAP-T*\
28 | ... | *[Top] Network Topologies:* TG - DUT1 - TG with two links between the
29 | ... | nodes.
30 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG-to-DUT-if1.
31 | ... | Eth-IPv6-UDP on TG-to-DUT-if2.
32 | ... | *[Cfg] DUT configuration:* DUT is configured with IPv4 on one DUT-to-TG
33 | ... | interface and IPv6 address on second DUT-to-TG interface. MAP-T domain
34 | ... | is configured in test template based on test parameters.
35 | ... | *[Ver] TG verification:* UDP packets in IPv4 are sent by TG to
36 | ... | destination in MAP domain. IPv6 packets with translated IPv4 addresses
37 | ... | are received on TG interface.
38 | ... | *[Ref] Applicable standard specifications:* RFC7599
39
40
41 *** Variables ***
42 | ${dut_ip4}= | 10.0.0.1
43 | ${dut_ip6}= | 2001:0::1
44 | ${dut_ip4_gw}= | 10.0.0.2
45 | ${dut_ip6_gw}= | 2001:0::2
46 | ${ipv4_prefix_len}= | 24
47 | ${ipv6_prefix_len}= | 64
48 | ${ipv6_br_src}= | 2001:db8:ffff::/96
49
50
51 *** Test Cases ***
52 | TC01: MAP-T test
53 | | [Documentation] |
54 | | ... | Test to check map-t address translation.
55 | | ...
56 | | ... | Arguments:
57 | | ...
58 | | ... | - ipv4_pfx
59 | | ... | - ipv6_dst_pfx
60 | | ... | - ipv6_src_pfx
61 | | ... | - ea_bit_len
62 | | ... | - psid_offset
63 | | ... | - psid_len
64 | | ... | - ipv4_src
65 | | ... | - ipv4_dst
66 | | ... | - dst_port
67 | | ...
68 | | [Template] | Check MAP-T configuration with traffic script
69 # |===================|===============|================|============|=============|==========|===========|================|==========|
70 # | ipv4_pfx          | ipv6_dst_pfx  | ipv6_src_pfx   | ea_bit_len | psid_offset | psid_len | ipv4_src  | ipv4_dst       | dst_port |
71 # |===================|===============|================|============|=============|==========|===========|================|==========|
72 | | 20.169.0.0/16     | 2001::/16     | ${ipv6_br_src} | ${40}      | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
73 | | 20.169.201.219/32 | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
74 | | 20.0.0.0/8        | 2001:db8::/40 | ${ipv6_br_src} | ${24}      | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
75 #| | 20.169.201.0/32   | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${6}        | ${8}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
76 #| | 20.169.201.0/24   | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${6}        | ${8}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
77
78
79 *** Keywords ***
80 | Set interfaces IP addresses and routes
81 | | Path for 2-node testing is set
82 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
83 | | Interfaces in 2-node path are up
84 | | IP addresses are set on interfaces
85 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
86 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
87 | | Vpp Route Add | ${dut_node} | :: | 0 | ${dut_ip6_gw} | ${dut_to_tg_if2}
88 | | ... | resolve_attempts=${NONE} | count=${NONE}
89 | | Add IP neighbor | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6_gw}
90 | | ... | ${tg_to_dut_if2_mac}
91 | | Vpp Route Add | ${dut_node} | 0.0.0.0 | 0 | ${dut_ip4_gw} | ${dut_to_tg_if1}
92 | | ... | resolve_attempts=${NONE} | count=${NONE}
93 | | Add IP neighbor | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4_gw}
94 | | ... | ${tg_to_dut_if1_mac}
95
96 | Check MAP-T configuration with traffic script
97 | | [Documentation] |
98 | | ... | Used as a test case template.\
99 | | ... | Configure MAP-T domain with given parameters, with traffic script send
100 | | ... | UDP in IPv4 packet to given UDP destination port and IP destination
101 | | ... | address and check if correctly received IPv6 packet with translated
102 | | ... | source and destination addresses. Vice versa send IPv6 packet and
103 | | ... | check if received IPv4 packet with correct source and destination
104 | | ... | addresses.
105 | | ... | The MAP domain is deleted in teardown.
106 | | [Arguments] | ${ipv4_pfx} | ${ipv6_dst_pfx} | ${ipv6_src_pfx}
107 | | ... | ${ea_bit_len} | ${psid_offset} | ${psid_len}
108 | | ... | ${ipv4_outside} | ${ipv4_inside} | ${dst_port}
109 | | ${domain_index}= | Map Add Domain | ${dut_node} | ${ipv4_pfx}
110 | | ... | ${ipv6_dst_pfx} | ${ipv6_src_pfx} | ${ea_bit_len} | ${psid_offset}
111 | | ... | ${psid_len} | ${TRUE}
112 | | ${ipv6_ce_addr}= | Compute IPv6 map destination address
113 | | ... | ${ipv4_pfx} | ${ipv6_dst_pfx} | ${ea_bit_len} | ${psid_offset}
114 | | ... | ${psid_len} | ${ipv4_inside} | ${dst_port}
115 | | ${ipv6_br_addr}= | Compute IPv6 map source address
116 | | ... | ${ipv6_src_pfx} | ${ipv4_outside}
117 # Check translation from v4 to v6 with traffic script
118 | | Send IPv4 UDP and check IPv6 headers for MAP-T
119 | | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
120 | | ... | ${dut_to_tg_if1_mac} | ${ipv4_inside} | ${ipv4_outside} | ${dst_port}
121 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
122 | | ... | ${ipv6_ce_addr} | ${ipv6_br_addr}
123 # Check translation from v6 to v4 with traffic script
124 | | Send IPv6 UDP and check IPv4 headers for MAP-T
125 | | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1}
126 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
127 | | ... | ${ipv6_br_addr} | ${ipv6_ce_addr}
128 | | ... | ${dst_port}
129 | | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
130 | | ... | ${ipv4_outside} | ${ipv4_inside}
131 | | [Teardown] | Run Keywords
132 | | ... | Map Del Domain | ${dut_node} | ${domain_index} | AND
133 | | ... | Show packet trace on all DUTs | ${nodes} | AND
134 | | ... | Clear packet trace on all DUTs | ${nodes} | AND
135 | | ... | Check VPP PID in Teardown