diff options
author | Silvio Knizek <killermoehre@gmx.net> | 2020-03-26 22:15:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 17:15:37 -0400 |
commit | 7f9f33dbb08bacaa49244e857847400ad8a67ad4 (patch) | |
tree | 8d7b86d84ffd9a0cc0ce93d468d2b412f06ceda6 /tests/unittests/test_datasource/test_openstack.py | |
parent | 44039629e539ed48298703028ac8f10ad3c60d6e (diff) | |
download | vyos-cloud-init-7f9f33dbb08bacaa49244e857847400ad8a67ad4.tar.gz vyos-cloud-init-7f9f33dbb08bacaa49244e857847400ad8a67ad4.zip |
Identify SAP Converged Cloud as OpenStack
add SAP Converged Cloud as cloud provider
Diffstat (limited to 'tests/unittests/test_datasource/test_openstack.py')
-rw-r--r-- | tests/unittests/test_datasource/test_openstack.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py index f754556f..b534457c 100644 --- a/tests/unittests/test_datasource/test_openstack.py +++ b/tests/unittests/test_datasource/test_openstack.py @@ -510,6 +510,24 @@ class TestDetectOpenStack(test_helpers.CiTestCase): 'Expected detect_openstack == True on OpenTelekomCloud') @test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data') + def test_detect_openstack_sapccloud_chassis_asset_tag(self, m_dmi, + m_is_x86): + """Return True on OpenStack reporting SAP CCloud VM asset-tag.""" + m_is_x86.return_value = True + + def fake_dmi_read(dmi_key): + if dmi_key == 'system-product-name': + return 'VMware Virtual Platform' # SAP CCloud uses VMware + if dmi_key == 'chassis-asset-tag': + return 'SAP CCloud VM' + assert False, 'Unexpected dmi read of %s' % dmi_key + + m_dmi.side_effect = fake_dmi_read + self.assertTrue( + ds.detect_openstack(), + 'Expected detect_openstack == True on SAP CCloud VM') + + @test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data') def test_detect_openstack_oraclecloud_chassis_asset_tag(self, m_dmi, m_is_x86): """Return True on OpenStack reporting Oracle cloud asset-tag.""" |