@@ -164,7 +164,7 @@ network:
164164` )
165165}
166166
167- func (s * NetplanSuite ) TestBondIntValues (c * gc.C ) {
167+ func (s * NetplanSuite ) TestBondsIntParameters (c * gc.C ) {
168168 // several parameters can be specified as an integer or a string
169169 // such as 'mode: 0' is the same as 'balance-rr'
170170 checkNetplanRoundTrips (c , `
@@ -187,6 +187,7 @@ network:
187187 mode: 0
188188 lacp-rate: 1
189189 ad-select: 1
190+ all-slaves-active: true
190191 arp-validate: 0
191192 arp-all-targets: 0
192193 fail-over-mac-policy: 1
@@ -212,6 +213,7 @@ network:
212213 mode: balance-rr
213214 lacp-rate: fast
214215 ad-select: bandwidth
216+ all-slaves-active: false
215217 arp-validate: filter
216218 arp-all-targets: all
217219 fail-over-mac-policy: follow
@@ -269,6 +271,12 @@ network:
269271 match:
270272 macaddress: de:ad:be:ef:01:02
271273 set-name: id1
274+ id2:
275+ match:
276+ macaddress: de:ad:be:ef:01:03
277+ id3:
278+ match:
279+ macaddress: de:ad:be:ef:01:04
272280 bonds:
273281 bond0:
274282 interfaces: [id0, id1]
@@ -285,7 +293,7 @@ network:
285293 - 192.168.0.1
286294 - 192.168.10.20
287295 arp-validate: none
288- arp-all-targets: boo
296+ arp-all-targets: all
289297 up-delay: 0
290298 down-delay: 0
291299 fail-over-mac-policy: follow
@@ -298,8 +306,71 @@ network:
298306` )
299307}
300308
301- func (s * NetplanSuite ) TestAllEthernetParams (c * gc.C ) {
302- // Make sure we can handle any fields in Ethernet stanzas
309+ func (s * NetplanSuite ) TestBridgesAllParameters (c * gc.C ) {
310+ // All parameters don't inherently make sense at the same time, but we should be able to parse all of them.
311+ checkNetplanRoundTrips (c , `
312+ network:
313+ version: 2
314+ renderer: NetworkManager
315+ ethernets:
316+ id0:
317+ match:
318+ macaddress: "00:11:22:33:44:55"
319+ set-name: id0
320+ id1:
321+ match:
322+ macaddress: de:ad:be:ef:01:02
323+ set-name: id1
324+ id2:
325+ match:
326+ macaddress: de:ad:be:ef:01:03
327+ set-name: id2
328+ bridges:
329+ br-id0:
330+ interfaces: [id0]
331+ accept-ra: true
332+ addresses:
333+ - 123.123.123.123/24
334+ dhcp4: false
335+ dhcp6: true
336+ dhcp-identifier: duid
337+ parameters:
338+ ageing-time: 0
339+ forward-delay: 0
340+ hello-time: 0
341+ max-age: 0
342+ path-cost:
343+ id0: 0
344+ port-priority:
345+ id0: 0
346+ priority: 0
347+ stp: false
348+ br-id1:
349+ interfaces: [id1]
350+ accept-ra: false
351+ addresses:
352+ - 2001::1/64
353+ dhcp4: true
354+ dhcp6: true
355+ dhcp-identifier: mac
356+ parameters:
357+ ageing-time: 100
358+ forward-delay: 10
359+ hello-time: 20
360+ max-age: 10
361+ path-cost:
362+ id1: 50
363+ port-priority:
364+ id1: 50
365+ priority: 20000
366+ stp: true
367+ br-id2:
368+ interfaces: [id2]
369+ br-id3:
370+ interfaces: [id2]
371+ parameters:
372+ ageing-time: 10
373+ ` )
303374}
304375
305376func (s * NetplanSuite ) TestAllRoutesParams (c * gc.C ) {
0 commit comments