]> git.proxmox.com Git - ovs.git/blame - tests/interface-reconfigure.at
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[ovs.git] / tests / interface-reconfigure.at
CommitLineData
c78cd7de
BP
1m4_divert_push([PREPARE_TESTS])
2[
3# Creates a directory tree for use with "interface-reconfigure --root-dir".
4ifr_setup () {
5 for script in \
6 interface-reconfigure \
7 InterfaceReconfigure.py \
8 InterfaceReconfigureBridge.py \
9 InterfaceReconfigureVswitch.py
10 do
11 cp $top_srcdir/xenserver/opt_xensource_libexec_$script $script
12 done
13
14 mkdir -p etc
15 cat > etc/xensource-inventory <<EOF
48d014bf
BP
16PRODUCT_BRAND='XenServer'
17PRODUCT_NAME='xenenterprise'
18PRODUCT_VERSION='5.5.0'
19BUILD_NUMBER='24648p'
20KERNEL_VERSION='2.6.18-128.1.6.el5.xs5.5.0.505.1024xen'
21XEN_VERSION='3.3.1'
22INSTALLATION_DATE='2010-02-10 16:45:28.748345'
23PRIMARY_DISK='/dev/disk/by-id/scsi-360022190add7fc001241a14e0ee3e85c'
24BACKUP_PARTITION='/dev/disk/by-id/scsi-360022190add7fc001241a14e0ee3e85c-part2'
25INSTALLATION_UUID='852ee692-71b4-439e-abfb-0eba72dc85f0'
26CONTROL_DOMAIN_UUID='44e6b66e-3074-4a3c-bbcd-756d845a3b56'
27DEFAULT_SR_PHYSDEVS='/dev/sda3'
28DOM0_MEM='752'
29MANAGEMENT_INTERFACE='xenbr2'
30EOF
31
c78cd7de
BP
32 mkdir -p etc/xensource
33 echo vswitch > etc/xensource/network.conf
34
35 for utility in \
36 sbin/ethtool \
c78cd7de
BP
37 sbin/ifdown \
38 sbin/ifup \
39 sbin/ip \
40 sbin/update-issue \
41 sbin/vconfig \
36e5d97f 42 usr/sbin/brctl
c78cd7de
BP
43 do
44 mkdir -p `dirname $utility`
45 cat > $utility <<'EOF'
48d014bf
BP
46#! /bin/sh
47echo ${0} ${*} >&2
48EOF
c78cd7de
BP
49 chmod +x $utility
50 done
48d014bf 51
c78cd7de
BP
52 mkdir -p usr/bin
53 cat > usr/bin/ovs-vsctl <<'EOF'
da7198b4
DT
54#! /bin/sh
55echo ${0} ${*} >&2
56
57while test ${#} -ge 4; do
58 if test X"${1}" = Xget && \
59 test X"${2}" = Xinterface && \
60 test X"${4}" = Xofport; then
61 if test X"${3}" = Xeth2; then
5a0e4aec
BP
62 echo 5
63 else
64 echo -1
65 fi
da7198b4
DT
66 fi
67
68 shift
69done
70EOF
c78cd7de 71 chmod +x usr/bin/ovs-vsctl
da7198b4 72
c78cd7de 73 cat > usr/bin/ovs-ofctl <<'EOF'
da7198b4
DT
74#! /bin/sh
75echo ${0} ${*} >&2
76
77# Check that the flow is properly formed.
78ovs-ofctl parse-flow "${3}" >/dev/null
79EOF
c78cd7de
BP
80 chmod +x usr/bin/ovs-ofctl
81
82 mkdir -p etc/sysconfig/network-scripts
83 configure_netdev () {
84 mkdir -p sys/class/net/${1}
85 echo ${2} > sys/class/net/${1}/address
86 echo ${3} > sys/class/net/${1}/tx_queue_len
87 if test ${1} = eth1; then
88 # No VLAN acceleration.
89 echo 0x829 > sys/class/net/${1}/features
90 else
91 # Supports VLAN acceleration.
92 echo 0x10b89 > sys/class/net/${1}/features
93 fi
94 mkdir sys/class/net/${1}/device
95 ln -s ../../../bus/pci/drivers/e1000 sys/class/net/${1}/device/driver
96
97 : >> etc/sysconfig/network-scripts/ifcfg-${1}
98 }
99
100 configure_netdev lo 00:00:00:00:00:00 0
101 configure_netdev eth0 00:22:19:22:4b:af 1000
102 configure_netdev eth1 00:22:19:22:4b:b1 1000
103 configure_netdev eth2 00:15:17:a0:29:80 1000
104 configure_netdev eth3 00:15:17:a0:29:81 1000
105 configure_netdev eth4 00:1b:21:29:ce:51 1000
106
107 mkdir -p var/xapi
108 cat > var/xapi/network.dbcache <<'EOF'
48d014bf
BP
109<?xml version="1.0" ?>
110<xenserver-network-configuration>
5a0e4aec
BP
111 <pif ref="OpaqueRef:e0955887-571f-17fc-a971-61c1ec7d81b6">
112 <VLAN_slave_of/>
404c1692 113 <tunnel_access_PIF_of/>
5a0e4aec
BP
114 <management>
115 False
116 </management>
117 <bond_slave_of>
118 OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e
119 </bond_slave_of>
120 <uuid>
121 bd62a141-091f-3909-e334-0334f67ff3be
122 </uuid>
123 <IP>
124
125 </IP>
126 <VLAN_master_of>
127 OpaqueRef:NULL
128 </VLAN_master_of>
129 <VLAN>
130 -1
131 </VLAN>
132 <netmask>
133
134 </netmask>
135 <other_config/>
136 <MAC>
137 00:22:19:22:4b:af
138 </MAC>
139 <ip_configuration_mode>
140 None
141 </ip_configuration_mode>
142 <DNS>
143
144 </DNS>
145 <device>
146 eth0
147 </device>
148 <bond_master_of/>
149 <currently_attached>
150 False
151 </currently_attached>
152 <gateway>
153
154 </gateway>
155 <network>
156 OpaqueRef:83e4a934-aeb5-e6f0-a743-d1c7ef7364c5
157 </network>
158 </pif>
159 <pif ref="OpaqueRef:eea8da94-a5e6-18fc-34a7-5e9b5a235806">
160 <VLAN_slave_of/>
404c1692 161 <tunnel_access_PIF_of/>
5a0e4aec
BP
162 <management>
163 False
164 </management>
165 <bond_slave_of>
166 OpaqueRef:NULL
167 </bond_slave_of>
168 <uuid>
169 df8d35c2-cc3a-a623-7065-d987a29feb75
170 </uuid>
171 <IP>
172
173 </IP>
174 <VLAN_master_of>
175 OpaqueRef:NULL
176 </VLAN_master_of>
177 <VLAN>
178 -1
179 </VLAN>
180 <netmask>
181
182 </netmask>
183 <other_config/>
184 <MAC>
185 00:1b:21:29:ce:51
186 </MAC>
187 <ip_configuration_mode>
188 None
189 </ip_configuration_mode>
190 <DNS>
191
192 </DNS>
193 <device>
194 eth4
195 </device>
196 <bond_master_of/>
197 <currently_attached>
198 False
199 </currently_attached>
200 <gateway>
201
202 </gateway>
203 <network>
204 OpaqueRef:bf51b4d3-7bdc-ea55-ba21-539b150b0531
205 </network>
206 </pif>
207 <pif ref="OpaqueRef:2956e6c8-487e-981c-85ff-c84796418768">
208 <VLAN_slave_of/>
404c1692 209 <tunnel_access_PIF_of/>
5a0e4aec
BP
210 <management>
211 False
212 </management>
213 <bond_slave_of>
214 OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e
215 </bond_slave_of>
216 <uuid>
217 2f87fc95-5ab4-571a-2487-3f4ac1985663
218 </uuid>
219 <IP>
220
221 </IP>
222 <VLAN_master_of>
223 OpaqueRef:NULL
224 </VLAN_master_of>
225 <VLAN>
226 -1
227 </VLAN>
228 <netmask>
229
230 </netmask>
231 <other_config/>
232 <MAC>
233 00:22:19:22:4b:b1
234 </MAC>
235 <ip_configuration_mode>
236 None
237 </ip_configuration_mode>
238 <DNS>
239
240 </DNS>
241 <device>
242 eth1
243 </device>
244 <bond_master_of/>
245 <currently_attached>
246 False
247 </currently_attached>
248 <gateway>
249
250 </gateway>
251 <network>
252 OpaqueRef:92b41bf6-aa21-45d3-1c86-c87a5fa98f7d
253 </network>
254 </pif>
255 <pif ref="OpaqueRef:d2d1e51e-4da9-3163-8f57-bb683429335e">
256 <VLAN_slave_of/>
404c1692 257 <tunnel_access_PIF_of/>
5a0e4aec
BP
258 <management>
259 False
260 </management>
261 <bond_slave_of>
262 OpaqueRef:NULL
263 </bond_slave_of>
264 <uuid>
265 d2dfdab3-daf4-afea-f055-a25a0d24d714
266 </uuid>
267 <IP>
268
269 </IP>
270 <VLAN_master_of>
271 OpaqueRef:4c0eb823-4d96-da1d-e75f-411b85badb0c
272 </VLAN_master_of>
273 <VLAN>
274 4
275 </VLAN>
276 <netmask>
277
278 </netmask>
279 <other_config/>
280 <MAC>
281 fe:ff:ff:ff:ff:ff
282 </MAC>
283 <ip_configuration_mode>
284 None
285 </ip_configuration_mode>
286 <DNS>
287
288 </DNS>
289 <device>
290 bond0
291 </device>
292 <bond_master_of/>
293 <currently_attached>
294 True
295 </currently_attached>
296 <gateway>
297
298 </gateway>
299 <network>
300 OpaqueRef:a63afad0-fb4c-b4a4-3696-cbb3d88afc47
301 </network>
302 </pif>
303 <pif ref="OpaqueRef:2bc0fab5-523a-4125-609d-212391f5f6fc">
304 <VLAN_slave_of>
305 <master>
306 OpaqueRef:e623e1d6-cd02-be8d-820d-49d65c710297
307 </master>
308 </VLAN_slave_of>
404c1692 309 <tunnel_access_PIF_of/>
5a0e4aec
BP
310 <management>
311 False
312 </management>
313 <bond_slave_of>
314 OpaqueRef:NULL
315 </bond_slave_of>
316 <uuid>
317 f4ba396e-a993-a592-5fbc-a1d566afb59e
318 </uuid>
319 <IP>
320 10.0.0.188
321 </IP>
322 <VLAN_master_of>
323 OpaqueRef:NULL
324 </VLAN_master_of>
325 <VLAN>
326 -1
327 </VLAN>
328 <netmask>
329 255.0.0.0
330 </netmask>
331 <other_config/>
332 <MAC>
333 00:15:17:a0:29:81
334 </MAC>
335 <ip_configuration_mode>
336 Static
337 </ip_configuration_mode>
338 <DNS>
339
340 </DNS>
341 <device>
342 eth3
343 </device>
344 <bond_master_of/>
345 <currently_attached>
346 True
347 </currently_attached>
348 <gateway>
349
350 </gateway>
351 <network>
352 OpaqueRef:d9189da2-d00b-61ba-8a6d-ac42cc868e32
353 </network>
354 </pif>
355 <pif ref="OpaqueRef:205d1186-2cd1-d5e6-45e4-ea1698ea6e15">
356 <VLAN_slave_of/>
404c1692 357 <tunnel_access_PIF_of/>
5a0e4aec
BP
358 <management>
359 True
360 </management>
361 <bond_slave_of>
362 OpaqueRef:NULL
363 </bond_slave_of>
364 <uuid>
365 646ca9a1-36ad-e2f9-3ecc-1e5622c201c2
366 </uuid>
367 <IP>
368 172.18.3.188
369 </IP>
370 <VLAN_master_of>
371 OpaqueRef:NULL
372 </VLAN_master_of>
373 <VLAN>
374 -1
375 </VLAN>
376 <netmask>
377 255.255.0.0
378 </netmask>
379 <other_config/>
380 <MAC>
381 00:15:17:a0:29:80
382 </MAC>
383 <ip_configuration_mode>
384 DHCP
385 </ip_configuration_mode>
386 <DNS>
387
388 </DNS>
389 <device>
390 eth2
391 </device>
392 <bond_master_of/>
393 <currently_attached>
394 True
395 </currently_attached>
396 <gateway>
397
398 </gateway>
399 <network>
400 OpaqueRef:6e7c6e81-6b5e-b91f-e1f9-9e028567bdfe
401 </network>
402 </pif>
403 <pif ref="OpaqueRef:8e3e37e6-ebb9-087e-0201-f6a56bf554c3">
404 <VLAN_slave_of/>
404c1692 405 <tunnel_access_PIF_of/>
5a0e4aec
BP
406 <management>
407 False
408 </management>
409 <bond_slave_of>
410 OpaqueRef:NULL
411 </bond_slave_of>
412 <uuid>
413 3941edd2-865b-8dd8-61f0-199f5e1fa652
414 </uuid>
415 <IP>
416
417 </IP>
418 <VLAN_master_of>
419 OpaqueRef:e623e1d6-cd02-be8d-820d-49d65c710297
420 </VLAN_master_of>
421 <VLAN>
422 123
423 </VLAN>
424 <netmask>
425
426 </netmask>
427 <other_config/>
428 <MAC>
429 fe:ff:ff:ff:ff:ff
430 </MAC>
431 <ip_configuration_mode>
432 None
433 </ip_configuration_mode>
434 <DNS>
435
436 </DNS>
437 <device>
438 eth3
439 </device>
440 <bond_master_of/>
441 <currently_attached>
442 True
443 </currently_attached>
444 <gateway>
445
446 </gateway>
447 <network>
448 OpaqueRef:240fb5f8-addc-6ea3-f921-2a42b42acd17
449 </network>
450 </pif>
451 <pif ref="OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11">
452 <VLAN_slave_of>
453 <master>
454 OpaqueRef:4c0eb823-4d96-da1d-e75f-411b85badb0c
455 </master>
456 </VLAN_slave_of>
404c1692 457 <tunnel_access_PIF_of/>
5a0e4aec
BP
458 <management>
459 False
460 </management>
461 <bond_slave_of>
462 OpaqueRef:NULL
463 </bond_slave_of>
464 <uuid>
465 6c0327a9-afa3-fc19-6798-a1bfe20095ed
466 </uuid>
467 <IP>
468
469 </IP>
470 <VLAN_master_of>
471 OpaqueRef:NULL
472 </VLAN_master_of>
473 <VLAN>
474 -1
475 </VLAN>
476 <netmask>
477
478 </netmask>
479 <other_config/>
480 <MAC>
481 00:22:19:22:4b:af
482 </MAC>
483 <ip_configuration_mode>
484 None
485 </ip_configuration_mode>
486 <DNS>
487
488 </DNS>
489 <device>
490 bond0
491 </device>
492 <bond_master_of>
493 <slave>
494 OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e
495 </slave>
496 </bond_master_of>
497 <currently_attached>
498 True
499 </currently_attached>
500 <gateway>
501
502 </gateway>
503 <network>
504 OpaqueRef:ec1e5037-60ea-97e5-54b8-39bdb43c071a
505 </network>
506 </pif>
507 <bond ref="OpaqueRef:86d81bcf-0d25-90b2-cb11-af2007bd586e">
508 <master>
509 OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11
510 </master>
511 <uuid>
512 dad825f1-6d81-386e-849c-5589281e53e1
513 </uuid>
514 <slaves>
515 <slave>
516 OpaqueRef:e0955887-571f-17fc-a971-61c1ec7d81b6
517 </slave>
518 <slave>
519 OpaqueRef:2956e6c8-487e-981c-85ff-c84796418768
520 </slave>
521 </slaves>
522 </bond>
523 <vlan ref="OpaqueRef:4c0eb823-4d96-da1d-e75f-411b85badb0c">
524 <tagged_PIF>
525 OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11
526 </tagged_PIF>
527 <uuid>
528 841814da-d0d2-9da4-0b2e-b6143480bbfb
529 </uuid>
530 <untagged_PIF>
531 OpaqueRef:d2d1e51e-4da9-3163-8f57-bb683429335e
532 </untagged_PIF>
533 </vlan>
534 <vlan ref="OpaqueRef:e623e1d6-cd02-be8d-820d-49d65c710297">
535 <tagged_PIF>
536 OpaqueRef:2bc0fab5-523a-4125-609d-212391f5f6fc
537 </tagged_PIF>
538 <uuid>
539 399279a2-5ccd-5368-9af3-8622a1f1ac82
540 </uuid>
541 <untagged_PIF>
542 OpaqueRef:8e3e37e6-ebb9-087e-0201-f6a56bf554c3
543 </untagged_PIF>
544 </vlan>
545 <network ref="OpaqueRef:a63afad0-fb4c-b4a4-3696-cbb3d88afc47">
546 <PIFs>
547 <PIF>
548 OpaqueRef:d2d1e51e-4da9-3163-8f57-bb683429335e
549 </PIF>
550 </PIFs>
551 <bridge>
552 xapi2
553 </bridge>
554 <other_config/>
555 <uuid>
556 99be2da4-6c33-6f8e-49ea-3bc592fe3c85
557 </uuid>
558 </network>
559 <network ref="OpaqueRef:d9189da2-d00b-61ba-8a6d-ac42cc868e32">
560 <PIFs>
561 <PIF>
562 OpaqueRef:2bc0fab5-523a-4125-609d-212391f5f6fc
563 </PIF>
564 </PIFs>
565 <bridge>
566 xenbr3
567 </bridge>
568 <other_config/>
569 <uuid>
570 2902ae1b-8013-897a-b697-0b200ea3aaa5
571 </uuid>
572 </network>
573 <network ref="OpaqueRef:ec1e5037-60ea-97e5-54b8-39bdb43c071a">
574 <PIFs>
575 <PIF>
576 OpaqueRef:69c904bb-8da9-3424-485b-8b47c2d3ef11
577 </PIF>
578 </PIFs>
579 <bridge>
580 xapi1
581 </bridge>
582 <other_config/>
583 <uuid>
584 45cbbb43-113d-a712-3231-c6463f253cef
585 </uuid>
586 </network>
587 <network ref="OpaqueRef:92b41bf6-aa21-45d3-1c86-c87a5fa98f7d">
588 <PIFs>
589 <PIF>
590 OpaqueRef:2956e6c8-487e-981c-85ff-c84796418768
591 </PIF>
592 </PIFs>
593 <bridge>
594 xenbr1
595 </bridge>
596 <other_config/>
597 <uuid>
598 99f8771a-645a-26a3-e06c-30a401f1d009
599 </uuid>
600 </network>
601 <network ref="OpaqueRef:6e7c6e81-6b5e-b91f-e1f9-9e028567bdfe">
602 <PIFs>
603 <PIF>
604 OpaqueRef:205d1186-2cd1-d5e6-45e4-ea1698ea6e15
605 </PIF>
606 </PIFs>
607 <bridge>
608 xenbr2
609 </bridge>
610 <other_config/>
611 <uuid>
612 d08c8749-0c8f-9e8d-ce25-fd364661ee99
613 </uuid>
614 </network>
615 <network ref="OpaqueRef:83e4a934-aeb5-e6f0-a743-d1c7ef7364c5">
616 <PIFs>
617 <PIF>
618 OpaqueRef:e0955887-571f-17fc-a971-61c1ec7d81b6
619 </PIF>
620 </PIFs>
621 <bridge>
622 xenbr0
623 </bridge>
624 <other_config>
625 <vswitch-disable-in-band>
626 true
627 </vswitch-disable-in-band>
628 </other_config>
629 <uuid>
630 c9eecb03-560d-61de-b6a8-56dfc766f67e
631 </uuid>
632 </network>
633 <network ref="OpaqueRef:bf51b4d3-7bdc-ea55-ba21-539b150b0531">
634 <PIFs>
635 <PIF>
636 OpaqueRef:eea8da94-a5e6-18fc-34a7-5e9b5a235806
637 </PIF>
638 </PIFs>
639 <bridge>
640 xenbr4
641 </bridge>
642 <other_config/>
643 <uuid>
644 d2c14c89-29cc-51d4-7664-633eff02b2ad
645 </uuid>
646 </network>
647 <network ref="OpaqueRef:0b7354a4-8f4b-aa08-2f16-a22c117e4211">
648 <PIFs/>
649 <bridge>
650 xapi0
651 </bridge>
652 <other_config/>
653 <uuid>
654 dc0f0632-c2aa-1b78-2fea-0d3a23c51740
655 </uuid>
656 </network>
657 <network ref="OpaqueRef:240fb5f8-addc-6ea3-f921-2a42b42acd17">
658 <PIFs>
659 <PIF>
660 OpaqueRef:8e3e37e6-ebb9-087e-0201-f6a56bf554c3
661 </PIF>
662 </PIFs>
663 <bridge>
664 xapi3
665 </bridge>
666 <other_config/>
667 <uuid>
668 db7bdc03-074d-42ae-fc73-9b06de1d57f6
669 </uuid>
670 </network>
27b1bdef
EJ
671 <pool ref="OpaqueRef:a765d06c-fc82-cc67-8f6c-fd8db45f6a84">
672 <other_config>
673 <vswitch-controller-fail-mode>
da7198b4 674 secure
27b1bdef
EJ
675 </vswitch-controller-fail-mode>
676 </other_config>
677 </pool>
48d014bf
BP
678</xenserver-network-configuration>
679EOF
c78cd7de
BP
680}
681
682ifr_run () {
1ca0323e 683 $PYTHON3 ./interface-reconfigure --root-prefix="`pwd`" --no-syslog "$@"
c78cd7de 684}
48d014bf 685
c78cd7de 686ifr_filter () {
37d03458 687 sed -n -e "s,`pwd`,,g" -e 's/ -- /\
c78cd7de
BP
688 /g' -e '/^Running command:/!p' stderr
689}]
690m4_divert_pop([PREPARE_TESTS])
48d014bf 691
48d014bf
BP
692\f
693AT_BANNER([interface-reconfigure])
694
695AT_SETUP([non-VLAN, non-bond])
696AT_KEYWORDS([interface-reconfigure])
e6e590a7 697AT_SKIP_IF([$non_ascii_cwd])
d20f8fdc 698AT_SKIP_IF([test "$IS_WIN32" = "yes"])
c78cd7de 699ifr_setup
48d014bf 700
c78cd7de
BP
701AT_CHECK([ifr_run --force xenbr2 up], [0], [], [stderr])
702AT_CHECK([ifr_filter], [0], [[Force interface xenbr2 up
48d014bf
BP
703Loading xapi database cache from /var/xapi/network.dbcache
704Configured for Vswitch datapath
705action_up: xenbr2
706Writing network configuration for xenbr2
707Configuring xenbr2 using DHCP configuration
708configure_datapath: bridge - xenbr2
1ea636ec 709configure_datapath: physical - ['eth2']
48d014bf
BP
710configure_datapath: extra ports - []
711configure_datapath: extra bonds - []
fba6bd1d 712/usr/bin/ovs-vsctl -vconsole:off get-fail-mode xenbr2
48d014bf
BP
713Applying changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
714Applying changes to /etc/sysconfig/network configuration
715Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration
0b2c7e69 716/sbin/ip link set eth2 up mtu 1500
404c1692 717/sbin/ethtool -K eth2 gro off lro off
48d014bf
BP
718/usr/bin/ovs-vsctl --timeout=20
719 --with-iface --if-exists del-port eth2
720 --may-exist add-br xenbr2
721 --may-exist add-port xenbr2 eth2
16f2ae57 722 set Bridge xenbr2 other-config:hwaddr="00:15:17:a0:29:80"
da7198b4 723 set Bridge xenbr2 fail_mode=secure
da54975c 724 remove Bridge xenbr2 other_config disable-in-band
c76fde78 725 br-set-external-id xenbr2 xs-network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
fba6bd1d 726/usr/bin/ovs-vsctl -vconsole:off get interface eth2 ofport
da7198b4
DT
727/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,arp,nw_proto=1,actions=local
728/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=local,arp,dl_src=00:15:17:a0:29:80,actions=5
729/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,dl_dst=00:15:17:a0:29:80,actions=local
730/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=local,dl_src=00:15:17:a0:29:80,actions=5
48d014bf
BP
731/sbin/ifup xenbr2
732/sbin/update-issue
733Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
734Committing changes to /etc/sysconfig/network configuration
735Committing changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration
736]])
737
738AT_CHECK([cat etc/sysconfig/network-scripts/ifcfg-xenbr2], [0],
739 [# DO NOT EDIT: This file (ifcfg-xenbr2) was autogenerated by interface-reconfigure
740XEMANAGED=yes
741DEVICE=xenbr2
742ONBOOT=no
1b970597 743NOZEROCONF=yes
48d014bf
BP
744TYPE=Ethernet
745BOOTPROTO=dhcp
746PERSISTENT_DHCLIENT=yes
02a987d2 747MTU=1500
48d014bf
BP
748])
749
750# Simulate interface-reconfigure creating xenbr2, so that we can tell
751# interface-reconfigure to take it back down.
752AT_CHECK([configure_netdev xenbr2 00:15:17:a0:29:80 0])
753
c78cd7de
BP
754AT_CHECK([ifr_run --force xenbr2 down], [0], [], [stderr])
755AT_CHECK([ifr_filter], [0], [[Force interface xenbr2 down
48d014bf
BP
756Loading xapi database cache from /var/xapi/network.dbcache
757Configured for Vswitch datapath
758action_down: xenbr2
759/sbin/ifdown xenbr2
760deconfigure ipdev xenbr2 on xenbr2
761deconfigure_bridge: bridge - xenbr2
1ea636ec 762action_down: bring down physical devices - ['eth2']
0b2c7e69 763/sbin/ip link set eth2 down
48d014bf
BP
764/usr/bin/ovs-vsctl --timeout=20
765 --with-iface --if-exists del-port xenbr2
766 --if-exists del-br xenbr2
767]])
768
769AT_CLEANUP
770\f
771AT_SETUP([VLAN, non-bond])
772AT_KEYWORDS([interface-reconfigure])
e6e590a7 773AT_SKIP_IF([$non_ascii_cwd])
d20f8fdc 774AT_SKIP_IF([test "$IS_WIN32" = "yes"])
c78cd7de 775ifr_setup
48d014bf 776
c78cd7de
BP
777AT_CHECK([ifr_run --force xapi3 up], [0], [], [stderr])
778AT_CHECK([ifr_filter], [0], [[Force interface xapi3 up
48d014bf
BP
779Loading xapi database cache from /var/xapi/network.dbcache
780Configured for Vswitch datapath
781action_up: xapi3
782Writing network configuration for xapi3
783Configuring xapi3 using None configuration
784configure_datapath: bridge - xenbr3
1ea636ec 785configure_datapath: physical - ['eth3']
48d014bf
BP
786configure_datapath: extra ports - []
787configure_datapath: extra bonds - []
788Applying changes to /etc/sysconfig/network-scripts/route-xapi3 configuration
789Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration
0b2c7e69 790/sbin/ip link set eth3 up mtu 1500
404c1692 791/sbin/ethtool -K eth3 gro off lro off
48d014bf
BP
792/usr/bin/ovs-vsctl --timeout=20
793 --with-iface --if-exists del-port eth3
794 --may-exist add-br xenbr3
795 --may-exist add-port xenbr3 eth3
16f2ae57 796 set Bridge xenbr3 other-config:hwaddr="00:15:17:a0:29:81"
da7198b4 797 set Bridge xenbr3 fail_mode=secure
da54975c 798 remove Bridge xenbr3 other_config disable-in-band
c76fde78 799 br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
9ec4d255 800 --if-exists del-br xapi3
48d014bf 801 --may-exist add-br xapi3 xenbr3 123
c76fde78 802 br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
47a3c536 803 set Interface xapi3 MAC="00:15:17:a0:29:81"
48d014bf
BP
804/sbin/ifup xapi3
805/sbin/update-issue
806Committing changes to /etc/sysconfig/network-scripts/route-xapi3 configuration
807Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration
808]])
809
810AT_CHECK([cat etc/sysconfig/network-scripts/ifcfg-xapi3], [0],
811 [# DO NOT EDIT: This file (ifcfg-xapi3) was autogenerated by interface-reconfigure
812XEMANAGED=yes
813DEVICE=xapi3
814ONBOOT=no
1b970597 815NOZEROCONF=yes
48d014bf
BP
816TYPE=Ethernet
817BOOTPROTO=none
02a987d2 818MTU=1500
48d014bf
BP
819])
820
821# Simulate interface-reconfigure creating xapi3, so that we can tell
822# interface-reconfigure to take it back down.
823AT_CHECK([configure_netdev xapi3 00:23:20:AC:AF:02 0])
824
c78cd7de
BP
825AT_CHECK([ifr_run --force xapi3 down], [0], [], [stderr])
826AT_CHECK([ifr_filter], [0], [[Force interface xapi3 down
48d014bf
BP
827Loading xapi database cache from /var/xapi/network.dbcache
828Configured for Vswitch datapath
829action_down: xapi3
830/sbin/ifdown xapi3
831deconfigure ipdev xapi3 on xenbr3
832deconfigure_bridge: bridge - xapi3
833action_down: no more masters, bring down slave xenbr3
834deconfigure_bridge: bridge - xenbr3
1ea636ec 835action_down: bring down physical devices - ['eth3']
0b2c7e69 836/sbin/ip link set eth3 down
48d014bf
BP
837/usr/bin/ovs-vsctl --timeout=20
838 --with-iface --if-exists del-port xapi3
839 --if-exists del-br xapi3
840 --if-exists del-br xenbr3
841]])
842
843AT_CLEANUP
844\f
845AT_SETUP([Bond, non-VLAN])
846AT_KEYWORDS([interface-reconfigure])
e6e590a7 847AT_SKIP_IF([$non_ascii_cwd])
d20f8fdc 848AT_SKIP_IF([test "$IS_WIN32" = "yes"])
c78cd7de 849ifr_setup
48d014bf
BP
850
851# Pretend that bond0 exists, even though it would really be created by
852# a "create-bond" call in an ovs-vsctl invocation within
853# interface-reconfigure, because otherwise interface-reconfigure will
854# die with "failed to apply changes: netdev: up: device bond0 does not
855# exist" after it thinks it created bond0.
856AT_CHECK([configure_netdev bond0 00:23:20:e6:39:75 0])
857
c78cd7de
BP
858AT_CHECK([ifr_run --force xapi1 up], [0], [], [stderr])
859AT_CHECK([ifr_filter], [0], [[Force interface xapi1 up
48d014bf
BP
860Loading xapi database cache from /var/xapi/network.dbcache
861Configured for Vswitch datapath
862action_up: xapi1
863Writing network configuration for xapi1
864Configuring xapi1 using None configuration
865configure_datapath: leaving bond bond0 up
866configure_datapath: leaving bond bond0 up
867configure_datapath: bridge - xapi1
1ea636ec 868configure_datapath: physical - ['eth0', 'eth1']
48d014bf
BP
869configure_datapath: extra ports - []
870configure_datapath: extra bonds - []
871netdev: down: device xenbr0 does not exist, ignoring
872netdev: down: device xenbr1 does not exist, ignoring
873Applying changes to /etc/sysconfig/network-scripts/route-xapi1 configuration
874Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration
0b2c7e69 875/sbin/ip link set eth0 up mtu 1500
404c1692 876/sbin/ethtool -K eth0 gro off lro off
0b2c7e69 877/sbin/ip link set eth1 up mtu 1500
404c1692 878/sbin/ethtool -K eth1 gro off lro off
48d014bf
BP
879/usr/bin/ovs-vsctl --timeout=20
880 --if-exists del-br xenbr0
881 --if-exists del-br xenbr1
882 --with-iface --if-exists del-port eth0
883 --with-iface --if-exists del-port eth1
884 --may-exist add-br xapi1
885 --with-iface --if-exists del-port bond0
886 --fake-iface add-bond xapi1 bond0 eth0 eth1
8b35f045 887 set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:bond-miimon-interval=100 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
16f2ae57 888 set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
da7198b4 889 set Bridge xapi1 fail_mode=secure
da54975c 890 remove Bridge xapi1 other_config disable-in-band
b13300c7 891 br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85
48d014bf
BP
892/sbin/ifup xapi1
893action_up: bring up bond0
0b2c7e69 894/sbin/ip link set bond0 up
48d014bf
BP
895/sbin/update-issue
896Committing changes to /etc/sysconfig/network-scripts/route-xapi1 configuration
897Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration
898]])
899
900AT_CHECK([cat etc/sysconfig/network-scripts/ifcfg-xapi1], [0],
901 [# DO NOT EDIT: This file (ifcfg-xapi1) was autogenerated by interface-reconfigure
902XEMANAGED=yes
903DEVICE=xapi1
904ONBOOT=no
1b970597 905NOZEROCONF=yes
48d014bf
BP
906TYPE=Ethernet
907BOOTPROTO=none
02a987d2 908MTU=1500
48d014bf
BP
909])
910
911# Simulate interface-reconfigure creating xapi1, so that we can tell
912# interface-reconfigure to take it back down.
913AT_CHECK([configure_netdev xapi1 00:22:19:22:4B:AF 0])
914
c78cd7de
BP
915AT_CHECK([ifr_run --force xapi1 down], [0], [], [stderr])
916AT_CHECK([ifr_filter], [0], [[Force interface xapi1 down
48d014bf
BP
917Loading xapi database cache from /var/xapi/network.dbcache
918Configured for Vswitch datapath
919action_down: xapi1
920/sbin/ifdown xapi1
921deconfigure ipdev xapi1 on xapi1
922deconfigure_bridge: bridge - xapi1
1ea636ec 923action_down: bring down physical devices - ['eth0', 'eth1']
0b2c7e69
BP
924/sbin/ip link set eth0 down
925/sbin/ip link set eth1 down
48d014bf
BP
926/usr/bin/ovs-vsctl --timeout=20
927 --with-iface --if-exists del-port xapi1
928 --if-exists del-br xapi1
929]])
930
931AT_CLEANUP
932\f
933AT_SETUP([VLAN on bond])
934AT_KEYWORDS([interface-reconfigure])
e6e590a7 935AT_SKIP_IF([$non_ascii_cwd])
d20f8fdc 936AT_SKIP_IF([test "$IS_WIN32" = "yes"])
c78cd7de 937ifr_setup
48d014bf
BP
938
939# Pretend that bond0 exists, even though it would really be created by
940# a "create-bond" call in an ovs-vsctl invocation within
941# interface-reconfigure, because otherwise interface-reconfigure will
942# die with "failed to apply changes: netdev: up: device bond0 does not
943# exist" after it thinks it created bond0.
944AT_CHECK([configure_netdev bond0 00:23:20:e6:39:75 0])
945
c78cd7de
BP
946AT_CHECK([ifr_run --force xapi2 up], [0], [], [stderr])
947AT_CHECK([ifr_filter], [0], [[Force interface xapi2 up
48d014bf
BP
948Loading xapi database cache from /var/xapi/network.dbcache
949Configured for Vswitch datapath
950action_up: xapi2
951Writing network configuration for xapi2
952Configuring xapi2 using None configuration
953configure_datapath: leaving bond bond0 up
954configure_datapath: leaving bond bond0 up
955configure_datapath: bridge - xapi1
1ea636ec 956configure_datapath: physical - ['eth0', 'eth1']
48d014bf
BP
957configure_datapath: extra ports - []
958configure_datapath: extra bonds - []
959netdev: down: device xenbr0 does not exist, ignoring
960netdev: down: device xenbr1 does not exist, ignoring
961Applying changes to /etc/sysconfig/network-scripts/route-xapi2 configuration
962Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
0b2c7e69 963/sbin/ip link set eth0 up mtu 1500
404c1692 964/sbin/ethtool -K eth0 gro off lro off
0b2c7e69 965/sbin/ip link set eth1 up mtu 1500
404c1692 966/sbin/ethtool -K eth1 gro off lro off
48d014bf
BP
967/usr/bin/ovs-vsctl --timeout=20
968 --if-exists del-br xenbr0
969 --if-exists del-br xenbr1
970 --with-iface --if-exists del-port eth0
971 --with-iface --if-exists del-port eth1
972 --may-exist add-br xapi1
973 --with-iface --if-exists del-port bond0
974 --fake-iface add-bond xapi1 bond0 eth0 eth1
8b35f045 975 set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:bond-miimon-interval=100 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
16f2ae57 976 set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
da7198b4 977 set Bridge xapi1 fail_mode=secure
da54975c 978 remove Bridge xapi1 other_config disable-in-band
b13300c7 979 br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85
9ec4d255 980 --if-exists del-br xapi2
48d014bf 981 --may-exist add-br xapi2 xapi1 4
b13300c7 982 br-set-external-id xapi2 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85
47a3c536 983 set Interface xapi2 MAC="00:22:19:22:4b:af"
48d014bf
BP
984/sbin/ifup xapi2
985action_up: bring up bond0
0b2c7e69 986/sbin/ip link set bond0 up
48d014bf
BP
987/sbin/update-issue
988Committing changes to /etc/sysconfig/network-scripts/route-xapi2 configuration
989Committing changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
990]])
991
992AT_CHECK([cat etc/sysconfig/network-scripts/ifcfg-xapi2], [0],
993 [# DO NOT EDIT: This file (ifcfg-xapi2) was autogenerated by interface-reconfigure
994XEMANAGED=yes
995DEVICE=xapi2
996ONBOOT=no
1b970597 997NOZEROCONF=yes
48d014bf
BP
998TYPE=Ethernet
999BOOTPROTO=none
02a987d2 1000MTU=1500
48d014bf
BP
1001])
1002
1003# Simulate interface-reconfigure creating xapi2, so that we can tell
1004# interface-reconfigure to take it back down.
1005AT_CHECK([configure_netdev xapi2 00:23:20:A4:71:C2 0])
1006
c78cd7de
BP
1007AT_CHECK([ifr_run --force xapi2 down], [0], [], [stderr])
1008AT_CHECK([ifr_filter], [0], [[Force interface xapi2 down
48d014bf
BP
1009Loading xapi database cache from /var/xapi/network.dbcache
1010Configured for Vswitch datapath
1011action_down: xapi2
1012/sbin/ifdown xapi2
1013deconfigure ipdev xapi2 on xapi1
1014deconfigure_bridge: bridge - xapi2
1015action_down: no more masters, bring down slave xapi1
1016deconfigure_bridge: bridge - xapi1
1ea636ec 1017action_down: bring down physical devices - ['eth0', 'eth1']
0b2c7e69
BP
1018/sbin/ip link set eth0 down
1019/sbin/ip link set eth1 down
48d014bf
BP
1020/usr/bin/ovs-vsctl --timeout=20
1021 --with-iface --if-exists del-port xapi2
1022 --if-exists del-br xapi2
1023 --if-exists del-br xapi1
1024]])
1025
1026AT_CLEANUP
780f7a2e
JS
1027
1028dnl This test configures two tunnels, then deletes the second and re-uses its
1029dnl name for different types of ports. This was introduced to detect errors
1030dnl where port configuration persists even when the port is deleted and
1031dnl readded.
1032AT_SETUP([Re-create port with different types])
1033AT_KEYWORDS([interface-reconfigure])
1034OVS_VSWITCHD_START(
1035 [add-port br0 p0 -- set int p0 type=gre options:remote_ip=127.0.0.1 -- \
1036 add-port br0 p1 -- set int p1 type=dummy -- \
1037 add-port br0 p2 -- set int p2 type=dummy])
1038
1039AT_CHECK([ovs-vsctl set int p1 type=gre options:remote_ip=127.0.0.1])
1040AT_CHECK([ovs-vsctl del-port p1])
1041AT_CHECK([ovs-vsctl add-port br0 p1 -- set int p1 type=dummy])
1042
d9c8c57c
LR
1043OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
1044OVS_APP_EXIT_AND_WAIT([ovsdb-server])
780f7a2e 1045AT_CLEANUP