Update Honeycomb persistence tests with new Vlan
[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 | tests/suites/honeycomb/resources/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
113 | Honeycomb and VPP should verify every setting
114 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
115 | | ... | bridge domains, TAP, vhost-user and VLAN.
116 | | ...
117 | | ... | *Arguments:*
118 | | ... | - node - information about a DUT node. Type: dictionary
119 | | ... | - interface - name of an interface on the specified node. Type: string
120 | | ...
121 | | ... | *Example:*
122 | | ...
123 | | ... | \| Honeycomb and VPP should verify every setting \| ${nodes['DUT1']} \
124 | | ... | \| GigabitEthernet0/8/0 \|
125 | | [Arguments] | ${node} | ${interface}
126 | | VxLAN configuration from Honeycomb should be
127 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
128 | | VxLAN configuration from VAT should be
129 | | ... | ${node} | ${vxlan_settings}
130 | | Bridge domain configuration from Honeycomb should be
131 | | ... | ${node} | ${bd_name} | ${bd_settings}
132 | | Bridge domain configuration from VAT should be
133 | | ... | ${node} | ${0} | ${bd_settings}
134 | | TAP configuration from Honeycomb should be
135 | | ... | ${node} | ${tap_interface} | ${tap_settings}
136 | | TAP configuration from VAT should be
137 | | ... | ${node} | ${tap_interface} | ${tap_settings}
138 | | Vhost-user configuration from Honeycomb should be
139 | | ... | ${node} | ${vhost_interface} | ${vhost_user_server}
140 | | Vhost-user configuration from VAT should be
141 | | ... | ${node} | ${vhost_user_server}
142 | | Sub-interface configuration from Honeycomb should be
143 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper}
144 | | Sub-interface configuration from VAT should be
145 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
146 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
147 | | Interface state from VAT should be | ${node} | ${interface} | up
148 | | Sub-interface bridge domain configuration from Honeycomb should be
149 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
150 | | Sub-interface bridge domain configuration from VAT should be
151 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
152
153 | Honeycomb and VPP should have default configuration
154 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
155 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects default\
156 | | ... | configuration.
157 | | ...
158 | | ... | *Arguments:*
159 | | ... | - node - information about a DUT node. Type: dictionary
160 | | ...
161 | | ... | *Example:*
162 | | ...
163 | | ... | \| Honeycomb and VPP should have default configuration \|
164 | | ... | ${nodes['DUT1']} \|
165 | | [Arguments] | ${node}
166 | | VxLAN configuration from Honeycomb should be empty
167 | | ... | ${node} | ${vx_interface}
168 | | VxLAN configuration from VAT should be empty | ${node}
169 | | Honeycomb should show no bridge domains | ${node}
170 | | VAT should show no bridge domains | ${node}
171 | | TAP configuration from Honeycomb should be empty
172 | | ... | ${node} | ${tap_interface}
173 | | TAP configuration from VAT should be empty
174 | | ... | ${node} | ${tap_interface}
175 | | Vhost-user configuration from Honeycomb should be empty
176 | | ... | ${node} | ${vhost_interface}
177 | | Vhost-user configuration from VAT should be empty
178 | | ... | ${node}
179 | | interface state from Honeycomb should be
180 | | ... | ${node} | ${interface} | down
181 | | And interface state from VAT should be
182 | | ... | ${node} | ${interface} | down
183
184 | Honeycomb and VPP should not have default configuration
185 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
186 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects any\
187 | | ... | configuration other than default.
188 | | ...
189 | | ... | *Arguments:*
190 | | ... | - node - information about a DUT node. Type: dictionary
191 | | ...
192 | | ... | *Example:*
193 | | ...
194 | | ... | \| Honeycomb and VPP should not have default configuration \
195 | | ... | \| ${nodes['DUT1']} \|
196 | | [Arguments] | ${node}
197 | | Run keyword and expect error | *
198 | | ... | Honeycomb and VPP should have default configuration | ${node}
199
200
201 | Honeycomb should show no rogue interfaces
202 | | [Documentation] | Checks if operational data contains interfaces not\
203 | | ... | present in configuration and vice versa.
204 | | ...
205 | | ... | *Arguments:*
206 | | ... | - node - information about a DUT node. Type: dictionary
207 | | ...
208 | | ... | *Example:*
209 | | ...
210 | | ... | \| Honeycomb should show no rogue interfaces \| ${nodes['DUT1']} \|
211 | | [Arguments] | ${node}
212 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
213 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
214 | | Compare interface lists | ${data_conf} | ${data_oper}
215
216 | Persistence file is damaged during restart
217 | | [Documentation] | Shuts down Honeycomb, modifies persistence files to\
218 | | ... | simulate damage, then restarts VPP and starts up Honeycomb again.
219 | | ...
220 | | ... | *Arguments:*
221 | | ... | - node - information about a DUT node. Type: dictionary
222 | | ...
223 | | ... | *Example:*
224 | | ...
225 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
226 | | [Arguments] | ${node}
227 | | Stop Honeycomb service on DUTs | ${node}
228 | | Modify persistence files | ${node} | { | abc
229 | | Setup DUT | ${node}
230 | | Setup Honeycomb service on DUTs | ${node}