summaryrefslogtreecommitdiffstats
path: root/dovetail
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2019-08-27 23:26:24 -0400
committerDan Xu <xudan16@huawei.com>2019-09-02 01:57:51 +0000
commit6d33ad294d6bc56226c86604cded0b70a6952661 (patch)
tree15c747ed941712d1476de404c49e463b5aa6365e /dovetail
parentd15825b04fde0b40df1840ae2ec2fab2ac961471 (diff)
Add portal_key_file into all test case yml files
Change-Id: If111a8cc56c31ec3e22b090aca92ff56d41f7e01 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail')
-rw-r--r--dovetail/report.py2
-rw-r--r--dovetail/testcase.py3
-rw-r--r--dovetail/tests/unit/test_report.py9
-rw-r--r--dovetail/tests/unit/test_testcase.py7
-rw-r--r--dovetail/tests/unit/test_testcase.yaml1
5 files changed, 22 insertions, 0 deletions
diff --git a/dovetail/report.py b/dovetail/report.py
index 643f7db..25c34a2 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -119,6 +119,7 @@ class Report(object):
testcase_inreport['objective'] = ''
testcase_inreport['sub_testcase'] = []
testcase_inreport['mandatory'] = False
+ testcase_inreport['portal_key_file'] = ''
report_obj['testcases_list'].append(testcase_inreport)
continue
@@ -132,6 +133,7 @@ class Report(object):
report_obj['vnf_type'] = vnf_type
report_obj['vnf_checksum'] = self.get_checksum(vnf_type)
testcase_inreport['mandatory'] = testcase.is_mandatory
+ testcase_inreport['portal_key_file'] = testcase.portal_key_file()
testcase_inreport['sub_testcase'] = []
if testcase.sub_testcase() is not None:
for sub_test in testcase.sub_testcase():
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index deb0025..3856b13 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -89,6 +89,9 @@ class Testcase(object):
def validate_testcase(self):
return self.testcase['validate']['testcase']
+ def portal_key_file(self):
+ return self.testcase['report']['portal_key_file']
+
def increase_retry(self):
return self._increase_retry(self.validate_testcase())
diff --git a/dovetail/tests/unit/test_report.py b/dovetail/tests/unit/test_report.py
index 84bd1f3..f7f8adc 100644
--- a/dovetail/tests/unit/test_report.py
+++ b/dovetail/tests/unit/test_report.py
@@ -195,6 +195,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.objective.return_value = 'objective'
mock_checksum.return_value = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
testcase_obj.is_mandatory = True
+ testcase_obj.portal_key_file.return_value = 'a/b.log'
testcase_obj.vnf_type.return_value = 'tosca'
testcase_obj.sub_testcase.return_value = ['subt_a']
testcase_obj.sub_testcase_passed.return_value = 'PASS'
@@ -215,6 +216,7 @@ class ReportTesting(unittest.TestCase):
'result': 'PASS',
'objective': 'objective',
'mandatory': True,
+ 'portal_key_file': 'a/b.log',
'sub_testcase': [{
'name': 'subt_a',
'result': 'PASS'
@@ -225,6 +227,7 @@ class ReportTesting(unittest.TestCase):
'result': 'Undefined',
'objective': '',
'mandatory': False,
+ 'portal_key_file': '',
'sub_testcase': []
}
]
@@ -256,6 +259,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.objective.return_value = 'objective'
testcase_obj.is_mandatory = True
testcase_obj.vnf_type.return_value = None
+ testcase_obj.portal_key_file.return_value = 'a/b.log'
testcase_obj.sub_testcase.return_value = ['subt_a']
testcase_obj.sub_testcase_passed.return_value = 'PASS'
mock_testcase.get.side_effect = [testcase_obj, None]
@@ -273,6 +277,7 @@ class ReportTesting(unittest.TestCase):
'result': 'PASS',
'objective': 'objective',
'mandatory': True,
+ 'portal_key_file': 'a/b.log',
'sub_testcase': [{
'name': 'subt_a',
'result': 'PASS'
@@ -283,6 +288,7 @@ class ReportTesting(unittest.TestCase):
'result': 'Undefined',
'objective': '',
'mandatory': False,
+ 'portal_key_file': '',
'sub_testcase': []
}
]
@@ -313,6 +319,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.passed.return_value = 'PASS'
testcase_obj.objective.return_value = 'objective'
testcase_obj.is_mandatory = True
+ testcase_obj.portal_key_file.return_value = 'a/b.log'
testcase_obj.vnf_type.side_effect = Exception()
testcase_obj.sub_testcase.return_value = ['subt_a']
testcase_obj.sub_testcase_passed.return_value = 'PASS'
@@ -331,6 +338,7 @@ class ReportTesting(unittest.TestCase):
'result': 'PASS',
'objective': 'objective',
'mandatory': True,
+ 'portal_key_file': 'a/b.log',
'sub_testcase': [{
'name': 'subt_a',
'result': 'PASS'
@@ -341,6 +349,7 @@ class ReportTesting(unittest.TestCase):
'result': 'Undefined',
'objective': '',
'mandatory': False,
+ 'portal_key_file': '',
'sub_testcase': []
}
]
diff --git a/dovetail/tests/unit/test_testcase.py b/dovetail/tests/unit/test_testcase.py
index 06a2302..5f4f15d 100644
--- a/dovetail/tests/unit/test_testcase.py
+++ b/dovetail/tests/unit/test_testcase.py
@@ -161,6 +161,13 @@ class TestcaseTesting(unittest.TestCase):
self.assertEquals('tempest_smoke_serial', result)
+ def test_portal_key_file(self):
+ testcase = tcase.Testcase(self.testcase_yaml)
+
+ result = testcase.portal_key_file()
+
+ self.assertEquals('tempest_logs/tempest_smoke_serial.html', result)
+
def test_vnf_type(self):
testcase = tcase.OnapVtpTestcase(self.testcase_yaml)
diff --git a/dovetail/tests/unit/test_testcase.yaml b/dovetail/tests/unit/test_testcase.yaml
index eac0421..b4cd3b1 100644
--- a/dovetail/tests/unit/test_testcase.yaml
+++ b/dovetail/tests/unit/test_testcase.yaml
@@ -16,6 +16,7 @@ dovetail.ipv6.tc001:
type: functest
testcase: tempest_smoke_serial
report:
+ portal_key_file: tempest_logs/tempest_smoke_serial.html
sub_testcase_list:
- tempest.api.network.test_networks.BulkNetworkOpsIpV6Test.test_bulk_create_delete_network
- tempest.api.network.test_networks.BulkNetworkOpsIpV7Test.test_bulk_create_delete_port