51a6ab69673847cf101c26f040b74c084c069de2
[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 <vpp xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
289 <bridge-domains>
290 <bridge-domain xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
291 a:operation="replace">
292 <name>e86740a2-042c-4e64-a43b-cc224e0d5240</name>
293 <unknown-unicast-flood>true</unknown-unicast-flood>
294 <forward>true</forward>
295 <learn>true</learn>
296 <flood>true</flood>
297 <arp-termination>false</arp-termination>
298 </bridge-domain>
299 </bridge-domains>
300 </vpp>
301 </config>
302 </edit-config>
303 </rpc>
304 ]]>]]>
305
306 <rpc message-id="m-24" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
307 <commit/>
308 </rpc>
309 ]]>]]>
310
311 <rpc message-id="m-25" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
312 <unlock>
313 <target>
314 <candidate/>
315 </target>
316 </unlock>
317 </rpc>
318 ]]>]]>
319
320 <rpc message-id="m-26" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
321 <lock>
322 <target>
323 <candidate/>
324 </target>
325 </lock>
326 </rpc>
327 ]]>]]>
328
329 <rpc message-id="m-27" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
330 <get>
331 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
332 <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/>
333 </filter>
334 </get>
335 </rpc>
336 ]]>]]>"""
337
338 # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255
339 # Reverting transaction fails with "missing writer"
340 trigger_revert1 = u"""
341 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
342 <edit-config>
343 <target>
344 <candidate/>
345 </target>
346 <config>
347 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
348 <interface>
349 <name>vxlan3</name>
350 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">
351     v3po:vxlan-tunnel</type>
352 <enabled>true</enabled>
353 <vxlan xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
354 <src>192.168.1.6</src>
355 <dst>192.168.1.7</dst>
356 <vni>9</vni>
357 <encap-vrf-id>0</encap-vrf-id>
358 </vxlan>
359 </interface>
360 </interfaces>
361 </config>
362 </edit-config>
363 </rpc>
364 ]]>]]>
365
366 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
367 <edit-config>
368 <target>
369 <candidate/>
370 </target>
371 <config>
372 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
373 <interface>
374 <name>vxlan4</name>
375 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">
376     v3po:vxlan-tunnel</type>
377 <enabled>true</enabled>
378 <vxlan xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
379 <src>192.168.1.6</src>
380 <dst>192.168.1.7</dst>
381 <vni>9</vni>
382 <encap-vrf-id>0</encap-vrf-id>
383 </vxlan>
384 </interface>
385 </interfaces>
386 </config>
387 </edit-config>
388 </rpc>
389 ]]>]]>
390
391  <rpc message-id="103"
392       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
393    <commit/>
394  </rpc>
395  ]]>]]>"""
396
397 # Test data for issue: https://jira.fd.io/browse/HONEYCOMB-255, part 2
398 # Reverting transaction fails with "transaction has been closed"
399 trigger_revert2 = u"""
400 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
401 <edit-config>
402 <target>
403 <candidate/>
404 </target>
405 <config>
406 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
407 <interface>
408 <name>tap</name>
409 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">v3po:tap</type>
410 <enabled>true</enabled>
411 <tap xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
412 <tap-name>tap</tap-name>
413 </tap>
414 </interface>
415 </interfaces>
416 </config>
417 </edit-config>
418 </rpc>
419 ]]>]]>
420
421 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
422 <edit-config>
423 <target>
424 <candidate/>
425 </target>
426 <config>
427 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
428 <interface>
429 <name>tap2</name>
430 <type xmlns:v3po="urn:opendaylight:params:xml:ns:yang:v3po">v3po:tap</type>
431 <enabled>true</enabled>
432 <tap xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
433 <tap-name>tap</tap-name>
434 </tap>
435 </interface>
436 </interfaces>
437 </config>
438 </edit-config>
439 </rpc>
440 ]]>]]>
441
442 <rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
443 <commit/>
444 </rpc>
445 ]]>]]>"""
446
447
448 # Test data for issue HC2VPP-60
449 # Creating Vlan sub-interface over netconf fails due to ODL bug
450 trigger_vlan = u"""
451 <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
452 <edit-config>
453 <target>
454 <candidate/>
455 </target>
456 <config>
457 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
458 <interface>
459 <name>{interface}</name>
460 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan"/>
461 </interface>
462 </interfaces>
463 </config>
464 </edit-config>
465 </rpc>
466 ]]>]]>
467
468 <rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
469 <edit-config>
470 <target>
471 <candidate/>
472 </target>
473 <config>
474 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
475 <interface>
476 <name>{interface}</name>
477 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan">
478 <sub-interface>
479 <identifier>2420</identifier>
480 </sub-interface>
481 </sub-interfaces>
482 </interface>
483 </interfaces>
484 </config>
485 </edit-config>
486 </rpc>
487 ]]>]]>
488
489 <rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
490 <edit-config>
491 <target>
492 <candidate/>
493 </target>
494 <default-operation>none</default-operation>
495 <config>
496 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
497 <interface>
498 <name>{interface}</name>
499 <sub-interfaces xmlns="urn:opendaylight:params:xml:ns:yang:vpp:vlan">
500 <sub-interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
501 <identifier>2420</identifier>
502 <match>
503 <vlan-tagged>
504 <match-exact-tags>true</match-exact-tags>
505 </vlan-tagged>
506 </match>
507 <vlan-type>802dot1q</vlan-type>
508 <enabled>false</enabled>
509 <tags>
510 <tag>
511 <index>0</index>
512 <dot1q-tag>
513 <tag-type xmlns:x="urn:ieee:params:xml:ns:yang:dot1q-types">x:s-vlan</tag-type>
514 <vlan-id>2420</vlan-id>
515 </dot1q-tag>
516 </tag>
517 </tags>
518 </sub-interface>
519 </sub-interfaces>
520 </interface>
521 </interfaces>
522 </config>
523 </edit-config>
524 </rpc>
525 ]]>]]>
526
527 <rpc message-id="104" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
528 <commit/>
529 </rpc>
530 ]]>]]>
531 """

©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.