Add flow test suites
[csit.git] / tests / vpp / device / flow / 2n1l-10ge2p1x710-ethip4-flow-ip4-ntuple-tcp-scapy.robot
1 # Copyright (c) 2021 Intel 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 |
17 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
18 | ... | NIC_Intel-X710 | ETH | IP4FWD | FLOW | NTUPLE | TCP | DRV_VFIO_PCI
19 | ... | RXQ_SIZE_0 | TXQ_SIZE_0
20 | ... | ethip4-flow-ip4-ntuple-tcp
21 |
22 | Suite Setup | Setup suite topology interfaces | scapy
23 | Test Setup | Setup test
24 | Test Teardown | Tear down test | packet_trace | telemetry
25 |
26 | Test Template | Local Template
27 |
28 | Documentation | *IP4_N_TUPLE flow test cases*
29 | ...
30 | ... | *[Top] Network Topologies:* TG-DUT1 2-node topology with one link\
31 | ... | between nodes.
32 | ... | *[Enc] Packet Encapsulations:* Eth-IP4-TCP.
33 | ... | *[Cfg] DUT configuration:* DUT is configured with IP4_N_TUPLE flow.
34 | ... | *[Ver] TG verification:* Verify if the flow action is correct.
35
36 *** Variables ***
37 | @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so
38 | ${crypto_type}= | ${None}
39 | ${nic_name}= | Intel-X710
40 | ${nic_driver}= | vfio-pci
41 | ${nic_rxq_size}= | 0
42 | ${nic_txq_size}= | 0
43 | ${nic_pfs}= | 2
44 | ${nic_vfs}= | 0
45 | ${overhead}= | ${0}
46 | ${src_ip}= | 1.1.1.1
47 | ${dst_ip}= | 2.2.2.2
48 | ${src_port}= | ${100}
49 | ${dst_port}= | ${200}
50 | ${rxq}= | ${4}
51 # Telemetry
52 | ${telemetry_profile}= | vpp_test_teardown
53
54 *** Keywords ***
55 | Local Template
56 | | [Documentation]
57 | | ... | [Ver] Make TG send IP4 packet routed over DUT1 interfaces.\
58 | | ... | Make VPP verify flow packet is correct.
59 | |
60 | | ... | *Arguments:*
61 | | ... | - frame_size - Framesize in Bytes in integer. Type: integer
62 | | ... | - phy_cores - Number of physical cores. Type: integer
63 | | ... | - rxq - Number of RX queues. Type: integer
64 | |
65 | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${rxq}
66 | |
67 | | Set Test Variable | \${frame_size}
68 | |
69 | | Given Set Max Rate And Jumbo
70 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
71 | | And Pre-initialize layer driver | ${nic_driver}
72 | | And Apply startup configuration on all VPP DUTs | with_trace=${True}
73 | | When Initialize layer driver | ${nic_driver}
74 | | And Initialize layer interface
75 | |
76 | | Clear Packet Trace On Dut | ${dut1}
77 | | Vpp Enable Traces On Dut | ${dut1}
78 | | ${flow_index} = | And Vpp Create Ip4 N Tuple Flow | ${dut1}
79 | | ... | ${src_ip} | ${dst_ip} | ${src_port} | ${dst_port}
80 | | ... | proto=TCP | action=redirect-to-queue | value=${${rxq}-1}
81 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
82 | | Then Send flow packet and verify action
83 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
84 | | ... | flow_type=IP4 | proto=TCP
85 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
86 | | ... | src_port=${src_port} | dst_port=${dst_port}
87 | | ... | action=redirect-to-queue | action_value=${${rxq}-1}
88 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
89 | | And Vpp Flow Del | ${dut1} | ${flow_index}
90 | |
91 | | Clear Packet Trace On Dut | ${dut1}
92 | | Vpp Enable Traces On Dut | ${dut1}
93 | | ${flow_index} = | And Vpp Create Ip4 N Tuple Flow | ${dut1}
94 | | ... | ${src_ip} | ${dst_ip} | ${src_port} | ${dst_port}
95 | | ... | proto=TCP | action=drop
96 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
97 | | Then Send flow packet and verify action
98 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
99 | | ... | flow_type=IP4 | proto=TCP
100 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
101 | | ... | src_port=${src_port} | dst_port=${dst_port}
102 | | ... | action=drop
103 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
104 | | And Vpp Flow Del | ${dut1} | ${flow_index}
105 | |
106 | | Clear Packet Trace On Dut | ${dut1}
107 | | Vpp Enable Traces On Dut | ${dut1}
108 | | ${flow_index} = | And Vpp Create Ip4 N Tuple Flow | ${dut1}
109 | | ... | ${src_ip} | ${dst_ip} | ${src_port} | ${dst_port}
110 | | ... | proto=TCP | action=mark | value=${7}
111 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
112 | | Then Send flow packet and verify action
113 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
114 | | ... | flow_type=IP4 | proto=TCP
115 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
116 | | ... | src_port=${src_port} | dst_port=${dst_port}
117 | | ... | action=mark
118 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
119 | | And Vpp Flow Del | ${dut1} | ${flow_index}
120
121 *** Test Cases ***
122 | 64B-0c-ethip4-flow-ip4-ntuple-tcp-scapy
123 | | [Tags] | 64B | 0C
124 | | frame_size=${64} | phy_cores=${0}