summaryrefslogtreecommitdiff
path: root/tests/unittests/test_util.py
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2020-03-26 16:07:51 -0400
committerGitHub <noreply@github.com>2020-03-26 16:07:51 -0400
commit44039629e539ed48298703028ac8f10ad3c60d6e (patch)
treec806fe54818f44148e6e37bf02cac1ea1e868610 /tests/unittests/test_util.py
parent4c88d9341e75a1a14ba2e8bd0ab309e265229f7e (diff)
downloadvyos-cloud-init-44039629e539ed48298703028ac8f10ad3c60d6e.tar.gz
vyos-cloud-init-44039629e539ed48298703028ac8f10ad3c60d6e.zip
add Openbsd support (#147)
- tested on OpenBSD 6.6 - tested on OpenStack without config drive, and NoCloud with ISO config drive
Diffstat (limited to 'tests/unittests/test_util.py')
-rw-r--r--tests/unittests/test_util.py19
1 files changed, 19 insertions, 0 deletions
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