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