This patch makes it able to fetch the version from the testsuite.
Furthermore, in case of ONAP test cases it adds the vnf_type to the
produced results.json file in order to be parsed from the results
portal. Finally, it creates a testuite for ONAP TOSCA related tests.
Change-Id: I613358c445cfe62730b98fee5e8c6fba7d322e90
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
# egeokun: using a hardcoded string instead of pbr version for
# versioning the result file. The version of the results.json is
# logically independent of the release of Dovetail.
- report_obj['version'] = '2018.09'
+ report_obj['version'] = dt_cfg.dovetail_config.get('version')
report_obj['build_tag'] = dt_cfg.dovetail_config['build_tag']
report_obj['test_date'] =\
datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC')
report_obj['duration'] = duration
+ vnf_type = dt_cfg.dovetail_config.get('vnf_type')
+ if vnf_type:
+ report_obj['vnf_type'] = vnf_type
report_obj['testcases_list'] = []
if not testcase_list:
if testsuite_validation and testarea_validation:
testsuite_yaml = load_testsuite(testsuite)
+ dt_cfg.dovetail_config['version'] = dt_utils.get_value_from_dict(
+ 'version', testsuite_yaml)
+ dt_cfg.dovetail_config['vnf_type'] = dt_utils.get_value_from_dict(
+ 'vnf_type', testsuite_yaml)
testcase_list = dt_testcase.Testcase.get_testcases_for_testsuite(
testsuite_yaml, testarea)
return check_testcase_list(testcase_list, logger)
testcase_list = ['ta.tb.tc', 'td.te.tf']
duration = 42
mock_config.dovetail_config = {
- 'build_tag': 'build_tag'
+ 'build_tag': 'build_tag',
+ 'version': '2018.09'
}
utc_obj = Mock()
utc_obj.strftime.return_value = '2018-01-13 13:13:13 UTC'
report.logger = logger_obj
duration = 42
mock_config.dovetail_config = {
- 'build_tag': 'build_tag'
+ 'build_tag': 'build_tag',
+ 'version': '2018.09',
+ 'vnf_type': 'tosca'
}
utc_obj = Mock()
utc_obj.strftime.return_value = '2018-01-13 13:13:13 UTC'
expected = {
'version': '2018.09',
'build_tag': 'build_tag',
+ 'vnf_type': 'tosca',
'test_date': '2018-01-13 13:13:13 UTC',
'duration': duration,
'testcases_list': []
---
onap.1.0.0:
name: onap.1.0.0
+ version: '1.0.0'
+ vnf_type: tosca
testcases_list:
optional:
- onap.lifecycle.tc001
--- /dev/null
+---
+onap.tosca.2019.04:
+ name: onap.tosca.2019.04
+ version: '2019.04'
+ vnf_type: tosca
+ testcases_list:
+ mandatory:
+ - onap-vtp.validate.csar
---
ovp.2018.09:
name: ovp.2018.09
+ version: '2018.09'
testcases_list:
mandatory:
- functest.vping.userdata
- debug
- healthcheck
- ovp.2018.09
+ - onap.tosca.2019.04
- onap.1.0.0
# used for testcase cmd template in jinja2 format