From 192dbda37b50aa97f87976879dd177834a986123 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 21 Mar 2017 09:50:28 -0400 Subject: 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. --- tests/unittests/test_distros/test_netconfig.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3