Merge ~larsks/cloud-init:bug/1769952 into cloud-init:master

Proposed by Lars Kellogg-Stedman on 2018-05-08
Status: Merged
Approved by: Chad Smith on 2018-05-10
Approved revision: fbb5c779eefe6085bd0dfd07bf2867bd3faf2f4a
Merge reported by: Chad Smith
Merged at revision: 3b712fcea9ca685c5cb761ea19c5126acf8ffaa1
Proposed branch: ~larsks/cloud-init:bug/1769952
Merge into: cloud-init:master
Diff against target: 27 lines (+3/-1)
1 file modified
tests/unittests/test_net.py (+3/-1)
Reviewer Review Type Date Requested Status
Scott Moser 2018-05-08 Approve on 2018-05-08
Server Team CI bot continuous-integration Approve on 2018-05-08
Review via email: mp+345248@code.launchpad.net

Commit message

tests: do not rely on host /proc/cmdline in test_net.py

Make test_net.TestGenerateFallbackConfig.test_unstable_names mock
the value of /proc/cmdline in the same way as the existing
test_unstable_names_disabled test.

LP: #1769952

To post a comment you must log in.

PASSED: Continuous integration, rev:fbb5c779eefe6085bd0dfd07bf2867bd3faf2f4a
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1105/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1105/rebuild

review: Approve (continuous-integration)
Scott Moser (smoser) :
review: Approve
Chad Smith (chad.smith) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=3b712fce

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
2index fac8267..73f26bb 100644
3--- a/tests/unittests/test_net.py
4+++ b/tests/unittests/test_net.py
5@@ -1608,12 +1608,13 @@ iface eth1 inet dhcp
6 ]
7 self.assertEqual(", ".join(expected_rule) + '\n', contents.lstrip())
8
9+ @mock.patch("cloudinit.util.get_cmdline")
10 @mock.patch("cloudinit.util.udevadm_settle")
11 @mock.patch("cloudinit.net.sys_dev_path")
12 @mock.patch("cloudinit.net.read_sys_net")
13 @mock.patch("cloudinit.net.get_devicelist")
14 def test_unstable_names(self, mock_get_devicelist, mock_read_sys_net,
15- mock_sys_dev_path, mock_settle):
16+ mock_sys_dev_path, mock_settle, m_get_cmdline):
17 """verify that udevadm settle is called when we find unstable names"""
18 devices = {
19 'eth0': {
20@@ -1629,6 +1630,7 @@ iface eth1 inet dhcp
21
22 }
23
24+ m_get_cmdline.return_value = ''
25 tmp_dir = self.tmp_dir()
26 _setup_test(tmp_dir, mock_get_devicelist,
27 mock_read_sys_net, mock_sys_dev_path,

Subscribers

People subscribed via source and target branches