From 7713713265224d9f34410028de6bd50d1451aed9 Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Wed, 21 Mar 2018 20:07:29 -0600 Subject: 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 --- tests/unittests/test_ds_identify.py | 11 +++++++++++ tools/ds-identify | 4 ++++ 2 files changed, 15 insertions(+) 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': { diff --git a/tools/ds-identify b/tools/ds-identify index e3f93c90..e2552c8b 100755 --- a/tools/ds-identify +++ b/tools/ds-identify @@ -894,6 +894,10 @@ dscheck_OpenStack() { return ${DS_FOUND} fi + if dmi_chassis_asset_tag_matches "OpenTelekomCloud"; then + return ${DS_FOUND} + fi + # LP: #1715241 : arch other than intel are not identified properly. case "$DI_UNAME_MACHINE" in i?86|x86_64) :;; -- cgit v1.2.3