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

Proposed by Lars Kellogg-Stedman
Status: Merged
Approved by: Chad Smith
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 Approve
Server Team CI bot continuous-integration Approve
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.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

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)
Revision history for this message
Scott Moser (smoser) :
review: Approve
Revision history for this message
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
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index fac8267..73f26bb 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -1608,12 +1608,13 @@ iface eth1 inet dhcp
1608 ]1608 ]
1609 self.assertEqual(", ".join(expected_rule) + '\n', contents.lstrip())1609 self.assertEqual(", ".join(expected_rule) + '\n', contents.lstrip())
16101610
1611 @mock.patch("cloudinit.util.get_cmdline")
1611 @mock.patch("cloudinit.util.udevadm_settle")1612 @mock.patch("cloudinit.util.udevadm_settle")
1612 @mock.patch("cloudinit.net.sys_dev_path")1613 @mock.patch("cloudinit.net.sys_dev_path")
1613 @mock.patch("cloudinit.net.read_sys_net")1614 @mock.patch("cloudinit.net.read_sys_net")
1614 @mock.patch("cloudinit.net.get_devicelist")1615 @mock.patch("cloudinit.net.get_devicelist")
1615 def test_unstable_names(self, mock_get_devicelist, mock_read_sys_net,1616 def test_unstable_names(self, mock_get_devicelist, mock_read_sys_net,
1616 mock_sys_dev_path, mock_settle):1617 mock_sys_dev_path, mock_settle, m_get_cmdline):
1617 """verify that udevadm settle is called when we find unstable names"""1618 """verify that udevadm settle is called when we find unstable names"""
1618 devices = {1619 devices = {
1619 'eth0': {1620 'eth0': {
@@ -1629,6 +1630,7 @@ iface eth1 inet dhcp
16291630
1630 }1631 }
16311632
1633 m_get_cmdline.return_value = ''
1632 tmp_dir = self.tmp_dir()1634 tmp_dir = self.tmp_dir()
1633 _setup_test(tmp_dir, mock_get_devicelist,1635 _setup_test(tmp_dir, mock_get_devicelist,
1634 mock_read_sys_net, mock_sys_dev_path,1636 mock_read_sys_net, mock_sys_dev_path,

Subscribers

People subscribed via source and target branches