summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/tests
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2017-08-28 09:43:31 -0400
committermbeierl <mark.beierl@dell.com>2017-08-28 19:09:24 -0400
commitb4421c8b61c183d57ef4acc6874cc8e02c65d633 (patch)
tree74e45639ee21d4c5c4e998e9d4dd50378dd651e8 /docker/storperf-master/tests
parent6848d519dfa7c8aec38ab6d084df3d08196c0ad3 (diff)
Standardize Output
Re-arrange the JSON output so that it matches the format that gets sent and retrieved from the testresults db. Change-Id: I9f15e553e94b27b9e5a36f4984789c5e710feac4 JIRA: STORPERF-200 Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'docker/storperf-master/tests')
-rw-r--r--docker/storperf-master/tests/utilities_tests/data_handler_test.py35
1 files changed, 23 insertions, 12 deletions
diff --git a/docker/storperf-master/tests/utilities_tests/data_handler_test.py b/docker/storperf-master/tests/utilities_tests/data_handler_test.py
index 6010bd3..f028bd0 100644
--- a/docker/storperf-master/tests/utilities_tests/data_handler_test.py
+++ b/docker/storperf-master/tests/utilities_tests/data_handler_test.py
@@ -35,6 +35,8 @@ class DataHandlerTest(unittest.TestCase):
self.steady_state_samples = 10
self.end_time = 1
self.metadata = {}
+ self.metadata['details'] = {}
+ self.metadata['details']['metrics'] = {}
self.block_sizes = "1"
self.queue_depths = "1"
mock.job_id = "1"
@@ -134,7 +136,7 @@ class DataHandlerTest(unittest.TestCase):
self._terminated = True
mock_results_db.side_effect = self.push_results_to_db
mock_graphite_db.side_effect = MockGraphiteDB
- self.metadata = {
+ self.metadata['details'] = {
"steady_state": {
"rr.queue-depth.8.block-size.16384": True,
"rr.queue-depth.8.block-size.2048": False,
@@ -182,17 +184,20 @@ class DataHandlerTest(unittest.TestCase):
self.assertEqual(False, self.pushed)
self.assertEqual(False, self._terminated)
- self.assertEqual(expected_slope, self.metadata['report_data']
+ self.assertEqual(expected_slope, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
['slope'])
- self.assertEqual(expected_range, self.metadata['report_data']
+ self.assertEqual(expected_range, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
['range'])
- self.assertEqual(expected_average, self.metadata['report_data']
+ self.assertEqual(expected_average, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
@@ -246,22 +251,26 @@ class DataHandlerTest(unittest.TestCase):
self.data_handler.data_event(self)
- self.assertEqual(expected_slope, self.metadata['report_data']
+ self.assertEqual(expected_slope, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
['slope'])
- self.assertEqual(expected_range, self.metadata['report_data']
+ self.assertEqual(expected_range, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
['range'])
- self.assertEqual(expected_average, self.metadata['report_data']
+ self.assertEqual(expected_average, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
['average'])
- self.assertEqual(report_data, self.metadata['report_data']
+ self.assertEqual(report_data, self.metadata['details']
+ ['report_data']
['rw.queue-depth.8.block-size.8192']
['lat_ns.mean']
['read']
@@ -277,7 +286,7 @@ class DataHandlerTest(unittest.TestCase):
mock_results_db.side_effect = self.push_results_to_db
self.start_time = 1504559100
self.end_time = 1504560000
- self.metadata = {
+ self.metadata['details'] = {
"scenario_name": "ceph_ws,wr,rs,rr,rw",
"status": "OK",
"steady_state": {
@@ -289,9 +298,11 @@ class DataHandlerTest(unittest.TestCase):
"volume_size": 10
}
self.data_handler._push_to_db(self)
- self.assertEqual('FAIL', self.db_results[9],
+ self.assertEqual('FAIL', self.db_results[1]['criteria'],
'Expected FAIL in criteria')
- self.assertEqual('2017-09-04 21:05:00', self.db_results[3],
+ self.assertEqual('2017-09-04 21:05:00',
+ self.db_results[1]['start_time'],
'Start time')
- self.assertEqual('2017-09-04 21:20:00', self.db_results[4],
+ self.assertEqual('2017-09-04 21:20:00',
+ self.db_results[1]['end_time'],
'End time')