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