1 ##############################################################################
2 # Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
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 ##############################################################################
13 class TestStep(object):
14 def __init__(self, type, id, name, service, action, args, context):
18 self._serviceName = service['name']
19 self._serviceInterface = service['interface']
22 self._context = context
30 def getServiceName(self):
31 return self._serviceName
33 def getCallFunction(self):
40 f = getattr(self, self._action)
46 def _getCurrentDir(self):
47 return os.path.dirname(__file__)
50 return str(self.__dict__)
53 if __name__ == "__main__":
54 args = {'command': 'start'}
55 stepObj = TestStep('test_cpu', 'ansible', 'REST', **args)