Add Dummy context and scenario type
[yardstick.git] / yardstick / benchmark / scenarios / dummy / dummy.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import logging
10
11 from yardstick.benchmark.scenarios import base
12
13 LOG = logging.getLogger(__name__)
14
15
16 class Dummy(base.Scenario):
17     """Execute Dummy echo
18     """
19     __scenario_type__ = "Dummy"
20
21     def __init__(self, scenario_cfg, context_cfg):
22         self.scenario_cfg = scenario_cfg
23         self.context_cfg = context_cfg
24         self.setup_done = False
25
26     def setup(self):
27         '''scenario setup'''
28         self.setup_done = True
29
30     def run(self, result):
31         """execute the benchmark"""
32         if not self.setup_done:
33             self.setup()
34
35         result["hello"] = "yardstick"
36         LOG.info("Dummy echo hello yardstick!")