summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/net/network_state.py4
-rw-r--r--tests/unittests/test_net.py16
2 files changed, 18 insertions, 2 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
index b485f3d9..ba85c69e 100644
--- a/cloudinit/net/network_state.py
+++ b/cloudinit/net/network_state.py
@@ -919,8 +919,8 @@ def is_ipv6_addr(address):
def subnet_is_ipv6(subnet):
"""Common helper for checking network_state subnets for ipv6."""
- # 'static6' or 'dhcp6'
- if subnet['type'].endswith('6'):
+ # 'static6', 'dhcp6', 'ipv6_dhcpv6-stateful' or 'ipv6_dhcpv6-stateless'
+ if subnet['type'].endswith('6') or subnet['type'].startswith('ipv6'):
# This is a request for DHCPv6.
return True
elif subnet['type'] == 'static' and is_ipv6_addr(subnet.get('address')):
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 21604b12..6f83ad73 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -4098,6 +4098,22 @@ class TestEniRoundTrip(CiTestCase):
entry['expected_eni'].splitlines(),
files['/etc/network/interfaces'].splitlines())
+ def testsimple_render_dhcpv6_stateless(self):
+ entry = NETWORK_CONFIGS['dhcpv6_stateless']
+ files = self._render_and_read(network_config=yaml.load(
+ entry['yaml']))
+ self.assertEqual(
+ entry['expected_eni'].splitlines(),
+ files['/etc/network/interfaces'].splitlines())
+
+ def testsimple_render_dhcpv6_stateful(self):
+ entry = NETWORK_CONFIGS['dhcpv6_stateless']
+ files = self._render_and_read(network_config=yaml.load(
+ entry['yaml']))
+ self.assertEqual(
+ entry['expected_eni'].splitlines(),
+ files['/etc/network/interfaces'].splitlines())
+
def testsimple_render_manual(self):
"""Test rendering of 'manual' for 'type' and 'control'.