diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-10-09 14:01:11 +0100 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-10-09 14:01:11 +0100 |
commit | 20dc4190e27c7778cfa6c2943961f2ad27e14b48 (patch) | |
tree | 40cc168db55c00dd58473ce2f5aeeb8322954a52 /tests/unittests/test_datasource/test_azure_helper.py | |
parent | 41900b72f31a1bd0eebe2f58a8598bfab25f0003 (diff) | |
download | vyos-cloud-init-20dc4190e27c7778cfa6c2943961f2ad27e14b48.tar.gz vyos-cloud-init-20dc4190e27c7778cfa6c2943961f2ad27e14b48.zip |
Handle colons in packed strings in WALinuxAgentShim.find_endpoint.
This fixes bug 1488896.
Diffstat (limited to 'tests/unittests/test_datasource/test_azure_helper.py')
-rw-r--r-- | tests/unittests/test_datasource/test_azure_helper.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_azure_helper.py b/tests/unittests/test_datasource/test_azure_helper.py index 68af31cd..5f906837 100644 --- a/tests/unittests/test_datasource/test_azure_helper.py +++ b/tests/unittests/test_datasource/test_azure_helper.py @@ -133,6 +133,13 @@ class TestFindEndpoint(TestCase): self.assertEqual(ip_address, azure_helper.WALinuxAgentShim.find_endpoint()) + def test_packed_string_containing_a_colon(self): + ip_address = '100.72.58.108' + file_content = self._build_lease_content(ip_address, use_hex=False) + self.load_file.return_value = file_content + self.assertEqual(ip_address, + azure_helper.WALinuxAgentShim.find_endpoint()) + def test_latest_lease_used(self): ip_addresses = ['4.3.2.1', '98.76.54.32'] file_content = '\n'.join([self._build_lease_content(ip_address) |