4dad038fdee0074d8cf21d1a6fe588534a8be792
[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 | Restart Honeycomb and VPP | ${node}
24 | Documentation | *Honeycomb access control lists test suite.*
25 | Force Tags | honeycomb_sanity | honeycomb_odl
26
27 *** Test Cases ***
28 | TC01: Honeycomb can create ACL classify table
29 | | [Documentation] | Check if Honeycomb API can create an ACL table.
30 | | Given ACL table from Honeycomb should not exist
31 | | ... | ${node} | ${hc_acl_table['name']}
32 | | And ACL table from VAT should not exist
33 | | ... | ${node} | ${table_index}
34 | | When Honeycomb creates ACL table
35 | | ... | ${node} | ${hc_acl_table}
36 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
37 | | And ACL table from VAT should be
38 | | ... | ${node} | ${table_index} | ${vat_acl_table}
39
40 | TC02: Honeycomb can remove ACL table
41 | | [Documentation] | Check if Honeycomb API can delete an ACL table.
42 | | Given 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 | | When Honeycomb removes ACL table | ${node} | ${hc_acl_table['name']}
46 | | Then ACL table from Honeycomb should not exist
47 | | ... | ${node} | ${hc_acl_table['name']}
48 | | And ACL table from VAT should not exist
49 | | ... | ${node} | ${table_index}
50
51 | TC03: Honeycomb manages more than one ACL table
52 | | [Documentation] | Check if Honeycomb API can create another ACL table.
53 | | Given 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 | | When Honeycomb creates ACL table | ${node} | ${hc_acl_table}
58 | | And Honeycomb creates ACL table | ${node} | ${hc_acl_table2}
59 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
60 | | And ACL table from VAT should be
61 | | ... | ${node} | ${table_index} | ${vat_acl_table}
62 | | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2_oper}
63 | | And ACL table from VAT should be
64 | | ... | ${node} | ${table_index2} | ${vat_acl_table2}
65
66 | TC04: Honeycomb can add ACL session to table
67 | | [Documentation] | Check if Honeycomb API can add an ACL session to a table.
68 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
69 | | And ACL table from VAT should be
70 | | ... | ${node} | ${table_index} | ${vat_acl_table}
71 | | When Honeycomb adds ACL session
72 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
73 | | Then ACL session from Honeycomb should be
74 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
75 | | And ACL session from VAT should be
76 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
77
78 | TC05: Honeycomb can remove ACL session
79 | | [Documentation] | Check if Honeycomb API can remove an ACL session.
80 | | Given 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 | | When Honeycomb removes ACL session
85 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session['match']}
86 | | Then ACL session from Honeycomb should not exist
87 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session['match']}
88 | | And ACL session from VAT should not exist
89 | | ... | ${node} | ${table_index} | ${session_index}
90
91 | TC06: Honeycomb manages more than one ACL session on one table
92 | | [Documentation] | Check if Honeycomb API can add another ACL session\
93 | | ... | to a table.
94 | | Given 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 | | When Honeycomb adds ACL session
99 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
100 | | And Honeycomb adds ACL session
101 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2}
102 | | Then ACL session from Honeycomb should be
103 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
104 | | And ACL session from VAT should be
105 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
106 | | And ACL session from Honeycomb should be
107 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2}
108 | | And ACL session from VAT should be
109 | | ... | ${node} | ${table_index} | ${session_index2} | ${vat_acl_session2}
110
111 | TC07: Honeycomb enables ACL on interface
112 | | [Documentation] | Check if Honeycomb API can enable ACL on an interface.
113 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
114 | | And ACL table from VAT should be
115 | | ... | ${node} | ${table_index} | ${vat_acl_table}
116 | | And ACL session from Honeycomb should be
117 | | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session}
118 | | And ACL session from VAT should be
119 | | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session}
120 | | When Honeycomb enables ACL on interface
121 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
122 | | Then Interface ACL settings from Honeycomb should be
123 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
124 | | And Interface ACL settings from VAT should be
125 | | ... | ${node} | ${interface} | ${table_index}
126
127 | TC08: Honeycomb disables ACL on interface
128 | | [Documentation] | Check if Honeycomb API can disable ACL on an interface.
129 | | Given Interface ACL settings from Honeycomb should be
130 | | ... | ${node} | ${interface} | ${hc_acl_table['name']}
131 | | And Interface ACL settings from VAT should be
132 | | ... | ${node} | ${interface} | ${table_index}
133 | | When Honeycomb disables ACL on interface | ${node} | ${interface}
134 | | Then Interface ACL settings from Honeycomb should be empty
135 | | ... | ${node} | ${interface}
136 | | And Interface ACL settings from VAT should be empty
137 | | ... | ${node} | ${interface}
138
139 | TC09: Honeycomb can remove one out of multiple ACL tables
140 | | [Documentation] | Check if Honeycomb API can delete an ACL table if more\
141 | | ... | than one table exists.
142 | | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
143 | | And ACL table from VAT should be
144 | | ... | ${node} | ${table_index} | ${vat_acl_table}
145 | | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2_oper}
146 | | And ACL table from VAT should be
147 | | ... | ${node} | ${table_index2} | ${vat_acl_table2}
148 | | When Honeycomb removes ACL table | ${node} | ${hc_acl_table2['name']}
149 | | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table_oper}
150 | | And ACL table from VAT should be
151 | | ... | ${node} | ${table_index} | ${vat_acl_table}
152 | | And ACL table from Honeycomb should not exist
153 | | ... | ${node} | ${hc_acl_table2['name']}
154 | | And ACL table from VAT should not exist
155 | | ... | ${node} | ${table_index2}