summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-10-09 14:01:11 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2015-10-09 14:01:11 +0100
commit20dc4190e27c7778cfa6c2943961f2ad27e14b48 (patch)
tree40cc168db55c00dd58473ce2f5aeeb8322954a52 /tests
parent41900b72f31a1bd0eebe2f58a8598bfab25f0003 (diff)
downloadvyos-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')
-rw-r--r--tests/unittests/test_datasource/test_azure_helper.py7
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)