summaryrefslogtreecommitdiff
path: root/tests/unittests/test_distros/test_netconfig.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-21 09:50:28 -0400
committerScott Moser <smoser@brickies.net>2017-03-21 09:50:28 -0400
commit192dbda37b50aa97f87976879dd177834a986123 (patch)
tree0ee88dcb12a367b9fd04d9a1261dcb172632e751 /tests/unittests/test_distros/test_netconfig.py
parent86715c88aab8561e1ddadac95671f6095d16f9e7 (diff)
downloadvyos-cloud-init-192dbda37b50aa97f87976879dd177834a986123.tar.gz
vyos-cloud-init-192dbda37b50aa97f87976879dd177834a986123.zip
Fix unit test when running in a system deployed with cloud-init.
test_netconfig.py:test_apply_network_config_eni_ub would attempt to remove any .link files that cloud-init had written. This was just a failure to mock out all of its interaction with the host.
Diffstat (limited to 'tests/unittests/test_distros/test_netconfig.py')
-rw-r--r--tests/unittests/test_distros/test_netconfig.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py
index b89b74ff..88370669 100644
--- a/tests/unittests/test_distros/test_netconfig.py
+++ b/tests/unittests/test_distros/test_netconfig.py
@@ -236,6 +236,9 @@ class TestNetCfgDistro(TestCase):
mock.patch.object(util, 'write_file', replace_write))
mocks.enter_context(
mock.patch.object(os.path, 'isfile', return_value=False))
+ mocks.enter_context(
+ mock.patch("cloudinit.net.eni.glob.glob",
+ return_value=[]))
ub_distro.apply_network_config(V1_NET_CFG, False)