CSIT-427: Honeycomb ietf-ACL tests - L2
[csit.git] / tests / func / honeycomb / 081_ietf_acl_traffic.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 *** Variables ***
15 | &{if_settings}= | enabled=True
16 # Bridge domain settings
17 | ${bd_name}= | bd1
18 | &{bd_settings}= | flood=${True} | forward=${True} | learn=${True}
19 | ... | unknown-unicast-flood=${True} | arp-termination=${False}
20 | &{bd_if_settings}= | split_horizon_group=${0} | bvi=${False}
21 # Names for AC lists
22 | ${acl_name_l2}= | acl_l2
23
24 *** Settings ***
25 | Resource | resources/libraries/robot/default.robot
26 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
27 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
28 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
29 | Resource | resources/libraries/robot/honeycomb/access_control_lists.robot
30 | Resource | resources/libraries/robot/testing_path.robot
31 | Resource | resources/libraries/robot/traffic.robot
32 | Library | resources.libraries.python.honeycomb.HcAPIKwACL.ACLKeywords
33 | Library | resources.libraries.python.Trace
34 | Suite Teardown | Run Keyword If Any Tests Failed
35 | ... | Restart Honeycomb And VPP And Clear Persisted Configuration | ${node}
36 | Documentation | *Honeycomb access control lists test suite for IETF-ACL node.*
37 | Force Tags | Honeycomb_sanity
38
39 *** Test Cases ***
40 | TC01: Honeycomb can configure L2 ACL MAC filtering through IETF-ACL node
41 | | [Documentation]
42 | | ... | [Top] TG=DUT1=TG.
43 | | ... | [Enc] Eth-IPv4-TCP.
44 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
45 | | ... | and configure L2 MAC ACL on ingress interface.
46 | | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
47 | | ... | using different MACs. Receive all packets except those with\
48 | | ... | MACs in the filtered ranges.
49 | | [Teardown] | Run Keywords
50 | | ... | Clear IETF-ACL settings | ${node} | ${dut_to_tg_if1} | AND
51 | | ... | Show Packet Trace on All DUTs | ${nodes} | AND
52 | | ... | Honeycomb removes all bridge domains
53 | | ... | ${node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
54 | | Given Path For 2-node Testing Is Set
55 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
56 | | And Import Variables | resources/test_data/honeycomb/ietf_acl.py
57 | | ... | L2 | ${acl_name_l2}
58 | | And Honeycomb Sets Interface State | ${dut_node} | ${dut_to_tg_if1} | up
59 | | And Honeycomb Sets Interface State | ${dut_node} | ${dut_to_tg_if2} | up
60 | | And Honeycomb Creates L2 Bridge Domain
61 | | ... | ${dut_node} | ${bd_name} | ${bd_settings}
62 | | And Honeycomb Adds Interfaces To Bridge Domain
63 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
64 | | ... | ${bd_name} | ${bd_if_settings}
65 | | When Honeycomb creates ACL chain through IETF node
66 | | ... | ${dut_node} | ${acl_name_l2} | L2 | ${acl_settings}
67 | | And Honeycomb assigns IETF-ACL chain to interface
68 | | ... | ${dut_node} | ${dut_to_tg_if1} | L2 | ingress | ${acl_name_l2}
69 | | ... | permit
70 | | Then Send TCP or UDP packet | ${tg_node} | ${src_ip} | ${dst_ip}
71 | | ... | ${tg_to_dut_if1} | ${src_mac}
72 | | ... | ${tg_to_dut_if2} | ${dst_mac}
73 | | ... | TCP | ${src_port} | ${dst_port}
74 | | And Run keyword and expect error | TCP/UDP Rx timeout
75 | | ... | Send TCP or UDP packet | ${tg_node} | ${src_ip} | ${dst_ip}
76 | | ... | ${tg_to_dut_if1} | ${classify_src}
77 | | ... | ${tg_to_dut_if2} | ${classify_dst}
78 | | ... | TCP | ${src_port} | ${dst_port}
79 | | And Run keyword and expect error | TCP/UDP Rx timeout
80 | | ... | Send TCP or UDP packet | ${tg_node} | ${src_ip} | ${dst_ip}
81 | | ... | ${tg_to_dut_if1} | ${classify_src2}
82 | | ... | ${tg_to_dut_if2} | ${classify_dst2}
83 | | ... | TCP | ${src_port} | ${dst_port}