summaryrefslogtreecommitdiff
path: root/tests/unittests/test_ds_identify.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-08-17 20:25:31 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2018-08-17 20:25:31 +0000
commitaaffd59431fe05932a66016db941fe197c4e7620 (patch)
tree5560ef84c35ca20150c2e5780268b2830962acf4 /tests/unittests/test_ds_identify.py
parent47548df9ded4ad4088d3d846f1876b29b16aa7d1 (diff)
downloadvyos-cloud-init-aaffd59431fe05932a66016db941fe197c4e7620.tar.gz
vyos-cloud-init-aaffd59431fe05932a66016db941fe197c4e7620.zip
Add datasource Oracle Compute Infrastructure (OCI).
This adds a Oracle specific datasource that functions with OCI. It is a simplified version of the OpenStack metadata server with support for vendor-data. It does not support the OCI-C (classic) platform. Also here is a move of BrokenMetadata to common 'sources' as this was the third occurrence of that class.
Diffstat (limited to 'tests/unittests/test_ds_identify.py')
-rw-r--r--tests/unittests/test_ds_identify.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
index 64d9f9f8..e08e7908 100644
--- a/tests/unittests/test_ds_identify.py
+++ b/tests/unittests/test_ds_identify.py
@@ -12,6 +12,7 @@ from cloudinit.tests.helpers import (
from cloudinit.sources import DataSourceIBMCloud as ds_ibm
from cloudinit.sources import DataSourceSmartOS as ds_smartos
+from cloudinit.sources import DataSourceOracle as ds_oracle
UNAME_MYSYS = ("Linux bart 4.4.0-62-generic #83-Ubuntu "
"SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 GNU/Linux")
@@ -598,6 +599,18 @@ class TestIsIBMProvisioning(DsIdentifyBase):
self.assertIn("from current boot", ret.stderr)
+class TestOracle(DsIdentifyBase):
+ def test_found_by_chassis(self):
+ """Simple positive test of Oracle by chassis id."""
+ self._test_ds_found('Oracle')
+
+ def test_not_found(self):
+ """Simple negative test of Oracle."""
+ mycfg = copy.deepcopy(VALID_CFG['Oracle'])
+ mycfg['files'][P_CHASSIS_ASSET_TAG] = "Not Oracle"
+ self._check_via_dict(mycfg, rc=RC_NOT_FOUND)
+
+
def blkid_out(disks=None):
"""Convert a list of disk dictionaries into blkid content."""
if disks is None:
@@ -838,6 +851,12 @@ VALID_CFG = {
},
],
},
+ 'Oracle': {
+ 'ds': 'Oracle',
+ 'files': {
+ P_CHASSIS_ASSET_TAG: ds_oracle.CHASSIS_ASSET_TAG + '\n',
+ }
+ },
'SmartOS-bhyve': {
'ds': 'SmartOS',
'mocks': [