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