PapiExecutor always verifies
[csit.git] / tests / vpp / func / l2xc / eth2p-eth-l2xcbase-iaclbase-func.robot
1 # Copyright (c) 2019 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/shared/counters.robot
17 | Resource | resources/libraries/robot/shared/interfaces.robot
18 | Resource | resources/libraries/robot/shared/testing_path.robot
19 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
20 | Resource | resources/libraries/robot/l2/l2_traffic.robot
21 | Library | resources.libraries.python.Classify.Classify
22 | Library | resources.libraries.python.Trace
23 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO | SKIP_VPP_PATCH
24 | Test Setup | Set up functional test
25 | Test Teardown | Tear down functional test
26 | Documentation | *Ingress ACL test cases*
27 | ...
28 | ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG
29 | ... |        with one link between the nodes.
30 | ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect.
31 | ... |        DUT1 is configured with iACL classification on link to TG,
32 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent
33 | ... |        in one direction by TG on link to DUT1 and received on TG link
34 | ... |        to DUT2. On receive TG verifies if packets are accepted.
35
36 *** Variables ***
37 | ${l2_table}= | l2
38
39 *** Test Cases ***
40 | TC01: DUT with iACL MAC src-addr accepts matching pkts
41 | | [Documentation]
42 | | ... | [Top] TG-DUT1-DUT2-TG.
43 | | ... | [Cfg] On DUT1 add source MAC address to classify table with 'permit'.
44 | | Given Configure path in 3-node circular topology
45 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
46 | | And Set interfaces in 3-node circular topology up
47 | | And Configure L2XC
48 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
49 | | And Configure L2XC
50 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
51 | | Then Send ICMP packet and verify received packet
52 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
53 | | ${table_index} | ${skip_n} | ${match_n}=
54 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node}
55 | | ... | src | ${tg_to_dut1_mac}
56 | | And Vpp Configures Classify Session L2
57 | | ... | ${dut1_node} | permit | ${table_index} | src | ${tg_to_dut1_mac}
58 | | And Vpp Enable Input ACL Interface
59 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
60 | | Then Send ICMP packet and verify received packet
61 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
62
63 | TC02: DUT with iACL MAC dst-addr accepts matching pkts
64 | | [Documentation]
65 | | ... | [Top] TG-DUT1-DUT2-TG.
66 | | ... | [Cfg] On DUT1 add destination MAC address to classify
67 | | ... | table with 'permit'.
68 | | ... | [Ver] Make TG verify matching packets are accepted.
69 | | Given Configure path in 3-node circular topology
70 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
71 | | And Set interfaces in 3-node circular topology up
72 | | And Configure L2XC
73 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
74 | | And Configure L2XC
75 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
76 | | Then Send ICMP packet and verify received packet
77 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
78 | | ${table_index} | ${skip_n} | ${match_n}=
79 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node}
80 | | ... | dst | ${tg_to_dut2_mac}
81 | | And Vpp Configures Classify Session L2
82 | | ... | ${dut1_node} | permit | ${table_index} | dst | ${tg_to_dut2_mac}
83 | | And Vpp Enable Input ACL Interface
84 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
85 | | Then Send ICMP packet and verify received packet
86 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
87
88 | TC03: DUT with iACL MAC src-addr and dst-addr accepts matching pkts
89 | | [Documentation]
90 | | ... | [Top] TG-DUT1-DUT2-TG.
91 | | ... | [Cfg] On DUT1 add source and destination MAC address to classify
92 | | ... | table with 'permit'.
93 | | ... | [Ver] Make TG verify matching packets are accepted.
94 | | Given Configure path in 3-node circular topology
95 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
96 | | And Set interfaces in 3-node circular topology up
97 | | And Configure L2XC
98 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
99 | | And Configure L2XC
100 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
101 | | Then Send ICMP packet and verify received packet
102 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
103 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
104 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node}
105 | | ... | src | ${tg_to_dut1_mac}
106 | | And Vpp Configures Classify Session L2
107 | | ... | ${dut1_node} | permit | ${table_index_1} | src | ${tg_to_dut1_mac}
108 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
109 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node}
110 | | ... | dst | ${tg_to_dut1_mac}
111 | | And Vpp Configures Classify Session L2
112 | | ... | ${dut1_node} | permit | ${table_index_2} | dst | ${tg_to_dut1_mac}
113 | | And Vpp Enable Input ACL Interface
114 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_1}
115 | | And Vpp Enable Input ACL Interface
116 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_2}
117 | | Then Send ICMP packet and verify received packet
118 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
119
120 | TC04: DUT with iACL EtherType accepts matching pkts
121 | | [Documentation]
122 | | ... | [Top] TG-DUT1-DUT2-TG.
123 | | ... | [Cfg] On DUT1 add EtherType IPv4(0x0800) to classify table with
124 | | ... | 'permit'.
125 | | ... | [Ver] Make TG verify matching packets are accepted.
126 | | Given Configure path in 3-node circular topology
127 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
128 | | And Set interfaces in 3-node circular topology up
129 | | And Configure L2XC
130 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
131 | | And Configure L2XC
132 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
133 | | Then Send ICMP packet and verify received packet
134 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
135 | | ${table_index} | ${skip_n} | ${match_n}=
136 | | ... | When Vpp Creates Classify Table Hex
137 | | ... | ${dut1_node} | 000000000000000000000000ffff
138 | | And Vpp Configures Classify Session Hex
139 | | ... | ${dut1_node} | permit | ${table_index} | 0000000000000000000000000800
140 | | And Vpp Enable Input ACL Interface
141 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
142 | | Then Send ICMP packet and verify received packet
143 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}