summaryrefslogtreecommitdiff
path: root/tests/unittests/test_net.py
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-06-28 16:29:18 -0500
committerScott Moser <smoser@brickies.net>2017-07-20 16:47:12 -0400
commit811ce49d74afb158b2626a201ef5c714d5c9b059 (patch)
tree15cede33ff4ca1fe99fc029864cb1e567029b01f /tests/unittests/test_net.py
parent353c6902fb94899d410eb2f8bcc0bb81916e0e9e (diff)
downloadvyos-cloud-init-811ce49d74afb158b2626a201ef5c714d5c9b059.tar.gz
vyos-cloud-init-811ce49d74afb158b2626a201ef5c714d5c9b059.zip
net: eni route rendering missed ipv6 default route config
In some network configurations a network value of '::' and a netmask value of '::' were used to indicate a default IPV6 gateway. Commit d00da2d5 removed ipv6 'netmask' attributes and calculate a prefix length value instead. The eni route rendering failed to update the check to use prefix value of 0 to indicate the presence of an IPV6 default route. A broken ipv6 default route rendered like: post-up route add -net :: netmask :: gw 2001:4800:78ff:1b::1 || true And with this patch, it now renders like: post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true LP: #1701097
Diffstat (limited to 'tests/unittests/test_net.py')
-rw-r--r--tests/unittests/test_net.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index a9261ebd..d15cd1f4 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -597,6 +597,8 @@ iface br0 inet static
# control-alias br0
iface br0 inet6 static
address 2001:1::1/64
+ post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true
+ pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true
auto bond0.200
iface bond0.200 inet dhcp
@@ -731,6 +733,9 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
eth3: 50
eth4: 75
priority: 22
+ routes:
+ - to: ::/0
+ via: 2001:4800:78ff:1b::1
vlans:
bond0.200:
dhcp4: true
@@ -863,6 +868,10 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
address: 192.168.14.2/24
- type: static
address: 2001:1::1/64 # default to /64
+ routes:
+ - gateway: 2001:4800:78ff:1b::1
+ netmask: '::'
+ network: '::'
# A global nameserver.
- type: nameserver
address: 8.8.8.8