aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/pushtoDB.py
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/pushtoDB.py')
-rw-r--r--dashboard/pushtoDB.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/dashboard/pushtoDB.py b/dashboard/pushtoDB.py
index e9e05ba2..b889f21c 100644
--- a/dashboard/pushtoDB.py
+++ b/dashboard/pushtoDB.py
@@ -4,8 +4,8 @@ import datetime
import os
TEST_DB = 'http://213.77.62.197'
-suite_list = ['compute_result.json','network_result.json','storage_result.json']
-payload_list = []
+suite_list = [('compute_result.json', 'compute_test_suite'),('network_result.json', 'network_test_suite'),('storage_result.json', 'storage_test_suite')]
+payload_list = { }
def push_results_to_db(db_url, case_name, payload,logger=None, pod_name="dell-us-testing-1"):
@@ -24,7 +24,7 @@ def push_results_to_db(db_url, case_name, payload,logger=None, pod_name="dell-us
headers = {'Content-Type': 'application/json'}
print params
- '''
+
try:
r = requests.post(url, data=json.dumps(params), headers=headers)
print r
@@ -32,13 +32,14 @@ def push_results_to_db(db_url, case_name, payload,logger=None, pod_name="dell-us
except:
print "Error:", sys.exc_info()[0]
return False
- '''
+
def populate_payload(suite_list):
global payload_list
- for suites in suite_list:
- if os.path.isfile('results/'+suites):
- payload_list.append(suites)
+ for k,v in suite_list:
+ print 'results/'+k
+ if os.path.isfile('results/'+str(k)):
+ payload_list[k]=v
print payload_list
@@ -46,11 +47,11 @@ def main():
global payload_list
populate_payload(suite_list)
- for pay in payload_list:
- with open('results/'+pay,'r') as result_file:
+ for suite,case in payload_list.items():
+ with open('results/'+suite,'r') as result_file:
j=result_file.read().rstrip()
push_results_to_db(TEST_DB, 'Compute benchmark suite',j)
if __name__ == "__main__":
- main() \ No newline at end of file
+ main()