d2db9b0ef04b7ed6aaa050d874b186cd9eb0564a
[csit.git] / tests / vpp / device / crypto / ethip4 / 2n1l-10ge2p1x710-ethip4ipsec11tnlsw-ip4base-int-aes128cbc-hmac512sha-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 |
17 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
18 | ... | NIC_Intel-X710 | IP4FWD | IPSEC | IPSECSW | IPSECINT | IP4BASE
19 | ... | AES_128_CBC | HMAC_SHA_512 | HMAC | AES | DRV_VFIO_PCI
20 | ... | RXQ_SIZE_0 | TXQ_SIZE_0
21 | ... | ethip4ipsec11tnlsw-ip4base-int-aes128cbc-hmac512sha
22 |
23 | Suite Setup | Setup suite topology interfaces | scapy
24 | Test Setup | Setup test
25 | Test Teardown | Tear down test | packet_trace | telemetry | ipsec_sa
26 |
27 | Test Template | Local Template
28 |
29 | Documentation | **IPv4 IPsec tunnel mode test suite.**
30 | ... |
31 | ... | - **[Top] Network topologies:** TG-DUT1 2-node topology with one link \
32 | ... | between nodes.
33 | ... |
34 | ... | - **[Cfg] DUT configuration:** On DUT1 create loopback interface, \
35 | ... | configure loopback an physical interface IPv4 addresses, static ARP \
36 | ... | record, route and IPsec manual keyed connection in tunnel mode.
37 | ... |
38 | ... | - **[Ver] TG verification:** ETH-IP4 packet is sent from TG to DUT1. \
39 | ... | Packet is received on TG from DUT1.
40 | ... |
41 | ... | - **[Ref] Applicable standard specifications:** RFC4303.
42
43 *** Variables ***
44 | @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so
45 | ... | crypto_native_plugin.so | crypto_ipsecmb_plugin.so
46 | ... | crypto_openssl_plugin.so
47 | ${crypto_type}= | ${None}
48 | ${nic_name}= | Intel-X710
49 | ${nic_driver}= | vfio-pci
50 | ${nic_rxq_size}= | 0
51 | ${nic_txq_size}= | 0
52 | ${nic_pfs}= | 2
53 | ${nic_vfs}= | 0
54 | ${overhead}= | ${90}
55 | ${tg_if1_ip4}= | 192.168.10.2
56 | ${dut1_if1_ip4}= | 192.168.10.1
57 | ${tun_if1_ip4}= | 100.0.0.1
58 | ${tun_if2_ip4}= | 200.0.0.2
59 | ${raddr_ip4}= | 20.0.0.0
60 | ${laddr_ip4}= | 10.0.0.0
61 | ${addr_range}= | ${24}
62 | ${n_tunnels}= | ${11}
63 # Telemetry
64 | ${telemetry_profile}= | vpp_test_teardown
65
66 *** Keywords ***
67 | Local Template
68 | | [Documentation]
69 | | ... | - **[Cfg]** On DUT1 configure IPsec tunnel interfaces with \
70 | | ... | encryption algorithm AES_128_CBC and integrity algorithm \
71 | | ... | HMAC_SHA_512 in tunnel mode.
72 | |
73 | | ... | *Arguments:*
74 | | ... | - frame_size - Framesize in Bytes in integer. Type: integer
75 | | ... | - phy_cores - Number of physical cores. Type: integer
76 | | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
77 | |
78 | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
79 | |
80 | | Set Test Variable | \${frame_size}
81 | |
82 | | # These are enums (not strings) so they cannot be in Variables table.
83 | | ${encr_alg} = | Crypto Alg AES CBC 128
84 | | ${auth_alg} = | Integ Alg SHA 512 256
85 | |
86 | | Given Set Max Rate And Jumbo
87 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
88 | | And Pre-initialize layer driver | ${nic_driver}
89 | | And Apply startup configuration on all VPP DUTs | with_trace=${True}
90 | | When Initialize layer driver | ${nic_driver}
91 | | And Initialize layer interface
92 | | And Initialize IPSec in 2-node circular topology
93 | | ${encr_keys} | ${auth_keys} | ${dut_spi} | ${tg_spi} =
94 | | ... | And VPP IPsec Create Tunnel Interfaces
95 | | ... | ${nodes} | ${tun_if1_ip4} | ${tun_if2_ip4} | ${DUT1_${int}2}[0]
96 | | ... | ${TG_pf2}[0] | ${n_tunnels} | ${encr_alg} | ${auth_alg}
97 | | ... | ${laddr_ip4} | ${raddr_ip4} | ${addr_range} | return_keys=${True}
98 | | Then Send IP Packet and verify ESP encapsulation in received packet
99 | | ... | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0] | ${DUT1_${int}1_mac}[0]
100 | | ... | ${DUT1_${int}2_mac}[0] | ${encr_alg} | ${encr_keys}[0] | ${auth_alg}
101 | | ... | ${auth_keys}[0] | ${dut_spi} | ${tg_spi} | ${laddr_ip4} | ${raddr_ip4}
102 | | ... | ${tun_if1_ip4} | ${tun_if2_ip4}
103
104 *** Test Cases ***
105 | 64B-0c-ethip4ipsec11tnlsw-ip4base-int-aes128cbc-hmac512sha-scapy
106 | | [Tags] | 64B | 0C
107 | | frame_size=${64} | phy_cores=${0}