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