From 89b4f57e600db67be49c203a137bc71e9a503c42 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Wed, 20 Jan 2016 11:38:29 +0100 Subject: Adapt dashboard to a second vPing scenario Change-Id: Ic1d3b6479b1afdbc1cd42536fba65dd3410b8614 Signed-off-by: Morgan Richomme --- .../dashboard/functest2Dashboard.py | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'utils/test') diff --git a/utils/test/result_collection_api/dashboard/functest2Dashboard.py b/utils/test/result_collection_api/dashboard/functest2Dashboard.py index 3e7eefe7e..fbe262c53 100644 --- a/utils/test/result_collection_api/dashboard/functest2Dashboard.py +++ b/utils/test/result_collection_api/dashboard/functest2Dashboard.py @@ -21,7 +21,7 @@ def get_functest_cases(): get the list of the supported test cases TODO: update the list when adding a new test case for the dashboard """ - return ["status", "vPing", "vIMS", "Tempest", "odl", "Rally"] + return ["status", "vPing", "vPing_userdata", "vIMS", "Tempest", "odl", "Rally"] def format_functest_for_dashboard(case, results): @@ -262,3 +262,39 @@ def format_vPing_for_dashboard(results): 'Nb Success': nbTestOk}]}) return test_data + +def format_vPing_userdata_for_dashboard(results): + """ + Post processing for the vPing_userdata test case + """ + test_data = [{'description': 'vPing_userdata results for Dashboard'}] + + # Graph 1: Test_Duration = f(time) + # ******************************** + new_element = [] + for data in results: + new_element.append({'x': data['creation_date'], + 'y': data['details']['duration']}) + + test_data.append({'name': "vPing_userdata duration", + 'info': {'type': "graph", + 'xlabel': 'time', + 'ylabel': 'duration (s)'}, + 'data_set': new_element}) + + # Graph 2: bar + # ************ + nbTest = 0 + nbTestOk = 0 + + for data in results: + nbTest += 1 + if data['details']['status'] == "OK": + nbTestOk += 1 + + test_data.append({'name': "vPing_userdata status", + 'info': {"type": "bar"}, + 'data_set': [{'Nb tests': nbTest, + 'Nb Success': nbTestOk}]}) + + return test_data -- cgit 1.2.3-korg