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