diff options
author | Harald Jensås <hjensas@redhat.com> | 2019-10-31 16:15:27 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-10-31 16:15:27 +0000 |
commit | fcc92ad15199318abfad067c63f5ab941addc720 (patch) | |
tree | a455e1290e9ade92052cd1cde9c71ee6490a45c8 /tests/unittests/test_net.py | |
parent | a61ee02a50eb21954c114e01d2d042916bb2dc14 (diff) | |
download | vyos-cloud-init-fcc92ad15199318abfad067c63f5ab941addc720.tar.gz vyos-cloud-init-fcc92ad15199318abfad067c63f5ab941addc720.zip |
net: fix subnet_is_ipv6() for stateless|stateful
Function return false for ipv6_dhcpv6-stateless|stateful,
the eni renderer does not add '6' to 'inet' which is
incorrect.
The subnet_is_ipv6() function is updated to also return
true if startswith('ipv6').
LP: #1848690
Diffstat (limited to 'tests/unittests/test_net.py')
-rw-r--r-- | tests/unittests/test_net.py | 16 |
1 files changed, 16 insertions, 0 deletions
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'. |