diff options
author | Delia Popescu <delia.popescu@enea.com> | 2018-10-09 12:03:58 +0300 |
---|---|---|
committer | Delia Popescu <delia.popescu@enea.com> | 2018-10-16 13:51:00 +0000 |
commit | 0cdc153207e76cb6e43a5aa3297a7dc39e5b48a5 (patch) | |
tree | c0ebba700fe124e694cb959147dc15234bac6a85 | |
parent | 68d82378787544cac8886bd719b9ada2765e24cb (diff) |
Ease configuring extra specs via env vars
Ease configuring flavor extra specs, as well as
image extra specs.
Set environment variables for image_properties and
flavor extra_specs for ovs|fdio scenario from the start.
Image extra_properties and flavor extra_specs
will continue to get updates from functest config file
but so will from IMAGE_PROPERTIES and FLAVOR_EXTRA_SPECS
env variables.
Change-Id: Ie1c69e66d2e2e158915d214402fe44d9991c56d3
Signed-off-by: Delia Popescu <delia.popescu@enea.com>
(cherry picked from commit 1a00b9de56ef65eef2a0b269a514cb25491ac54b)
-rw-r--r-- | functest/ci/config_patch.yaml | 176 | ||||
-rw-r--r-- | functest/core/singlevm.py | 8 | ||||
-rw-r--r-- | functest/tests/unit/utils/test_functest_utils.py | 3 | ||||
-rw-r--r-- | functest/utils/env.py | 1 | ||||
-rw-r--r-- | functest/utils/functest_utils.py | 2 |
5 files changed, 13 insertions, 177 deletions
diff --git a/functest/ci/config_patch.yaml b/functest/ci/config_patch.yaml index 3acb35553..42220832e 100644 --- a/functest/ci/config_patch.yaml +++ b/functest/ci/config_patch.yaml @@ -1,277 +1,101 @@ --- fdio: general: - flavor_extra_specs: {'hw:mem_page_size':'large'} - image_properties: {'hw_mem_page_size':'large'} openstack: flavor_ram: 1024 snaps: flavor_extra_specs: {'hw:mem_page_size':'large'} vmready1: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vmready2: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 singlevm1: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 singlevm2: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vping_ssh: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vping_userdata: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 cinder_test: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_smoke: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 neutron-tempest-plugin-api: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 refstack_defcore: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 patrole: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vmtp: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 2048 shaker: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 neutron_trunk: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 networking-bgpvpn: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 networking-sfc: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 barbican: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_full: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_scenario: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 rally_sanity: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 rally_full: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 - cloudify: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - cloudify_ims: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - heat_ims: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - vyos_vrouter: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - juju_epc: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} ovs: general: - flavor_extra_specs: {'hw:mem_page_size':'large'} - image_properties: {'hw_mem_page_size':'large'} openstack: flavor_ram: 1024 snaps: flavor_extra_specs: {'hw:mem_page_size':'large'} vmready1: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vmready2: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 singlevm1: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 singlevm2: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vping_ssh: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vping_userdata: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 cinder_test: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_smoke: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 neutron-tempest-plugin-api: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 refstack_defcore: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 patrole: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 vmtp: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 2048 shaker: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 neutron_trunk: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 networking-bgpvpn: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 networking-sfc: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 barbican: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_full: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 tempest_scenario: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 rally_sanity: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 rally_full: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} flavor_ram: 1024 - cloudify: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - cloudify_ims: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - heat_ims: - flavor_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - vyos_vrouter: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} - juju_epc: - flavor_extra_specs: {'hw:mem_page_size':'large'} - flavor_alt_extra_specs: {'hw:mem_page_size':'large'} - extra_properties: {'hw_mem_page_size':'large'} - extra_alt_properties: {'hw_mem_page_size':'large'} vio: vmready1: diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index b3a1417f6..ec7f967ec 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -155,6 +155,10 @@ class VmReady1(tenantnetwork.TenantNetwork1): self.flavor_disk)) self.__logger.debug("flavor: %s", flavor) flavor_extra_specs = self.flavor_extra_specs.copy() + if env.get('FLAVOR_EXTRA_SPECS'): + flavor_extra_specs.update( + functest_utils.convert_ini_to_dict( + env.get('FLAVOR_EXTRA_SPECS'))) flavor_extra_specs.update( getattr(config.CONF, '{}_flavor_extra_specs'.format(self.case_name), {})) @@ -183,6 +187,10 @@ class VmReady1(tenantnetwork.TenantNetwork1): self.flavor_alt_disk)) self.__logger.debug("flavor: %s", flavor) flavor_alt_extra_specs = self.flavor_alt_extra_specs.copy() + if env.get('FLAVOR_EXTRA_SPECS'): + flavor_alt_extra_specs.update( + functest_utils.convert_ini_to_dict( + env.get('FLAVOR_EXTRA_SPECS'))) flavor_alt_extra_specs.update( getattr(config.CONF, '{}_flavor_alt_extra_specs'.format(self.case_name), {})) diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index a2c768f5d..e2d8a3d26 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -366,6 +366,9 @@ class FunctestUtilsTesting(unittest.TestCase): self.assertEqual( functest_utils.convert_ini_to_dict( "a:b,c:d"), {"a": "b", "c": "d"}) + self.assertEqual( + functest_utils.convert_ini_to_dict( + "a:b:c,d:e:f"), {"a:b": "c", "d:e": "f"}) with self.assertRaises(AssertionError): functest_utils.convert_list_to_ini({}) diff --git a/functest/utils/env.py b/functest/utils/env.py index d7c0814c4..41d1a4d86 100644 --- a/functest/utils/env.py +++ b/functest/utils/env.py @@ -33,6 +33,7 @@ INPUTS = { 'ENERGY_RECORDER_API_PASSWORD': env.INPUTS['ENERGY_RECORDER_API_PASSWORD'], 'VOLUME_DEVICE_NAME': 'vdb', 'IMAGE_PROPERTIES': '', + 'FLAVOR_EXTRA_SPECS': '', 'NAMESERVER': '8.8.8.8', 'NEW_USER_ROLE': 'Member', 'USE_DYNAMIC_CREDENTIALS': 'True', diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 75eefc8dd..a7f3fea79 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -153,7 +153,7 @@ def convert_ini_to_dict(value): "Convert oslo.conf input to dict" assert isinstance(value, str) try: - return {k: v for k, v in (x.split(':') for x in value.split(','))} + return {k: v for k, v in (x.rsplit(':', 1) for x in value.split(','))} except ValueError: return {} |