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
1diff --git a/tests/unittests/test_block.py b/tests/unittests/test_block.py
2index e70503d..167a697 100644
3--- a/tests/unittests/test_block.py
4+++ b/tests/unittests/test_block.py
5@@ -103,32 +103,6 @@ class TestBlock(CiTestCase):
6 mock_os_listdir.return_value = ["other"]
7 block.lookup_disk(serial)
8
9- @mock.patch("curtin.block.multipath")
10- @mock.patch("curtin.block.os.path.realpath")
11- @mock.patch("curtin.block.os.path.exists")
12- @mock.patch("curtin.block.os.listdir")
13- def test_lookup_disk_find_wwn(self, mock_os_listdir, mock_os_path_exists,
14- mock_os_path_realpath, mock_mpath):
15- wwn = "eui.0025388b710116a1"
16- expected_link = 'nvme-%s' % wwn
17- device = '/wark/nvme0n1'
18- mock_os_listdir.return_value = [
19- "nvme-eui.0025388b710116a1",
20- "nvme-eui.0025388b710116a1-part1",
21- "nvme-eui.0025388b710116a1-part2",
22- ]
23- mock_os_path_exists.return_value = True
24- mock_os_path_realpath.return_value = device
25- mock_mpath.is_mpath_device.return_value = False
26-
27- path = block.lookup_disk(wwn)
28-
29- mock_os_listdir.assert_called_with("/dev/disk/by-id/")
30- mock_os_path_realpath.assert_called_with("/dev/disk/by-id/" +
31- expected_link)
32- self.assertTrue(mock_os_path_exists.called)
33- self.assertEqual(device, path)
34-
35 @mock.patch('curtin.block.udevadm_info')
36 def test_get_device_mapper_links_returns_first_non_none(self, m_info):
37 """ get_device_mapper_links returns first by sort entry in DEVLINKS."""

Subscribers

People subscribed via source and target branches