Merge "Improve "get_server" function in Kubernetes context"
[yardstick.git] / yardstick / benchmark / contexts / 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
10 from yardstick.benchmark import contexts
11 from yardstick.benchmark.contexts import base
12
13
14 class DummyContext(base.Context):
15     """Class that handle dummy info.
16
17     This class is also used to test the abstract class Context because it
18     provides a minimal concrete implementation of a subclass.
19     """
20
21     __context_type__ = contexts.CONTEXT_DUMMY
22
23     def deploy(self):
24         """Don't need to deploy"""
25         pass
26
27     def undeploy(self):
28         """Don't need to undeploy"""
29         pass
30
31     def _get_server(self, attr_name):
32         return None
33
34     def _get_network(self, attr_name):
35         return None
36
37     def _get_physical_nodes(self):
38         return None
39
40     def _get_physical_node_for_server(self, server_name):
41         return None