summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2018-10-16 16:32:30 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-10-16 16:32:30 +0000
commit5a5f4fea5727b26a48d1943eacd10440960bc540 (patch)
treed43cfafdc364b23487107bc6b69dc451cda83061
parentf549b39b0ff9e4166dd0260090a12bf6e8e42c7c (diff)
parent0cdc153207e76cb6e43a5aa3297a7dc39e5b48a5 (diff)
Merge "Ease configuring extra specs via env vars" into stable/gambia
-rw-r--r--functest/ci/config_patch.yaml176
-rw-r--r--functest/core/singlevm.py8
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py3
-rw-r--r--functest/utils/env.py1
-rw-r--r--functest/utils/functest_utils.py2
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 {}