b18b111981523add037fa251a7dfb54c2062519c
[csit.git] / tests / func / honeycomb / mgmt-cfg-acl-apihc-apivat-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 to run tests on.
16 | ${interface}= | ${node['interfaces']['port1']['name']}
17
18 *** Settings ***
19 | Resource | resources/libraries/robot/default.robot
20 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
21 | Resource | resources/libraries/robot/honeycomb/access_control_lists.robot
22 | Variables | resources/test_data/honeycomb/acl.py
23 | ...
24 | Suite Teardown | Restart Honeycomb and VPP | ${node}
25 | ...
26 | Documentation | *Honeycomb access control lists test suite.*
27 | ...
28 | Force Tags | HC_FUNC
29
30 *** Test Cases ***
31 | TC01: Honeycomb can create ACL classify table
32 | | [Documentation] | Check if Honeycomb API can create an ACL table.
33 | | ...
34 | | Given ACL table from Honeycomb should not exist
35 | | ... | ${node} | ${hc_acl_table['name']}
36 | | And ACL table from VAT should not exist
37 | | ... | ${node} | ${table_index}
38 | | When Honeycomb creates ACL table
39 | | ... | ${node} | ${hc_acl_table}
40 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
41 | | And ACL table from VAT should be
42 | | ... | ${node} | ${table_index} | ${vat_acl_table}
43
44 | TC02: Honeycomb can remove ACL table
45 | | [Documentation] | Check if Honeycomb API can delete an ACL table.
46 | | ...
47 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
48 | | And ACL table from VAT should be
49 | | ... | ${node} | ${table_index} | ${vat_acl_table}
50 | | When Honeycomb removes ACL table | ${node} | ${hc_acl_table['name']}
51 | | Then ACL table from Honeycomb should not exist
52 | | ... | ${node} | ${hc_acl_table['name']}
53 | | And ACL table from VAT should not exist
54 | | ... | ${node} | ${table_index}
55
56 | TC03: Honeycomb manages more than one ACL table
57 | | [Documentation] | Check if Honeycomb API can create another ACL table.
58 | | ...
59 | | Given ACL table from Honeycomb should not exist
60 | | ... | ${node} | ${hc_acl_table['name']}
61 | | And ACL table from VAT should not exist
62 | | ... | ${node} | ${table_index}
63 | | When Honeycomb creates ACL table | ${node} | ${hc_acl_table}
64 | | And Honeycomb creates ACL table | ${node} | ${hc_acl_table2}
65 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
66 | | And ACL table from VAT should be
67 | | ... | ${node} | ${table_index} | ${vat_acl_table}
68 | | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2_oper}
69 | | And ACL table from VAT should be
70 | | ... | ${node} | ${table_index2} | ${vat_acl_table2}
71
72 | TC04: Honeycomb can add ACL session to table
73 | | [Documentation] | Check if Honeycomb API can add an ACL session to a table.
74 | | ...
75 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
76 | | And ACL table from VAT should be
77 | | ... | ${node} | ${table_index} | ${vat_acl_table}
78 | | When Honeycomb adds ACL session
79 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
80 | | Then ACL session from Honeycomb should be
81 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
82 | | And ACL session from VAT should be
83 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
84
85 | TC05: Honeycomb can remove ACL session
86 | | [Documentation] | Check if Honeycomb API can remove an ACL session.
87 | | ...
88 | | Given ACL session from Honeycomb should be
89 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
90 | | And ACL session from VAT should be
91 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
92 | | When Honeycomb removes ACL session
93 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session['match']}
94 | | Then ACL session from Honeycomb should not exist
95 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session['match']}
96 | | And ACL session from VAT should not exist
97 | | ... | ${node} | ${table_index} | ${session_index}
98
99 | TC06: Honeycomb manages more than one ACL session on one table
100 | | [Documentation] | Check if Honeycomb API can add another ACL session\
101 | | ... | to a table.
102 | | ...
103 | | Given ACL session from Honeycomb should not exist
104 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session['match']}
105 | | And ACL session from VAT should not exist
106 | | ... | ${node} | ${table_index} | ${session_index}
107 | | When Honeycomb adds ACL session
108 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
109 | | And Honeycomb adds ACL session
110 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2}
111 | | Then ACL session from Honeycomb should be
112 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
113 | | And ACL session from VAT should be
114 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
115 | | And ACL session from Honeycomb should be
116 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2}
117 | | And ACL session from VAT should be
118 | | ... | ${node} | ${table_index} | ${session_index2} | ${vat_acl_session2}
119
120 | TC07: Honeycomb enables ACL on interface
121 | | [Documentation] | Check if Honeycomb API can enable ACL on an interface.
122 | | ...
123 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
124 | | And ACL table from VAT should be
125 | | ... | ${node} | ${table_index} | ${vat_acl_table}
126 | | And ACL session from Honeycomb should be
127 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
128 | | And ACL session from VAT should be
129 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
130 | | When Honeycomb enables ACL on interface
131 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
132 | | Then Interface ACL configuration from Honeycomb should be
133 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
134 | | And Interface ACL configuration from VAT should be
135 | | ... | ${node} | ${interface} | ${table_index}
136
137 | TC08: Honeycomb disables ACL on interface
138 | | [Documentation] | Check if Honeycomb API can disable ACL on an interface.
139 | | ...
140 | | Given Interface ACL configuration from Honeycomb should be
141 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
142 | | And Interface ACL configuration from VAT should be
143 | | ... | ${node} | ${interface} | ${table_index}
144 | | When Honeycomb disables ACL on interface | ${node} | ${interface}
145 | | Then Interface ACL configuration from Honeycomb should be empty
146 | | ... | ${node} | ${interface}
147 | | And Interface ACL configuration from VAT should be empty
148 | | ... | ${node} | ${interface}
149
150 | TC09: Honeycomb can remove one out of multiple ACL tables
151 | | [Documentation] | Check if Honeycomb API can delete an ACL table if more\
152 | | ... | than one table exists.
153 | | ...
154 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
155 | | And ACL table from VAT should be
156 | | ... | ${node} | ${table_index} | ${vat_acl_table}
157 | | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2_oper}
158 | | And ACL table from VAT should be
159 | | ... | ${node} | ${table_index2} | ${vat_acl_table2}
160 | | When Honeycomb removes ACL table | ${node} | ${hc_acl_table2['name']}
161 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
162 | | And ACL table from VAT should be
163 | | ... | ${node} | ${table_index} | ${vat_acl_table}
164 | | And ACL table from Honeycomb should not exist
165 | | ... | ${node} | ${hc_acl_table2['name']}
166 | | And ACL table from VAT should not exist
167 | | ... | ${node} | ${table_index2}