Merge ~sdhd/curtin:master into curtin:master

Proposed by Sascha Dewald
Status: Needs review
Proposed branch: ~sdhd/curtin:master
Merge into: curtin:master
Diff against target: 37 lines (+0/-26)
1 file modified
tests/unittests/test_block.py (+0/-26)
Reviewer Review Type Date Requested Status
Ryan Harper Pending
Review via email: mp+374762@code.launchpad.net

Commit message

revert test_lookup_disk_wwn

Description of the change

the deleted test is obsolete if we merge lp:~sdhd/devel-pyudev.

because, the function lookup_disk can now handle both ( serial & wwn )

https://code.launchpad.net/~sdhd/curtin/+git/curtin/+ref/devel-pyudev

To post a comment you must log in.

Unmerged commits

171b5b2... by Sascha Dewald

remove test_lookup_disk_wwn, because with pyudev it is duplicate

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/tests/unittests/test_block.py b/tests/unittests/test_block.py
index e70503d..167a697 100644
--- a/tests/unittests/test_block.py
+++ b/tests/unittests/test_block.py
@@ -103,32 +103,6 @@ class TestBlock(CiTestCase):
103 mock_os_listdir.return_value = ["other"]103 mock_os_listdir.return_value = ["other"]
104 block.lookup_disk(serial)104 block.lookup_disk(serial)
105105
106 @mock.patch("curtin.block.multipath")
107 @mock.patch("curtin.block.os.path.realpath")
108 @mock.patch("curtin.block.os.path.exists")
109 @mock.patch("curtin.block.os.listdir")
110 def test_lookup_disk_find_wwn(self, mock_os_listdir, mock_os_path_exists,
111 mock_os_path_realpath, mock_mpath):
112 wwn = "eui.0025388b710116a1"
113 expected_link = 'nvme-%s' % wwn
114 device = '/wark/nvme0n1'
115 mock_os_listdir.return_value = [
116 "nvme-eui.0025388b710116a1",
117 "nvme-eui.0025388b710116a1-part1",
118 "nvme-eui.0025388b710116a1-part2",
119 ]
120 mock_os_path_exists.return_value = True
121 mock_os_path_realpath.return_value = device
122 mock_mpath.is_mpath_device.return_value = False
123
124 path = block.lookup_disk(wwn)
125
126 mock_os_listdir.assert_called_with("/dev/disk/by-id/")
127 mock_os_path_realpath.assert_called_with("/dev/disk/by-id/" +
128 expected_link)
129 self.assertTrue(mock_os_path_exists.called)
130 self.assertEqual(device, path)
131
132 @mock.patch('curtin.block.udevadm_info')106 @mock.patch('curtin.block.udevadm_info')
133 def test_get_device_mapper_links_returns_first_non_none(self, m_info):107 def test_get_device_mapper_links_returns_first_non_none(self, m_info):
134 """ get_device_mapper_links returns first by sort entry in DEVLINKS."""108 """ get_device_mapper_links returns first by sort entry in DEVLINKS."""

Subscribers

People subscribed via source and target branches