summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2021-10-19 02:09:40 +0200
committerGitHub <noreply@github.com>2021-10-18 19:09:40 -0500
commita0a68a24c34ee268962e7a3c3844c59ab4036bf9 (patch)
treeff5620ffc3001af98c446d789f2ad50aa54334a6 /tests
parent70f0ee78ce4926cb79f37e13568deba298321016 (diff)
downloadvyos-cloud-init-a0a68a24c34ee268962e7a3c3844c59ab4036bf9.tar.gz
vyos-cloud-init-a0a68a24c34ee268962e7a3c3844c59ab4036bf9.zip
VMware: read network-config from ISO (#1066)
There is no reason for the ISO missing this functionality. As discussed in https://github.com/canonical/cloud-init/pull/947/files#r707338489
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_datasource/test_ovf.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/unittests/test_datasource/test_ovf.py b/tests/unittests/test_datasource/test_ovf.py
index 2ca10781..f5818a3a 100644
--- a/tests/unittests/test_datasource/test_ovf.py
+++ b/tests/unittests/test_datasource/test_ovf.py
@@ -519,6 +519,12 @@ class TestDatasourceOVF(CiTestCase):
ds.subplatform)
def test_get_data_vmware_guestinfo_with_network_config(self):
+ self._test_get_data_with_network_config(guestinfo=False, iso=True)
+
+ def test_get_data_iso9660_with_network_config(self):
+ self._test_get_data_with_network_config(guestinfo=True, iso=False)
+
+ def _test_get_data_with_network_config(self, guestinfo, iso):
network_config = dedent("""\
network:
version: 2
@@ -544,9 +550,9 @@ class TestDatasourceOVF(CiTestCase):
paths = Paths({'cloud_dir': self.tdir, 'run_dir': self.tdir})
ds = self.datasource(sys_cfg={}, distro={}, paths=paths)
with mock.patch(MPATH + 'transport_vmware_guestinfo',
- return_value=env):
+ return_value=env if guestinfo else NOT_FOUND):
with mock.patch(MPATH + 'transport_iso9660',
- return_value=NOT_FOUND):
+ return_value=env if iso else NOT_FOUND):
self.assertTrue(ds.get_data())
self.assertEqual('inst-001', ds.metadata['instance-id'])
self.assertEqual(