diff options
-rwxr-xr-x | functest/ci/testcases.yaml | 16 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/custom_tests/test_list.txt | 4 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | functest/utils/config.py | 20 |
4 files changed, 35 insertions, 11 deletions
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml index eea1f5180..ed3a0b843 100755 --- a/functest/ci/testcases.yaml +++ b/functest/ci/testcases.yaml @@ -397,6 +397,22 @@ tiers: run: module: 'functest.opnfv_tests.openstack.tempest.tempest' class: 'TempestDefcore' + - + name: tempest_custom + criteria: 'success_rate == 100%' + blocking: false + description: >- + The test case allows running a customized list of tempest + test cases defined in a file under + <dir_functest_repo>/functest/opnfv_tests/openstack/ + /tempest/custom_tests/test_list.txt + The file is empty and can be customized with the desired tests. + dependencies: + installer: 'unknown' + scenario: 'unknown' + run: + module: 'functest.opnfv_tests.openstack.tempest.tempest' + class: 'TempestCustom' # - # name: rally_full # criteria: 'success_rate >= 90%' diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/test_list.txt b/functest/opnfv_tests/openstack/tempest/custom_tests/test_list.txt new file mode 100644 index 000000000..ac4e37289 --- /dev/null +++ b/functest/opnfv_tests/openstack/tempest/custom_tests/test_list.txt @@ -0,0 +1,4 @@ +# This is an empty file to be filled up with the desired tempest test cases +# Examples: +#tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops +#tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops
\ No newline at end of file diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 37b5c0ee7..4c96500db 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -324,11 +324,11 @@ class TempestMultisite(TempestCommon): class TempestCustom(TempestCommon): - def __init__(self, mode, option): + def __init__(self): TempestCommon.__init__(self) self.case_name = "tempest_custom" - self.MODE = mode - self.OPTION = option + self.MODE = "custom" + self.OPTION = "--concurrency 1" class TempestDefcore(TempestCommon): diff --git a/functest/utils/config.py b/functest/utils/config.py index 84166c1d3..b5b845010 100644..100755 --- a/functest/utils/config.py +++ b/functest/utils/config.py @@ -2,26 +2,25 @@ import os import yaml +import env + class Config(object): def __init__(self): - if 'CONFIG_FUNCTEST_YAML' not in os.environ: - raise Exception('CONFIG_FUNCTEST_YAML not configed') - self.config_functest = os.environ['CONFIG_FUNCTEST_YAML'] try: - with open(self.config_functest) as f: + with open(env.ENV.CONFIG_FUNCTEST_YAML) as f: self.functest_yaml = yaml.safe_load(f) self._parse(None, self.functest_yaml) - except: - raise Exception('Parse {} failed'.format(self.config_functest)) + except Exception as error: + raise Exception('Parse config failed: {}'.format(str(error))) self._set_others() def _parse(self, attr_now, left_parametes): for param_n, param_v in left_parametes.iteritems(): attr_further = self._get_attr_further(attr_now, param_n) - if not isinstance(param_v, dict): + if attr_further: self.__setattr__(attr_further, param_v) - else: + if isinstance(param_v, dict): self._parse(attr_further, param_v) def _get_attr_further(self, attr_now, next): @@ -33,3 +32,8 @@ class Config(object): CONF = Config() + +if __name__ == "__main__": + print CONF.vnf_cloudify_ims + print CONF.vnf_cloudify_ims_tenant_images + print CONF.vnf_cloudify_ims_tenant_images_centos_7 |