From 24739592217e5ba91e09e8c28b852d31a2c0cc77 Mon Sep 17 00:00:00 2001 From: Gonéri Le Bouder Date: Thu, 9 Dec 2021 17:46:27 -0500 Subject: find_devs/openbsd: accept ISO on disk (#1132) When the metadata is an ISO image and is exposed through a disk, the device is called `/dev/sd?a` internally. For instance `/dev/sd1a`. It can then be mounted with `mount_cd9660 /dev/sd1a /mnt`. Metadata in the FAT32 format are exposed as `/dev/sd?i`. With this change, we try to mount `/dev/sd?a` in addition to `/dev/sd?i`. Closes: https://github.com/ContainerCraft/kmi/issues/12 --- tests/unittests/test_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index eab374bc..c551835f 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -2330,7 +2330,7 @@ class TestFindDevs: def test_find_devs_with_openbsd(self, m_subp): m_subp.return_value = ('cd0:,sd0:630d98d32b5d3759,sd1:,fd0:', '') devlist = util.find_devs_with_openbsd() - assert devlist == ['/dev/cd0a', '/dev/sd1i'] + assert devlist == ['/dev/cd0a', '/dev/sd1a', '/dev/sd1i'] @mock.patch('cloudinit.subp.subp') def test_find_devs_with_openbsd_with_criteria(self, m_subp): @@ -2340,7 +2340,7 @@ class TestFindDevs: # lp: #1841466 devlist = util.find_devs_with_openbsd(criteria="LABEL_FATBOOT=A_LABEL") - assert devlist == ['/dev/cd0a', '/dev/sd1i'] + assert devlist == ['/dev/cd0a', '/dev/sd1a', '/dev/sd1i'] @pytest.mark.parametrize( 'criteria,expected_devlist', -- cgit v1.2.3