From 44039629e539ed48298703028ac8f10ad3c60d6e Mon Sep 17 00:00:00 2001 From: Gonéri Le Bouder Date: Thu, 26 Mar 2020 16:07:51 -0400 Subject: add Openbsd support (#147) - tested on OpenBSD 6.6 - tested on OpenStack without config drive, and NoCloud with ISO config drive --- tests/unittests/test_util.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index 5b2eaa69..2900997b 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -1171,4 +1171,23 @@ class TestGetProcEnv(helpers.TestCase): my_ppid = os.getppid() self.assertEqual(my_ppid, util.get_proc_ppid(my_pid)) + +@mock.patch('cloudinit.util.subp') +def test_find_devs_with_openbsd(m_subp): + m_subp.return_value = ( + 'cd0:,sd0:630d98d32b5d3759,sd1:,fd0:', '' + ) + devlist = util.find_devs_with_openbsd() + assert devlist == ['/dev/cd0a', '/dev/sd1i'] + + +@mock.patch('cloudinit.util.subp') +def test_find_devs_with_openbsd_with_criteria(m_subp): + m_subp.return_value = ( + 'cd0:,sd0:630d98d32b5d3759,sd1:,fd0:', '' + ) + devlist = util.find_devs_with_openbsd(criteria="TYPE=iso9660") + assert devlist == ['/dev/cd0a'] + + # vi: ts=4 expandtab -- cgit v1.2.3