summaryrefslogtreecommitdiff
path: root/cloudinit/sources/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2020-11-02 15:41:11 -0500
committerGitHub <noreply@github.com>2020-11-02 15:41:11 -0500
commit0af1ff1eaf593c325b4f53181a572110eb016c50 (patch)
tree2e0dab084dffd4664a6320f15baf374aff008917 /cloudinit/sources/tests
parentd619f5171ac0ce5b626ef4575ad5f4468e94c987 (diff)
downloadvyos-cloud-init-0af1ff1eaf593c325b4f53181a572110eb016c50.tar.gz
vyos-cloud-init-0af1ff1eaf593c325b4f53181a572110eb016c50.zip
cloudinit: move dmi functions out of util (#622)
This just separates the reading of dmi values into its own file. Some things of note: * left import of util in dmi.py only for 'is_container' It'd be good if is_container was not in util. * just the use of 'util.is_x86' to dmi.py * open() is used directly rather than load_file.
Diffstat (limited to 'cloudinit/sources/tests')
-rw-r--r--cloudinit/sources/tests/test_oracle.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/sources/tests/test_oracle.py b/cloudinit/sources/tests/test_oracle.py
index 7bd23813..a7bbdfd9 100644
--- a/cloudinit/sources/tests/test_oracle.py
+++ b/cloudinit/sources/tests/test_oracle.py
@@ -153,20 +153,20 @@ class TestDataSourceOracle:
class TestIsPlatformViable(test_helpers.CiTestCase):
- @mock.patch(DS_PATH + ".util.read_dmi_data",
+ @mock.patch(DS_PATH + ".dmi.read_dmi_data",
return_value=oracle.CHASSIS_ASSET_TAG)
def test_expected_viable(self, m_read_dmi_data):
"""System with known chassis tag is viable."""
self.assertTrue(oracle._is_platform_viable())
m_read_dmi_data.assert_has_calls([mock.call('chassis-asset-tag')])
- @mock.patch(DS_PATH + ".util.read_dmi_data", return_value=None)
+ @mock.patch(DS_PATH + ".dmi.read_dmi_data", return_value=None)
def test_expected_not_viable_dmi_data_none(self, m_read_dmi_data):
"""System without known chassis tag is not viable."""
self.assertFalse(oracle._is_platform_viable())
m_read_dmi_data.assert_has_calls([mock.call('chassis-asset-tag')])
- @mock.patch(DS_PATH + ".util.read_dmi_data", return_value="LetsGoCubs")
+ @mock.patch(DS_PATH + ".dmi.read_dmi_data", return_value="LetsGoCubs")
def test_expected_not_viable_other(self, m_read_dmi_data):
"""System with unnown chassis tag is not viable."""
self.assertFalse(oracle._is_platform_viable())