Add support for Python 3
[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 from __future__ import absolute_import
10 import logging
11
12 from yardstick.benchmark.scenarios import base
13
14 LOG = logging.getLogger(__name__)
15
16
17 class Dummy(base.Scenario):
18     """Execute Dummy echo
19     """
20     __scenario_type__ = "Dummy"
21
22     def __init__(self, scenario_cfg, context_cfg):
23         self.scenario_cfg = scenario_cfg
24         self.context_cfg = context_cfg
25         self.setup_done = False
26
27     def setup(self):
28         '''scenario setup'''
29         self.setup_done = True
30
31     def run(self, result):
32         """execute the benchmark"""
33         if not self.setup_done:
34             self.setup()
35
36         result["hello"] = "yardstick"
37         LOG.info("Dummy echo hello yardstick!")