Migrate report/trending/docs to bash framework
[csit.git] / tests / vpp / device / ip4 / 2n1l-10ge2p1x710-ethip4udp-nat44ed-scapy.robot
1 # Copyright (c) 2021 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/shared/default.robot
16 | Resource | resources/libraries/robot/ip/nat.robot
17 | Resource | resources/libraries/robot/shared/traffic.robot
18 |
19 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
20 | ... | NIC_Intel-X710 | ETH | IP4FWD | FEATURE | NAT44 | NAT44_ENDPOINT_DEPENDENT
21 | ... | BASE | UDP | DRV_VFIO_PCI
22 | ... | RXQ_SIZE_0 | TXQ_SIZE_0
23 | ... | ethip4udp-nat44ed-scapy
24 |
25 | Suite Setup | Setup suite topology interfaces | scapy
26 | Test Setup | Setup test
27 | Test Teardown | Tear down test | packet_trace | nat-ed
28 |
29 | Test Template | Local Template
30 |
31 | Documentation | *RFC2544: Pkt throughput NAT44 endpoint-dependent mode
32 | ... | performance test cases*
33 |
34 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology
35 | ... | with single links between nodes.
36 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP for IPv4 routing.
37 | ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv4 routing and
38 | ... | one static IPv4 /${dest_mask} route entries.
39 | ... | DUT1 is tested with ${nic_name}.\
40 | ... | *[Ver] TG verification:* Eth-IPv4-UDP packet is sent from TG to DUT1 in\
41 | ... | one direction. Packet is received and verified for correctness on TG.\
42 | ... | Then Eth-IPv4-UDP packet is sent from TG in opposite direction. Packet\
43 | ... | is received and verified for correctness on TG.
44 | ... | *[Ref] Applicable standard specifications:* RFC791, RFC768, RFC3022,
45 | ... | RFC4787.
46
47 *** Variables ***
48 | @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so | nat_plugin.so
49 | ${crypto_type}= | ${None}
50 | ${nic_name}= | Intel-X710
51 | ${nic_driver}= | vfio-pci
52 | ${nic_rxq_size}= | 0
53 | ${nic_txq_size}= | 0
54 | ${nic_pfs}= | 2
55 | ${nic_vfs}= | 0
56 | ${overhead}= | ${0}
57 # IP settings
58 | ${tg_if1_ip4}= | 10.0.0.2
59 | ${tg_if1_mask}= | ${20}
60 | ${tg_if2_ip4}= | 12.0.0.2
61 | ${tg_if2_mask}= | ${20}
62 | ${dut1_if1_ip4}= | 10.0.0.1
63 | ${dut1_if1_mask}= | ${24}
64 | ${dut1_if2_ip4}= | 12.0.0.1
65 | ${dut1_if2_mask}= | ${24}
66 | ${dest_net}= | 20.0.0.0
67 | ${dest_mask}= | ${22}
68 # proto layer settings
69 | ${protocol}= | UDP
70 | ${src_port_in}= | 1024
71 | ${dst_port}= | 8080
72 # NAT settings
73 | ${nat_mode}= | endpoint-dependent
74 | ${n_sessions}= | ${64512}
75 | ${in_net}= | 192.168.0.0
76 | ${in_mask}= | ${22}
77 | ${out_net}= | 68.142.68.0
78 | ${out_net_end}= | 68.142.68.0
79 | ${out_mask}= | ${32}
80
81 *** Keywords ***
82 | Local Template
83 | |
84 | | [Documentation]
85 | | ... | [Cfg] DUT runs NAT44 ${nat_mode} configuration.
86 | | ... | [Ver] Make TG send IPv4 packet routed over DUT1 interfaces.\
87 | | ... | Make TG verify IPv4 packet is correct.
88 | |
89 | | ... | *Arguments:*
90 | | ... | - frame_size - Framesize in Bytes in integer. Type: integer
91 | | ... | - phy_cores - Number of physical cores. Type: integer
92 | | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
93 | |
94 | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
95 | |
96 | | Set Test Variable | \${frame_size}
97 | |
98 | | Given Set Jumbo
99 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
100 | | And Pre-initialize layer driver | ${nic_driver}
101 | | And Apply startup configuration on all VPP DUTs | with_trace=${True}
102 | | When Initialize layer driver | ${nic_driver}
103 | | And Initialize layer interface
104 | | And Initialize IPv4 forwarding for NAT44 in circular topology
105 | | And Initialize NAT44 endpoint-dependent mode in circular topology
106 | | Then Send TCP or UDP packet and verify network address translations
107 | | ... | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0] | ${DUT1_vf1_mac}[0]
108 | | ... | ${DUT1_vf2_mac}[0] | ${in_net} | ${out_net} | ${dest_net}
109 | | ... | ${protocol} | ${src_port_in} | ${dst_port}
110
111 *** Test Cases ***
112 | 64B-0c-ethip4udp-nat44ed-scapy
113 | | [Tags] | 64B | 0C
114 | | frame_size=${64} | phy_cores=${0}