CSIT-687: Directory structure reorganization
[csit.git] / tests / vpp / func / l2xc / eth2p-eth-l2xcbase-iaclbase-func.robot
1 # Copyright (c) 2016 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 dropped.
35
36 *** Variables ***
37 | ${l2_table}= | l2
38
39 *** Test Cases ***
40 | TC01: DUT with iACL MAC src-addr drops matching pkts
41 | | [Documentation]
42 | | ... | [Top] TG-DUT1-DUT2-TG.
43 | | ... | [Cfg] On DUT1 add source MAC address to classify table with 'deny'.
44 | | ... | [Ver] Make TG verify matching packets are dropped.
45 | | Given Configure path in 3-node circular topology
46 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
47 | | And Set interfaces in 3-node circular topology up
48 | | And Configure L2XC
49 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
50 | | And Configure L2XC
51 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
52 | | Then Send ICMP packet and verify received packet
53 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
54 | | ${table_index} | ${skip_n} | ${match_n}=
55 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src
56 | | And Vpp Configures Classify Session L2
57 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
58 | | ... | src | ${tg_to_dut1_mac}
59 | | And Vpp Enable Input ACL Interface
60 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
61 | | Then ICMP packet transmission should fail
62 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
63
64 | TC02: DUT with iACL MAC dst-addr drops matching pkts
65 | | [Documentation]
66 | | ... | [Top] TG-DUT1-DUT2-TG.
67 | | ... | [Cfg] On DUT1 add destination MAC address to classify
68 | | ... |       table with 'deny'.
69 | | ... | [Ver] Make TG verify matching packets are dropped.
70 | | Given Configure path in 3-node circular topology
71 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
72 | | And Set interfaces in 3-node circular topology up
73 | | And Configure L2XC
74 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
75 | | And Configure L2XC
76 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
77 | | Then Send ICMP packet and verify received packet
78 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
79 | | ${table_index} | ${skip_n} | ${match_n}=
80 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst
81 | | And Vpp Configures Classify Session L2
82 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
83 | | ... | dst | ${tg_to_dut2_mac}
84 | | And Vpp Enable Input ACL Interface
85 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
86 | | Then ICMP packet transmission should fail
87 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
88
89 | TC03: DUT with iACL MAC src-addr and dst-addr drops matching pkts
90 | | [Documentation]
91 | | ... | [Top] TG-DUT1-DUT2-TG.
92 | | ... | [Cfg] On DUT1 add source and destination MAC address to classify
93 | | ... |       table with 'deny'.
94 | | ... | [Ver] Make TG verify matching packets are dropped.
95 | | Given Configure path in 3-node circular topology
96 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
97 | | And Set interfaces in 3-node circular topology up
98 | | And Configure L2XC
99 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
100 | | And Configure L2XC
101 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
102 | | Then Send ICMP packet and verify received packet
103 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
104 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
105 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src
106 | | And Vpp Configures Classify Session L2
107 | | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_1}
108 | | ... | src | ${tg_to_dut1_mac}
109 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
110 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst
111 | | And Vpp Configures Classify Session L2
112 | | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2}
113 | | ... | dst | ${tg_to_dut1_mac}
114 | | And Vpp Enable Input ACL Interface
115 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_1}
116 | | And Vpp Enable Input ACL Interface
117 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_2}
118 | | Then ICMP packet transmission should fail
119 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
120
121 | TC04: DUT with iACL EtherType drops matching pkts
122 | | [Documentation]
123 | | ... | [Top] TG-DUT1-DUT2-TG.
124 | | ... | [Cfg] On DUT1 add EtherType IPv4(0x0800) to classify table with 'deny'.
125 | | ... | [Ver] Make TG verify matching packets are dropped.
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} | deny | ${table_index} | ${skip_n} | ${match_n}
140 | | ... | 0000000000000000000000000800
141 | | And Vpp Enable Input ACL Interface
142 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
143 | | Then ICMP packet transmission should fail
144 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}