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