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