summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2017-01-27 16:35:37 -0500
committermbeierl <mark.beierl@dell.com>2017-01-27 16:35:37 -0500
commitd6a4c32eeb15b24aa3079bb404ac79cffeacf6ff (patch)
tree6107e7c08b94c0e59545c1ec7550665fa891d466 /tests
parentcc5f999694cb4052d044261b18ec8fedf3de866e (diff)
Testresults DB Alignment
Changes the key names sent to the testresults db to align with other projects. Defines a clear PASS/FAIL based on the ability to find steady state for all runs. If one run failed to achieve steady state, run gets labelled as FAIL. Change-Id: I73143779453689eea93829079388ed8035134aa3 JIRA: STORPERF-100 Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/utilities_tests/data_handler_test.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/utilities_tests/data_handler_test.py b/tests/utilities_tests/data_handler_test.py
index 3813957..7963c9f 100644
--- a/tests/utilities_tests/data_handler_test.py
+++ b/tests/utilities_tests/data_handler_test.py
@@ -44,6 +44,7 @@ class DataHandlerTest(unittest.TestCase):
self.job_db = mock
self.pushed = False
self.current_workload = None
+ self.db_results = None
pass
@property
@@ -52,6 +53,7 @@ class DataHandlerTest(unittest.TestCase):
def push_results_to_db(self, *args):
self.pushed = True
+ self.db_results = args
pass
def terminate(self):
@@ -131,6 +133,13 @@ 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 = {
+ "steady_state": {
+ "rr.queue-depth.8.block-size.16384": True,
+ "rr.queue-depth.8.block-size.2048": False,
+ "rr.queue-depth.8.block-size.8192": True,
+ },
+ }
self.data_handler.data_event(self)
self.assertEqual(True, self.pushed)
@@ -248,3 +257,30 @@ class DataHandlerTest(unittest.TestCase):
self.assertEqual(True, self._terminated)
self.assertEqual(False, self.pushed)
+
+ @mock.patch.dict(os.environ, {'TEST_DB_URL': 'mock'})
+ @mock.patch("storperf.db.test_results_db.push_results_to_db")
+ def test_playload_report(self,
+ mock_results_db):
+ mock_results_db.side_effect = self.push_results_to_db
+ self.start_time = 1504559100
+ self.end_time = 1504560000
+ self.metadata = {
+ "scenario_name": "ceph_ws,wr,rs,rr,rw",
+ "status": "OK",
+ "steady_state": {
+ "rr.queue-depth.8.block-size.16384": True,
+ "rr.queue-depth.8.block-size.2048": False,
+ "rr.queue-depth.8.block-size.8192": True,
+ },
+ "storage_node_count": 5,
+ "volume_size": 10
+ }
+ self.data_handler._push_to_db(self)
+ self.assertEqual('FAIL', self.db_results[9],
+ 'Expected FAIL in criteria')
+ self.assertEqual('2017-09-04 21:05:00', self.db_results[3],
+ 'Start time')
+ self.assertEqual('2017-09-04 21:20:00', self.db_results[4],
+ 'End time')
+