CSIT-220: Rename directories in tests directory
[csit.git] / tests / func / iacl / l2_iacl_untagged.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/default.robot
16 | Resource | resources/libraries/robot/counters.robot
17 | Resource | resources/libraries/robot/interfaces.robot
18 | Resource | resources/libraries/robot/testing_path.robot
19 | Resource | resources/libraries/robot/l2_xconnect.robot
20 | Resource | resources/libraries/robot/l2_traffic.robot
21 | Library | resources.libraries.python.Classify.Classify
22 | Library | resources.libraries.python.Trace
23
24 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
25 | ...        | 3_NODE_DOUBLE_LINK_TOPO
26 | Suite Setup | Run Keywords | Setup all TGs before traffic script
27 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
28 | Test Setup | Setup all DUTs before test
29 | Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes}
30 | ...           | AND          | Vpp Show Errors | ${nodes['DUT1']}
31 | ...           | AND          | Show vpp trace dump on all DUTs
32 | Documentation | *Ingress ACL test cases*
33 | ...
34 | ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG
35 | ... |        with one link between the nodes.
36 | ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect.
37 | ... |        DUT1 is configured with iACL classification on link to TG,
38 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent
39 | ... |        in one direction by TG on link to DUT1 and received on TG link
40 | ... |        to DUT2. On receive TG verifies if packets are dropped.
41
42 *** Variables ***
43 | ${l2_table}= | l2
44
45 *** Test Cases ***
46 | TC01: DUT with iACL MAC src-addr drops matching pkts
47 | | [Documentation]
48 | | ... | [Top] TG-DUT1-DUT2-TG.
49 | | ... | [Cfg] On DUT1 add source MAC address to classify table with 'deny'.
50 | | ... | [Ver] Make TG verify matching packets are dropped.
51 | | Given Path for 3-node testing is set
52 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
53 | | And Interfaces in 3-node path are up
54 | | And L2 setup xconnect on DUT
55 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
56 | | And L2 setup xconnect on DUT
57 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
58 | | Then Send and receive ICMP Packet
59 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
60 | | ${table_index} | ${skip_n} | ${match_n}=
61 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src
62 | | And Vpp Configures Classify Session L2
63 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
64 | | ... | src | ${tg_to_dut1_mac}
65 | | And Vpp Enable Input ACL Interface
66 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
67 | | Then Send and receive ICMP Packet should fail
68 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
69
70 | TC02: DUT with iACL MAC dst-addr drops matching pkts
71 | | [Documentation]
72 | | ... | [Top] TG-DUT1-DUT2-TG.
73 | | ... | [Cfg] On DUT1 add destination MAC address to classify
74 | | ... |       table with 'deny'.
75 | | ... | [Ver] Make TG verify matching packets are dropped.
76 | | Given Path for 3-node testing is set
77 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
78 | | And Interfaces in 3-node path are up
79 | | And L2 setup xconnect on DUT
80 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
81 | | And L2 setup xconnect on DUT
82 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
83 | | Then Send and receive ICMP Packet
84 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
85 | | ${table_index} | ${skip_n} | ${match_n}=
86 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst
87 | | And Vpp Configures Classify Session L2
88 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
89 | | ... | dst | ${tg_to_dut2_mac}
90 | | And Vpp Enable Input ACL Interface
91 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
92 | | Then Send and receive ICMP Packet should fail
93 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
94
95 | TC03: DUT with iACL MAC src-addr and dst-addr drops matching pkts
96 | | [Documentation]
97 | | ... | [Top] TG-DUT1-DUT2-TG.
98 | | ... | [Cfg] On DUT1 add source and destination MAC address to classify
99 | | ... |       table with 'deny'.
100 | | ... | [Ver] Make TG verify matching packets are dropped.
101 | | Given Path for 3-node testing is set
102 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
103 | | And Interfaces in 3-node path are up
104 | | And L2 setup xconnect on DUT
105 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
106 | | And L2 setup xconnect on DUT
107 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
108 | | Then Send and receive ICMP Packet
109 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
110 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
111 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src
112 | | And Vpp Configures Classify Session L2
113 | | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_1}
114 | | ... | src | ${tg_to_dut1_mac}
115 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
116 | | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst
117 | | And Vpp Configures Classify Session L2
118 | | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2}
119 | | ... | dst | ${tg_to_dut1_mac}
120 | | And Vpp Enable Input ACL Interface
121 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_1}
122 | | And Vpp Enable Input ACL Interface
123 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_2}
124 | | Then Send and receive ICMP Packet should fail
125 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
126
127 | TC04: DUT with iACL EtherType drops matching pkts
128 | | [Documentation]
129 | | ... | [Top] TG-DUT1-DUT2-TG.
130 | | ... | [Cfg] On DUT1 add EtherType IPv4(0x0800) to classify table with 'deny'.
131 | | ... | [Ver] Make TG verify matching packets are dropped.
132 | | Given Path for 3-node testing is set
133 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
134 | | And Interfaces in 3-node path are up
135 | | And L2 setup xconnect on DUT
136 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg}
137 | | And L2 setup xconnect on DUT
138 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
139 | | Then Send and receive ICMP Packet
140 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
141 | | ${table_index} | ${skip_n} | ${match_n}=
142 | | ... | When Vpp Creates Classify Table Hex
143 | | ... | ${dut1_node} | 000000000000000000000000ffff
144 | | And Vpp Configures Classify Session Hex
145 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
146 | | ... | 0000000000000000000000000800
147 | | And Vpp Enable Input ACL Interface
148 | | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index}
149 | | Then Send and receive ICMP Packet should fail
150 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}