d9b6aaaa9ca88bd12f1e2690ad5cc0e932671f3c
[csit.git] / tests / func / honeycomb / mgmt-cfg-policer-apihc-func.robot
1 # Copyright (c) 2017 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 | ${interface}= | ${node['interfaces']['port1']['name']}
16 | ${tg_to_dut_if1_ip}= | 192.168.122.1
17 | ${dut_to_tg_if1_ip}= | 192.168.122.2
18 | ${dut_to_tg_if2_ip}= | 192.168.123.1
19 | ${tg_to_dut_if2_ip}= | 192.168.123.2
20 | ${prefix_length}= | ${24}
21 | ${dscp_number}= | ${20}
22
23 *** Settings ***
24 | Resource | resources/libraries/robot/default.robot
25 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
26 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
27 | Resource | resources/libraries/robot/honeycomb/policer.robot
28 | Resource | resources/libraries/robot/honeycomb/access_control_lists.robot
29 | Resource | resources/libraries/robot/testing_path.robot
30 | Library | resources.libraries.python.Trace
31 | Variables | resources/test_data/honeycomb/policer_variables.py
32 | Suite Teardown
33 | ... | Run Keyword If Any Tests Failed
34 | ... | Restart Honeycomb and VPP | ${node}
35 | Force Tags | HC_FUNC
36 | Documentation | *Honeycomb Policer management test suite.*
37
38 *** Test Cases ***
39 | TC01: Honeycomb can configure Policer
40 | | [Documentation] | Checks if Honeycomb can configure Policer.
41 | | Given Policer Operational Data From Honeycomb Should Be empty | ${node}
42 | | When Honeycomb configures Policer | ${node} | ${policer_data}
43 | | Then Policer Operational Data From Honeycomb Should Be | ${node}
44 | | ... | ${policer_data_oper}
45
46 | TC02: Honeycomb can disable Policer
47 | | [Documentation] | Checks if Honeycomb can disable Policer.
48 | | Given Policer Operational Data From Honeycomb Should Be | ${node}
49 | | ... | ${policer_data_oper}
50 | | When Honeycomb removes Policer configuration | ${node}
51 | | Then Policer Operational Data From Honeycomb Should Be empty | ${node}
52
53 | TC03: Honeycomb can configure Policer with increased values of CIR (900kbps)
54 | | [Documentation] | Checks if Honeycomb can configure Policer\
55 | | ... | with increased values of CIR.
56 | | [Teardown] | Tear down policer test | ${node}
57 | | Given Policer Operational Data From Honeycomb Should Be empty | ${node}
58 | | When Honeycomb configures Policer | ${node} | ${policer_data_2}
59 | | Then Policer Operational Data From Honeycomb Should Be | ${node}
60 | | ... | ${policer_data_oper_2}
61
62 | TC04: Honeycomb can configure Packets-Per-Second Based Policer
63 | | [Documentation] | Checks if Honeycomb can configure Policer\
64 | | ... | based on rate-type measured in pps.
65 | | [Teardown] | Tear down policer test | ${node}
66 | | Given Policer Operational Data From Honeycomb Should Be empty | ${node}
67 | | When Honeycomb configures Policer | ${node} | ${policer_data_3}
68 | | Then Policer Operational Data From Honeycomb Should Be | ${node}
69 | | ... | ${policer_data_oper_3}
70
71 | TC05: Configure Policer on Interface
72 | | [Documentation] | Honeycomb can configure Policer\
73 | | ... | on a given interface.
74 | | [Teardown] | Run Keywords
75 | | ... | Honeycomb disables Policer on interface | ${node} | ${interface} | AND
76 | | ... | Honeycomb removes ACL session
77 | | ... | ${node} | ${acl_tables['hc_acl_table']['name']}
78 | | ... | ${acl_tables['hc_acl_session']['match']} | AND
79 | | ... | Honeycomb removes ACL table | ${node}
80 | | ... | ${acl_tables['hc_acl_table']['name']} | AND
81 | | ... | Tear down policer test | ${node}
82 | | Given Honeycomb configures Policer | ${node} | ${policer_data}
83 | | And ACL table from Honeycomb should not exist
84 | | ... | ${node} | ${acl_tables['hc_acl_table']['name']}
85 | | When Honeycomb creates ACL table
86 | | ... | ${node} | ${acl_tables['hc_acl_table']}
87 | | And Honeycomb adds ACL session
88 | | ... | ${node} | ${acl_tables['hc_acl_table']['name']}
89 | | ... | ${acl_tables['hc_acl_session']}
90 | | Then Honeycomb enables policer on interface
91 | | ... | ${node} | ${interface} | ${acl_tables['hc_acl_table']['name']}
92
93 | TC06: VPP policer 2R3C Color-aware marks packet
94 | | [Documentation]
95 | | ... | [Top] TG=DUT1.
96 | | ... | [Ref] RFC2474, RFC2698.
97 | | ... | [Cfg] Configure 2R3C color-aware policer on DUT1 on the first\
98 | | ... | interface.
99 | | ... | [Ver] TG sends IPv4 TCP packet on the first link to DUT1.\
100 | | ... | Packet on DUT1 is marked with DSCP tag. Verifies if DUT1 sends\
101 | | ... | correct IPv4 TCP packet with correct DSCP on the second link to TG.
102 | | [Teardown] | Show Packet Trace on All DUTs | ${nodes}
103 | | Given Configure path in 2-node circular topology
104 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
105 | | And Honeycomb configures Policer | ${dut_node} | ${policer_data_3}
106 | | And ACL table from Honeycomb should not exist
107 | | ... | ${dut_node} | ${acl_tables['hc_acl_table']['name']}
108 | | When Honeycomb creates ACL table
109 | | ... | ${dut_node} | ${acl_tables['hc_acl_table']}
110 | | And Honeycomb adds ACL session
111 | | ... | ${dut_node} | ${acl_tables['hc_acl_table']['name']}
112 | | ... | ${acl_tables['hc_acl_session']}
113 | | And Honeycomb enables policer on interface
114 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_tables['hc_acl_table']['name']}
115 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
116 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
117 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
118 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
119 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
120 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
121 | | And Honeycomb adds interface IPv4 neighbor
122 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_to_dut_if2_ip}
123 | | ... | ${tg_to_dut_if2_mac}
124 | | And interfaceCLI.VPP Node Interfaces Ready Wait | ${dut_node}
125 | | Then Honeycomb Send packet and verify marking | ${tg_node}
126 | | ... | ${tg_to_dut_if1}
127 | | ... | ${tg_to_dut_if2} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
128 | | ... | ${tg_to_dut_if1_ip} | ${tg_to_dut_if2_ip} | ${dscp_number}