From f4692c5d96323dc635fca26b742199d4c41f88d3 Mon Sep 17 00:00:00 2001 From: Gonéri Le Bouder Date: Mon, 13 Dec 2021 12:31:39 -0500 Subject: find_devs_with_openbsd: ensure we return the last entry (#1149) `sysctl -n hw.disknames` returns a trailing `\n`. We need to clean this up. In addition, the criteria matching system is a source of problem because: - we don't have a way to look up the label of the partition - we've got situation where an ISO image can be exposed through a virtio block device. So we just totally ignore the value of `criteria`. We end-up with a slightly longer loop of mount-retry. But this way we're sure we don't miss a configuration disk. Tested on Kubvirt with the help of Brady Pratt @jbpratt. --- tests/unittests/test_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index c551835f..61b9e303 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -2336,7 +2336,7 @@ class TestFindDevs: def test_find_devs_with_openbsd_with_criteria(self, m_subp): m_subp.return_value = ('cd0:,sd0:630d98d32b5d3759,sd1:,fd0:', '') devlist = util.find_devs_with_openbsd(criteria="TYPE=iso9660") - assert devlist == ['/dev/cd0a'] + assert devlist == ['/dev/cd0a', '/dev/sd1a', '/dev/sd1i'] # lp: #1841466 devlist = util.find_devs_with_openbsd(criteria="LABEL_FATBOOT=A_LABEL") -- cgit v1.2.3