HC Test: address and cleanup test failures
[csit.git] / resources / test_data / honeycomb / netconf / triggers.py
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 """Contains RPC sequences to trigger specific issues through Netconf."""
15
16 # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-105
17 # Creating and removing interfaces may result in duplicated interface indices.
18 trigger_105 = u"""
19 <rpc message-id="m-1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
20 <get-config>
21 <source>
22 <running/>
23 </source>
24 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
25 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
26 <interface>
27 <name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
28 </interface>
29 </interfaces>
30 </filter>
31 </get-config>
32 </rpc>
33 ]]>]]>
34
35 <rpc message-id="m-2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
36 <lock>
37 <target>
38 <candidate/>
39 </target>
40 </lock>
41 </rpc>
42 ]]>]]>
43
44 <rpc message-id="m-3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
45 <edit-config>
46 <target>
47 <candidate/>
48 </target>
49 <default-operation>none</default-operation>
50 <config>
51 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
52 <interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
53 a:operation="replace">
54 <name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
55 <description>neutron port</description>
56 <link-up-down-trap-enable>enabled</link-up-down-trap-enable>
57 <vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
58 <role>client</role>
59 <socket>/tmp/socket_4fe335c8-6fdc-4654-b12c-d256e9b39229</socket>
60 </vhost-user>
61 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
62 <enabled>true</enabled>
63 </interface>
64 </interfaces>
65 </config>
66 </edit-config>
67 </rpc>
68 ]]>]]>
69
70 <rpc message-id="m-4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
71 <commit/>
72 </rpc>
73 ]]>]]>
74
75 <rpc message-id="m-5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
76 <unlock>
77 <target>
78 <candidate/>
79 </target>
80 </unlock>
81 </rpc>
82 ]]>]]>
83
84 <rpc message-id="m-6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
85 <lock>
86 <target>
87 <candidate/>
88 </target>
89 </lock>
90 </rpc>
91 ]]>]]>
92
93 <rpc message-id="m-7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
94 <edit-config>
95 <target>
96 <candidate/>
97 </target>
98 <default-operation>none</default-operation>
99 <config>
100 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
101 <interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
102 a:operation="delete">
103 <name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
104 </interface>
105 </interfaces>
106 </config>
107 </edit-config>
108 </rpc>
109 ]]>]]>
110
111 <rpc message-id="m-8" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
112 <commit/>
113 </rpc>
114 ]]>]]>
115
116 <rpc message-id="m-9" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
117 <unlock>
118 <target>
119 <candidate/>
120 </target>
121 </unlock>
122 </rpc>
123 ]]>]]>
124
125 <rpc message-id="m-10" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
126 <lock>
127 <target>
128 <candidate/>
129 </target>
130 </lock>
131 </rpc>
132 ]]>]]>
133
134 <rpc message-id="m-11" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
135 <edit-config>
136 <target>
137 <candidate/>
138 </target>
139 <default-operation>none</default-operation>
140 <config>
141 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
142 <interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
143 a:operation="replace">
144 <name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
145 <description>neutron port</description>
146 <link-up-down-trap-enable>enabled</link-up-down-trap-enable>
147 <vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
148 <role>client</role>
149 <socket>/tmp/socket_4fe335c8-6fdc-4654-b12c-d256e9b39229</socket>
150 </vhost-user>
151 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
152 <enabled>true</enabled>
153 </interface>
154 </interfaces>
155 </config>
156 </edit-config>
157 </rpc>
158 ]]>]]>
159
160 <rpc message-id="m-12" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
161 <commit/>
162 </rpc>
163 ]]>]]>
164
165 <rpc message-id="m-13" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
166 <unlock>
167 <target>
168 <candidate/>
169 </target>
170 </unlock>
171 </rpc>
172 ]]>]]>
173
174 <rpc message-id="m-14" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
175 <lock>
176 <target>
177 <candidate/>
178 </target>
179 </lock>
180 </rpc>
181 ]]>]]>
182
183 <rpc message-id="m-15" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
184 <edit-config>
185 <target>
186 <candidate/>
187 </target>
188 <default-operation>none</default-operation>
189 <config>
190 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
191 <interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
192 a:operation="replace">
193 <name>d7611278-88ff-40e1-81e2-602e94e96fc7</name>
194 <description>neutron port</description>
195 <link-up-down-trap-enable>enabled</link-up-down-trap-enable>
196 <vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
197 <role>client</role>
198 <socket>/tmp/socket_d7611278-88ff-40e1-81e2-602e94e96fc7</socket>
199 </vhost-user>
200 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
201 <enabled>true</enabled>
202 </interface>
203 </interfaces>
204 </config>
205 </edit-config>
206 </rpc>
207 ]]>]]>
208
209 <rpc message-id="m-16" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
210 <commit/>
211 </rpc>
212 ]]>]]>
213
214 <rpc message-id="m-17" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
215 <unlock>
216 <target>
217 <candidate/>
218 </target>
219 </unlock>
220 </rpc>
221 ]]>]]>
222
223 <rpc message-id="m-18" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
224 <lock>
225 <target>
226 <candidate/>
227 </target>
228 </lock>
229 </rpc>
230 ]]>]]>
231
232 <rpc message-id="m-19" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
233 <edit-config>
234 <target>
235 <candidate/>
236 </target>
237 <default-operation>none</default-operation>
238 <config>
239 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
240 <interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
241 a:operation="replace">
242 <name>1f96a665-4351-4984-b1a8-dc6f54683123</name>
243 <description>neutron port</description>
244 <link-up-down-trap-enable>enabled</link-up-down-trap-enable>
245 <vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
246 <role>client</role>
247 <socket>/tmp/socket_1f96a665-4351-4984-b1a8-dc6f54683123</socket>
248 </vhost-user>
249 <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
250 <enabled>true</enabled>
251 </interface>
252 </interfaces>
253 </config>
254 </edit-config>
255 </rpc>
256 ]]>]]>
257
258 <rpc message-id="m-20" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
259 <commit/>
260 </rpc>
261 ]]>]]>
262
263 <rpc message-id="m-21" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
264 <unlock>
265 <target>
266 <candidate/>
267 </target>
268 </unlock>
269 </rpc>
270 ]]>]]>
271
272 <rpc message-id="m-22" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
273 <lock>
274 <target>
275 <candidate/>
276 </target>
277 </lock>
278 </rpc>
279 ]]>]]>
280
281 <rpc message-id="m-23" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
282 <edit-config>
283 <target>
284 <candidate/>
285 </target>
286 <default-operation>none</default-operation>
287 <config>
288 <bridge-domains xmlns="urn:opendaylight:params:xml:ns:yang:v3po"
289 xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
290 <bridge-domain>
291 <name>e86740a2-042c-4e64-a43b-cc224e0d5240</name>
292 <unknown-unicast-flood>true</unknown-unicast-flood>
293 <forward>true</forward>
294 <learn>true</learn>
295 <flood>true</flood>
296 <arp-termination>false</arp-termination>
297 </bridge-domain>
298 </bridge-domains>
299 </config>
300 </edit-config>
301 </rpc>
302 ]]>]]>
303
304 <rpc message-id="m-24" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
305 <commit/>
306 </rpc>
307 ]]>]]>
308
309 <rpc message-id="m-25" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
310 <unlock>
311 <target>
312 <candidate/>
313 </target>
314 </unlock>
315 </rpc>
316 ]]>]]>
317
318 <rpc message-id="m-26" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
319 <lock>
320 <target>
321 <candidate/>
322 </target>
323 </lock>
324 </rpc>
325 ]]>]]>
326
327 <rpc message-id="m-27" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
328 <get>
329 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
330 <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/>
331 </filter>
332 </get>
333 </rpc>
334 ]]>]]>"""
335
336 # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255
337 # Reverting transaction fails with "missing writer"
338 trigger_revert1 = u"""
339 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
340 <edit-config>
341 <target>
342 <candidate/>
343 </target>
344 <config>
345 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
346 <interface>
347 <name>vxlan3</name>
348 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">
349     v3po:vxlan-tunnel</type>
350 <enabled>true</enabled>
351 <vxlan xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
352 <src>192.168.1.6</src>
353 <dst>192.168.1.7</dst>
354 <vni>9</vni>
355 <encap-vrf-id>0</encap-vrf-id>
356 </vxlan>
357 </interface>
358 </interfaces>
359 </config>
360 </edit-config>
361 </rpc>
362 ]]>]]>
363
364 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
365 <edit-config>
366 <target>
367 <candidate/>
368 </target>
369 <config>
370 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
371 <interface>
372 <name>vxlan4</name>
373 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">
374     v3po:vxlan-tunnel</type>
375 <enabled>true</enabled>
376 <vxlan xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
377 <src>192.168.1.6</src>
378 <dst>192.168.1.7</dst>
379 <vni>9</vni>
380 <encap-vrf-id>0</encap-vrf-id>
381 </vxlan>
382 </interface>
383 </interfaces>
384 </config>
385 </edit-config>
386 </rpc>
387 ]]>]]>
388
389  <rpc message-id="103"
390       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
391    <commit/>
392  </rpc>
393  ]]>]]>"""
394
395 # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255, part 2
396 # Reverting transaction fails with "transaction has been closed"
397 trigger_revert2 = u"""
398 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
399 <edit-config>
400 <target>
401 <candidate/>
402 </target>
403 <config>
404 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
405 <interface>
406 <name>tap</name>
407 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">v3po:tap</type>
408 <enabled>true</enabled>
409 <tap xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
410 <tap-name>tap</tap-name>
411 </tap>
412 </interface>
413 </interfaces>
414 </config>
415 </edit-config>
416 </rpc>
417 ]]>]]>
418
419 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
420 <edit-config>
421 <target>
422 <candidate/>
423 </target>
424 <config>
425 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
426 <interface>
427 <name>tap2</name>
428 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">v3po:tap</type>
429 <enabled>true</enabled>
430 <tap xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
431 <tap-name>tap</tap-name>
432 </tap>
433 </interface>
434 </interfaces>
435 </config>
436 </edit-config>
437 </rpc>
438 ]]>]]>
439
440 <rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
441 <commit/>
442 </rpc>
443 ]]>]]>"""
444
445
446 # Test data for issue HC2VPP-60
447 # Creating Vlan sub-interface over netconf fails due to ODL bug
448 trigger_vlan = u"""
449 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
450 <edit-config>
451 <target>
452 <candidate/>
453 </target>
454 <config>
455 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
456 <interface>
457 <name>{interface}</name>
458 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan"/>
459 </interface>
460 </interfaces>
461 </config>
462 </edit-config>
463 </rpc>
464 ]]>]]>
465
466 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
467 <edit-config>
468 <target>
469 <candidate/>
470 </target>
471 <config>
472 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
473 <interface>
474 <name>{interface}</name>
475 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan">
476 <sub-interface>
477 <identifier>2420</identifier>
478 </sub-interface>
479 </sub-interfaces>
480 </interface>
481 </interfaces>
482 </config>
483 </edit-config>
484 </rpc>
485 ]]>]]>
486
487 <rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
488 <edit-config>
489 <target>
490 <candidate/>
491 </target>
492 <default-operation>none</default-operation>
493 <config>
494 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
495 <interface>
496 <name>{interface}</name>
497 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan">
498 <sub-interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
499 <identifier>2420</identifier>
500 <match>
501 <vlan-tagged>
502 <match-exact-tags>true</match-exact-tags>
503 </vlan-tagged>
504 </match>
505 <vlan-type>802dot1q</vlan-type>
506 <enabled>false</enabled>
507 <tags>
508 <tag>
509 <index>0</index>
510 <dot1q-tag>
511 <tag-type xmlns:x="urn:ieee:params:xml:ns:yang:dot1q-types">x:s-vlan</tag-type>
512 <vlan-id>2420</vlan-id>
513 </dot1q-tag>
514 </tag>
515 </tags>
516 </sub-interface>
517 </sub-interfaces>
518 </interface>
519 </interfaces>
520 </config>
521 </edit-config>
522 </rpc>
523 ]]>]]>
524
525 <rpc message-id="104" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
526 <commit/>
527 </rpc>
528 ]]>]]>
529 """

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.