summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2018-10-15 18:02:29 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-10-15 18:02:29 +0000
commit5eda2839ca79d4cc82b0940ff6e123db96bfbfbe (patch)
tree64908ff605a34601ed5c63d05aecb1757d0c9123
parent520331a06750dd02228f840c346402f52fb864e8 (diff)
parent1a00b9de56ef65eef2a0b269a514cb25491ac54b (diff)
Merge "Ease configuring extra specs via env vars"
-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 0562e3bf6..dcbbd79e5 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 7ae74393d..b49337de2 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -155,7 +155,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 {}