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