1 ##############################################################################
\r
2 # Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
\r
4 # All rights reserved. This program and the accompanying materials
\r
5 # are made available under the terms of the Apache License, Version 2.0
\r
6 # which accompanies this distribution, and is available at
\r
7 # http://www.apache.org/licenses/LICENSE-2.0
\r
8 ##############################################################################
\r
13 class TestStep(object):
\r
14 def __init__(self, type, id, name, service, action, args, context):
\r
18 self._serviceName = service['name']
\r
19 self._serviceInterface = service['interface']
\r
20 self._action = action
\r
22 self._context = context
\r
30 def getServiceName(self):
\r
31 return self._serviceName
\r
33 def getCallFunction(self):
\r
34 return self._callType
\r
40 f = getattr(self, self._action)
\r
43 def _argsParse(self):
\r
46 def _getCurrentDir(self):
\r
47 return os.path.dirname(__file__)
\r
50 return str(self.__dict__)
\r
53 if __name__ == "__main__":
\r
54 args = {'command': 'start'}
\r
55 stepObj = TestStep('test_cpu', 'ansible', 'REST', **args)
\r