diff options
author | Douglas Jordan <dojordan@microsoft.com> | 2018-01-24 16:10:08 -0700 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-01-24 16:10:08 -0700 |
commit | c03bdd3d8ed762cada813c5e95a40b14d2047b57 (patch) | |
tree | 708422bb64a8804f649ad7558d5088f9e11011a4 /tests/unittests/test_net.py | |
parent | 30597f28512fafbe25486df5865b628d859486c6 (diff) | |
download | vyos-cloud-init-c03bdd3d8ed762cada813c5e95a40b14d2047b57.tar.gz vyos-cloud-init-c03bdd3d8ed762cada813c5e95a40b14d2047b57.zip |
Azure VM Preprovisioning support.
This change will enable azure vms to report provisioning has completed
twice, first to tell the fabric it has completed then a second time to
enable customer settings. The datasource for the second provisioning is
the Instance Metadata Service (IMDS),and the VM will poll indefinitely for
the new ovf-env.xml from IMDS.
This branch introduces EphemeralDHCPv4 which encapsulates common logic
used by both DataSourceEc2 an DataSourceAzure for temporary DHCP
interactions without side-effects.
LP: #1734991
Diffstat (limited to 'tests/unittests/test_net.py')
-rw-r--r-- | tests/unittests/test_net.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index ddea13d7..ac33e8ef 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -2948,4 +2948,16 @@ class TestRenameInterfaces(CiTestCase): mock_subp.assert_has_calls(expected) +class TestNetworkState(CiTestCase): + + def test_bcast_addr(self): + """Test mask_and_ipv4_to_bcast_addr proper execution.""" + bcast_addr = network_state.mask_and_ipv4_to_bcast_addr + self.assertEqual("192.168.1.255", + bcast_addr("255.255.255.0", "192.168.1.1")) + self.assertEqual("128.42.7.255", + bcast_addr("255.255.248.0", "128.42.5.4")) + self.assertEqual("10.1.21.255", + bcast_addr("255.255.255.0", "10.1.21.4")) + # vi: ts=4 expandtab |