aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark/runner/test_base.py
diff options
context:
space:
mode:
authorSerhiy Pshyk <serhiyx.pshyk@intel.com>2019-01-22 13:31:58 +0000
committerSerhiy Pshyk <serhiyx.pshyk@intel.com>2019-01-31 09:47:30 +0000
commit56962db107f852a55101e8a9f3b93bd6982485de (patch)
tree942378b4fe704946655dd07330e2771276a30299 /yardstick/tests/unit/benchmark/runner/test_base.py
parent9c1f115a5e6d6d47bc755da118e7b7f214351849 (diff)
Add new scenario NSPerf-RFC2544
List of changes: - Added new scenario NSPerf-RFC2544 that runs complete test per runner's iteration - NSPerf is still present for backward compatibility - Added ScenarioOutput class which allows scenario to report data (kpi,...) at any moment of time (not only once per run) - New output mechanism is used only by new NSPerf-RFC2544 scenario JIRA: YARDSTICK-1592 Change-Id: Ica8078f61d895f74df90e8eaad7a675b28bd19c6 Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Diffstat (limited to 'yardstick/tests/unit/benchmark/runner/test_base.py')
-rw-r--r--yardstick/tests/unit/benchmark/runner/test_base.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/runner/test_base.py b/yardstick/tests/unit/benchmark/runner/test_base.py
index 559c991f3..07d6f1843 100644
--- a/yardstick/tests/unit/benchmark/runner/test_base.py
+++ b/yardstick/tests/unit/benchmark/runner/test_base.py
@@ -43,6 +43,29 @@ class ActionTestCase(ut_base.BaseUnitTestCase):
runner_base._periodic_action(0, 'echo', mock.Mock())
+class ScenarioOutputTestCase(ut_base.BaseUnitTestCase):
+
+ def setUp(self):
+ self.output_queue = mock.Mock()
+ self.scenario_output = runner_base.ScenarioOutput(self.output_queue,
+ sequence=1)
+
+ @mock.patch.object(time, 'time')
+ def test_push(self, mock_time):
+ mock_time.return_value = 2
+ data = {"value1": 1}
+ self.scenario_output.push(data)
+ self.output_queue.put.assert_called_once_with({'timestamp': 2,
+ 'sequence': 1,
+ 'data': data}, True, 10)
+
+ def test_push_no_timestamp(self):
+ self.scenario_output["value1"] = 1
+ self.scenario_output.push(None, False)
+ self.output_queue.put.assert_called_once_with({'sequence': 1,
+ 'value1': 1}, True, 10)
+
+
class RunnerTestCase(ut_base.BaseUnitTestCase):
def setUp(self):