CSIT-219: Realocate resources for Honeycomb tests
[csit.git] / resources / libraries / robot / honeycomb / persistence.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 *** Settings ***
15 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
16 | ...     | WITH NAME | InterfaceAPI
17 | Library | resources.libraries.python.honeycomb.HcPersistence
18 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
19 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
20 | Resource | resources/libraries/robot/honeycomb/vxlan.robot
21 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
22 | Resource | resources/libraries/robot/honeycomb/tap.robot
23 | Resource | resources/libraries/robot/honeycomb/vhost_user.robot
24 | Resource | resources/libraries/robot/honeycomb/sub_interface.robot
25 | Variables | resources/test_data/honeycomb/persistence.py | ${interface}
26 | Documentation | Keywords used to test Honeycomb persistence.
27
28 *** Keywords ***
29 | Honeycomb is restarted
30 | | [Documentation] | Restarts Honeycomb without clearing persistence data.
31 | | ...
32 | | ... | *Arguments:*
33 | | ... | - node - information about a DUT node. Type: dictionary
34 | | ...
35 | | ... | *Example:*
36 | | ...
37 | | ... | \| Honeycomb is restarted \| ${nodes['DUT1']} \|
38 | | [Arguments] | ${node}
39 | | Stop Honeycomb service on DUTs | ${node}
40 | | Setup Honeycomb service on DUTs | ${node}
41
42 | VPP is restarted
43 | | [Documentation] | Restarts VPP and waits until it reconnects with Honeycomb.
44 | | ...
45 | | ... | *Arguments:*
46 | | ... | - node - information about a DUT node. Type: dictionary
47 | | ...
48 | | ... | *Example:*
49 | | ...
50 | | ... | \| VPP is restarted \| ${nodes['DUT1']} \|
51 | | [Arguments] | ${node}
52 | | Setup DUT | ${node}
53 | | Check VPP connection | ${node}
54
55 | Check VPP connection
56 | | [Documentation] | Checks if Honeycomb is connected to VPP by reading VPP\
57 | | ... | version number from Honeycomb operational data.
58 | | ...
59 | | ... | *Arguments:*
60 | | ... | - node - information about a DUT node. Type: dictionary
61 | | ...
62 | | ... | *Example:*
63 | | ...
64 | | ... | \| Check VPP connection \| ${nodes['DUT1']} \|
65 | | [Arguments] | ${node}
66 | | Wait until keyword succeeds | 2min | 20sec
67 | | ... | Check Honeycomb startup state | ${node}
68
69 | Honeycomb and VPP are restarted
70 | | [Documentation] | Stops Honeycomb, restarts VPP and then starts Honeycomb\
71 | | ... | again.
72 | | ...
73 | | ... | *Arguments:*
74 | | ... | - node - information about a DUT node. Type: dictionary
75 | | ...
76 | | ... | *Example:*
77 | | ...
78 | | ... | \| Honeycomb and VPP are restarted \| ${nodes['DUT1']} \|
79 | | [Arguments] | ${node}
80 | | Stop Honeycomb service on DUTs | ${node}
81 | | Setup DUT | ${node}
82 | | Setup Honeycomb service on DUTs | ${node}
83
84 | Honeycomb configures every setting
85 | | [Documentation] | Uses Honeycomb to set basic settings for VxLAN,\
86 | | ... | bridge domains, TAP, vhost-user and VLAN.
87 | | ...
88 | | ... | *Arguments:*
89 | | ... | - node - information about a DUT node. Type: dictionary
90 | | ... | - interface - name of an interface on the specified node. Type: string
91 | | ...
92 | | ... | *Example:*
93 | | ...
94 | | ... | \| Honeycomb configures every setting \| ${nodes['DUT1']} \
95 | | ... | \| GigabitEthernet0/8/0 \|
96 | | [Arguments] | ${node} | ${interface}
97 | | Honeycomb sets interface VxLAN configuration
98 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
99 | | Honeycomb creates first l2 bridge domain
100 | | ... | ${node} | ${bd_name} | ${bd_settings}
101 | | Honeycomb creates TAP interface
102 | | ... | ${node} | ${tap_interface} | ${tap_settings}
103 | | Honeycomb creates vhost-user interface
104 | | ... | ${node} | ${vhost_interface} | ${vhost_user_server}
105 | | Honeycomb creates sub-interface | ${node} | ${interface}
106 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
107 | | Honeycomb sets interface state | ${node} | ${interface} | up
108 | | Honeycomb sets the sub-interface up
109 | | ... | ${node} | ${interface} | ${sub_if_id}
110 | | Honeycomb adds sub-interface to bridge domain
111 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
112 | | Honeycomb configures tag rewrite
113 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1}
114
115 | Honeycomb and VPP should verify every setting
116 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
117 | | ... | bridge domains, TAP, vhost-user and VLAN.
118 | | ...
119 | | ... | *Arguments:*
120 | | ... | - node - information about a DUT node. Type: dictionary
121 | | ... | - interface - name of an interface on the specified node. Type: string
122 | | ...
123 | | ... | *Example:*
124 | | ...
125 | | ... | \| Honeycomb and VPP should verify every setting \| ${nodes['DUT1']} \
126 | | ... | \| GigabitEthernet0/8/0 \|
127 | | [Arguments] | ${node} | ${interface}
128 | | VxLAN configuration from Honeycomb should be
129 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
130 | | VxLAN configuration from VAT should be
131 | | ... | ${node} | ${vxlan_settings}
132 | | Bridge domain configuration from Honeycomb should be
133 | | ... | ${node} | ${bd_name} | ${bd_settings}
134 | | Bridge domain configuration from VAT should be
135 | | ... | ${node} | ${0} | ${bd_settings}
136 | | TAP configuration from Honeycomb should be
137 | | ... | ${node} | ${tap_interface} | ${tap_settings}
138 | | TAP configuration from VAT should be
139 | | ... | ${node} | ${tap_interface} | ${tap_settings}
140 | | Vhost-user configuration from Honeycomb should be
141 | | ... | ${node} | ${vhost_interface} | ${vhost_user_server}
142 | | Vhost-user configuration from VAT should be
143 | | ... | ${node} | ${vhost_user_server}
144 | | Sub-interface configuration from Honeycomb should be
145 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper}
146 | | Sub-interface configuration from VAT should be
147 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
148 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
149 | | Interface state from VAT should be | ${node} | ${interface} | up
150 | | Sub-interface bridge domain configuration from Honeycomb should be
151 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
152 | | Sub-interface bridge domain configuration from VAT should be
153 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
154 | | Rewrite tag from Honeycomb should be
155 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
156 | | Rewrite tag from VAT should be
157 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
158
159 | Honeycomb and VPP should have default configuration
160 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
161 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects default\
162 | | ... | configuration.
163 | | ...
164 | | ... | *Arguments:*
165 | | ... | - node - information about a DUT node. Type: dictionary
166 | | ...
167 | | ... | *Example:*
168 | | ...
169 | | ... | \| Honeycomb and VPP should have default configuration \|
170 | | ... | ${nodes['DUT1']} \|
171 | | [Arguments] | ${node}
172 | | VxLAN configuration from Honeycomb should be empty
173 | | ... | ${node} | ${vx_interface}
174 | | VxLAN configuration from VAT should be empty | ${node}
175 | | Honeycomb should show no bridge domains | ${node}
176 | | VAT should show no bridge domains | ${node}
177 | | TAP configuration from Honeycomb should be empty
178 | | ... | ${node} | ${tap_interface}
179 | | TAP configuration from VAT should be empty
180 | | ... | ${node} | ${tap_interface}
181 | | Vhost-user configuration from Honeycomb should be empty
182 | | ... | ${node} | ${vhost_interface}
183 | | Vhost-user configuration from VAT should be empty
184 | | ... | ${node}
185 | | interface state from Honeycomb should be
186 | | ... | ${node} | ${interface} | down
187 | | And interface state from VAT should be
188 | | ... | ${node} | ${interface} | down
189
190 | Honeycomb and VPP should not have default configuration
191 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
192 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects any\
193 | | ... | configuration other than default.
194 | | ...
195 | | ... | *Arguments:*
196 | | ... | - node - information about a DUT node. Type: dictionary
197 | | ...
198 | | ... | *Example:*
199 | | ...
200 | | ... | \| Honeycomb and VPP should not have default configuration \
201 | | ... | \| ${nodes['DUT1']} \|
202 | | [Arguments] | ${node}
203 | | Run keyword and expect error | *
204 | | ... | Honeycomb and VPP should have default configuration | ${node}
205
206
207 | Honeycomb should show no rogue interfaces
208 | | [Documentation] | Checks if operational data contains interfaces not\
209 | | ... | present in configuration and vice versa.
210 | | ...
211 | | ... | *Arguments:*
212 | | ... | - node - information about a DUT node. Type: dictionary
213 | | ...
214 | | ... | *Example:*
215 | | ...
216 | | ... | \| Honeycomb should show no rogue interfaces \| ${nodes['DUT1']} \|
217 | | [Arguments] | ${node}
218 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
219 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
220 | | Compare interface lists | ${data_conf} | ${data_oper}
221
222 | Persistence file is damaged during restart
223 | | [Documentation] | Shuts down Honeycomb, modifies persistence files to\
224 | | ... | simulate damage, then restarts VPP and starts up Honeycomb again.
225 | | ...
226 | | ... | *Arguments:*
227 | | ... | - node - information about a DUT node. Type: dictionary
228 | | ...
229 | | ... | *Example:*
230 | | ...
231 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
232 | | [Arguments] | ${node}
233 | | Stop Honeycomb service on DUTs | ${node}
234 | | Modify persistence files | ${node} | { | abc
235 | | Setup DUT | ${node}
236 | | Setup Honeycomb service on DUTs | ${node}