Merge ~smoser/cloud-init:fix-test_netconfig into cloud-init:master

Proposed by Scott Moser on 2017-03-21
Status: Merged
Merged at revision: 192dbda37b50aa97f87976879dd177834a986123
Proposed branch: ~smoser/cloud-init:fix-test_netconfig
Merge into: cloud-init:master
Diff against target: 13 lines (+3/-0)
1 file modified
tests/unittests/test_distros/test_netconfig.py (+3/-0)
Reviewer Review Type Date Requested Status
Ryan Harper 2017-03-21 Approve on 2017-03-21
Server Team CI bot continuous-integration Approve on 2017-03-21
Joshua Powers (community) Approve on 2017-03-21
Review via email: mp+320495@code.launchpad.net

Commit Message

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.

To post a comment you must log in.
Joshua Powers (powersj) wrote :

Tested and working on torkoal. Thanks!

review: Approve
Ryan Harper (raharper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py
2index b89b74f..8837066 100644
3--- a/tests/unittests/test_distros/test_netconfig.py
4+++ b/tests/unittests/test_distros/test_netconfig.py
5@@ -236,6 +236,9 @@ class TestNetCfgDistro(TestCase):
6 mock.patch.object(util, 'write_file', replace_write))
7 mocks.enter_context(
8 mock.patch.object(os.path, 'isfile', return_value=False))
9+ mocks.enter_context(
10+ mock.patch("cloudinit.net.eni.glob.glob",
11+ return_value=[]))
12
13 ub_distro.apply_network_config(V1_NET_CFG, False)
14

Subscribers

People subscribed via source and target branches

to all changes: