e1c93bf7eee347482d20c7a8558869006c3d0dd5
[csit.git] / tests / vpp / device / flow / 2n1l-10ge2p1x710-ethip4-flow-ip4-ipsec-esp-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 | IPSEC | DRV_VFIO_PCI
19 | ... | RXQ_SIZE_0 | TXQ_SIZE_0
20 | ... | ethip4-flow-ip4-ipsec-esp
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_IPSEC 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-ESP.
33 | ... | *[Cfg] DUT configuration:* DUT is configured with IP4_IPSEC 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 | ${spi}= | ${12345}
49 | ${rxq}= | ${4}
50 # Telemetry
51 | ${telemetry_profile}= | vpp_test_teardown
52
53 *** Keywords ***
54 | Local Template
55 | | [Documentation]
56 | | ... | [Ver] Make TG send IP4-IPSEC packet routed over DUT1 interfaces.\
57 | | ... | Make VPP verify flow packet is correct.
58 | |
59 | | ... | *Arguments:*
60 | | ... | - frame_size - Framesize in Bytes in integer. Type: integer
61 | | ... | - phy_cores - Number of physical cores. Type: integer
62 | | ... | - rxq - Number of RX queues. Type: integer
63 | |
64 | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${rxq}
65 | |
66 | | Set Test Variable | \${frame_size}
67 | |
68 | | Given Set Max Rate And Jumbo
69 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
70 | | And Pre-initialize layer driver | ${nic_driver}
71 | | And Apply startup configuration on all VPP DUTs | with_trace=${True}
72 | | When Initialize layer driver | ${nic_driver}
73 | | And Initialize layer interface
74 | |
75 | | Clear Packet Trace On Dut | ${dut1}
76 | | Vpp Enable Traces On Dut | ${dut1}
77 | | ${flow_index} = | And Vpp Create IP4 Ipsec Flow | ${dut1}
78 | | ... | proto=ESP | spi=${spi}
79 | | ... | action=redirect-to-queue | value=${${rxq}-1}
80 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
81 | | Then Send flow packet and verify action
82 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
83 | | ... | flow_type=IP4 | proto=ESP
84 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
85 | | ... | value=${spi}
86 | | ... | action=redirect-to-queue | action_value=${${rxq}-1}
87 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
88 | | And Vpp Flow Del | ${dut1} | ${flow_index}
89 | |
90 | | Clear Packet Trace On Dut | ${dut1}
91 | | Vpp Enable Traces On Dut | ${dut1}
92 | | ${flow_index} = | And Vpp Create IP4 Ipsec Flow | ${dut1}
93 | | ... | proto=ESP | spi=${spi}
94 | | ... | action=drop
95 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
96 | | Then Send flow packet and verify action
97 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
98 | | ... | flow_type=IP4 | proto=ESP
99 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
100 | | ... | value=${spi}
101 | | ... | action=drop
102 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
103 | | And Vpp Flow Del | ${dut1} | ${flow_index}
104 | |
105 | | Clear Packet Trace On Dut | ${dut1}
106 | | Vpp Enable Traces On Dut | ${dut1}
107 | | ${flow_index} = | And Vpp Create IP4 Ipsec Flow | ${dut1}
108 | | ... | proto=ESP | spi=${spi}
109 | | ... | action=mark | value=${7}
110 | | And Vpp Flow Enable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
111 | | Then Send flow packet and verify action
112 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_${int}1_mac}[0]
113 | | ... | flow_type=IP4 | proto=ESP
114 | | ... | src_ip=${src_ip} | dst_ip=${dst_ip}
115 | | ... | value=${spi}
116 | | ... | action=mark
117 | | And Vpp Flow Disable | ${dut1} | ${DUT1_${int}1}[0] | ${flow_index}
118 | | And Vpp Flow Del | ${dut1} | ${flow_index}
119
120 *** Test Cases ***
121 | 64B-0c-ethip4-flow-ip4-ipsec-esp-scapy
122 | | [Tags] | 64B | 0C
123 | | frame_size=${64} | phy_cores=${0}