aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios
diff options
context:
space:
mode:
authorHans Feldt <hans.feldt@ericsson.com>2015-05-26 11:56:24 +0200
committerHans Feldt <hans.feldt@ericsson.com>2015-05-26 12:14:35 +0200
commitd290591a6f53d74ed00fe49e93654be5c486e998 (patch)
tree7f183c9c33f89b2ffd413236293db8a865e47522 /yardstick/benchmark/scenarios
parentb2d8414cb1ba9700a88d629f6a3d1d88ca9dd92c (diff)
add setup/teardown to scenario base class and runners
Prepare for "service type" of scenarios that e.g. needs to start a service in setup and shut it down in teardown. In the runners, instantiation of the scenario is moved after the "worker START" log to get a more logical sequence logged. Change-Id: Idfaf5bb396eab9261e820291885b5a1dbc32f71e JIRA: - Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
Diffstat (limited to 'yardstick/benchmark/scenarios')
-rw-r--r--yardstick/benchmark/scenarios/base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/yardstick/benchmark/scenarios/base.py b/yardstick/benchmark/scenarios/base.py
index 540acca47..e1e31fd2a 100644
--- a/yardstick/benchmark/scenarios/base.py
+++ b/yardstick/benchmark/scenarios/base.py
@@ -15,7 +15,16 @@ import yardstick.common.utils as utils
class Scenario(object):
+ def setup(self):
+ ''' default impl for scenario setup '''
+ pass
+
def run(self, args):
+ ''' catcher for not implemented run methods in subclasses '''
+ raise RuntimeError("run method not implemented")
+
+ def teardown(self):
+ ''' default impl for scenario teardown '''
pass
@staticmethod