diff options
author | Kurt Garloff <kurt@garloff.de> | 2018-03-21 20:07:29 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-03-21 20:07:29 -0600 |
commit | 7713713265224d9f34410028de6bd50d1451aed9 (patch) | |
tree | 82f175552d3e27ad80a044e6224ae8da8b18d4b2 /tests/unittests/test_ds_identify.py | |
parent | 685f9901b820a457912959bdd4f389835e965524 (diff) | |
download | vyos-cloud-init-7713713265224d9f34410028de6bd50d1451aed9.tar.gz vyos-cloud-init-7713713265224d9f34410028de6bd50d1451aed9.zip |
Identify OpenTelekomCloud Xen as OpenStack DS.
Open Telekom Cloud gen1 (Xen) hosts do not provide nova product
names in DMI but Xen HVM domU. They can however be safely identified
by the OpenTelekomCloud Chassis asset tag. OpenTelekomCloud does
use the network OpenStack DataSource, so we better detect it.
LP: #1756471
Diffstat (limited to 'tests/unittests/test_ds_identify.py')
-rw-r--r-- | tests/unittests/test_ds_identify.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py index 9c5628e7..85999b7a 100644 --- a/tests/unittests/test_ds_identify.py +++ b/tests/unittests/test_ds_identify.py @@ -66,6 +66,7 @@ P_DSID_CFG = "etc/cloud/ds-identify.cfg" MOCK_VIRT_IS_KVM = {'name': 'detect_virt', 'RET': 'kvm', 'ret': 0} MOCK_VIRT_IS_VMWARE = {'name': 'detect_virt', 'RET': 'vmware', 'ret': 0} +MOCK_VIRT_IS_XEN = {'name': 'detect_virt', 'RET': 'xen', 'ret': 0} MOCK_UNAME_IS_PPC64 = {'name': 'uname', 'out': UNAME_PPC64EL, 'ret': 0} @@ -291,6 +292,10 @@ class TestDsIdentify(CiTestCase): """On Intel, openstack must be identified.""" self._test_ds_found('OpenStack') + def test_openstack_open_telekom_cloud(self): + """Open Telecom identification.""" + self._test_ds_found('OpenStack-OpenTelekom') + def test_openstack_on_non_intel_is_maybe(self): """On non-Intel, openstack without dmi info is maybe. @@ -502,6 +507,12 @@ VALID_CFG = { 'policy_dmi': POLICY_FOUND_ONLY, 'policy_no_dmi': POLICY_FOUND_ONLY, }, + 'OpenStack-OpenTelekom': { + # OTC gen1 (Xen) hosts use OpenStack datasource, LP: #1756471 + 'ds': 'OpenStack', + 'files': {P_CHASSIS_ASSET_TAG: 'OpenTelekomCloud\n'}, + 'mocks': [MOCK_VIRT_IS_XEN], + }, 'OVF-seed': { 'ds': 'OVF', 'files': { |