summaryrefslogtreecommitdiffstats
path: root/dovetail/tests/unit
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/tests/unit
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/tests/unit')
-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
3 files changed, 17 insertions, 0 deletions
diff --git a/dovetail/tests/unit/test_report.py b/dovetail/tests/unit/test_report.py
index 84bd1f38..f7f8adc8 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 06a23025..5f4f15d9 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 eac0421c..b4cd3b1d 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