Browse Source

Remove old and unused executors

changes/96/298296/1
Ilya Shakhat 3 years ago
parent
commit
6c3a43e8d0
3 changed files with 0 additions and 118 deletions
  1. 0
    27
      performa/executors/__init__.py
  2. 0
    61
      performa/executors/base.py
  3. 0
    30
      performa/executors/shell.py

+ 0
- 27
performa/executors/__init__.py View File

@@ -1,27 +0,0 @@
1
-# Copyright (c) 2016 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License");
4
-# you may not use this file except in compliance with the License.
5
-# You may obtain a copy of the License at
6
-#
7
-#   http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS,
11
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
-# implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-from performa.executors import shell
17
-
18
-EXECUTORS = {
19
-    '_default': shell.ShellExecutor,
20
-}
21
-
22
-
23
-def get_executor(test_definition):
24
-    # returns executor of the specified test on the specified agent
25
-    executor_class = test_definition['class']
26
-    klazz = EXECUTORS.get(executor_class, EXECUTORS['_default'])
27
-    return klazz(test_definition)

+ 0
- 61
performa/executors/base.py View File

@@ -1,61 +0,0 @@
1
-# Copyright (c) 2016 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License");
4
-# you may not use this file except in compliance with the License.
5
-# You may obtain a copy of the License at
6
-#
7
-#   http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS,
11
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
-# implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-from oslo_log import log as logging
17
-
18
-
19
-LOG = logging.getLogger(__name__)
20
-
21
-
22
-class CommandLine(object):
23
-    def __init__(self, command):
24
-        self.tokens = [command]
25
-
26
-    def add(self, param_name, param_value=None):
27
-        token = param_name
28
-        if param_value is not None:
29
-            token += '=' + str(param_value)
30
-        self.tokens.append(token)
31
-
32
-    def make(self):
33
-        return ' '.join(self.tokens)
34
-
35
-
36
-class BaseExecutor(object):
37
-    def __init__(self, test_definition):
38
-        super(BaseExecutor, self).__init__()
39
-        self.test_definition = test_definition
40
-
41
-    def get_expected_duration(self):
42
-        return self.test_definition.get('time') or 60
43
-
44
-    def get_command(self):
45
-        return None
46
-
47
-    def process_reply(self, message):
48
-        LOG.debug('Test %s finished with %s',
49
-                  self.test_definition, message)
50
-        return dict(stdout=message.get('stdout'),
51
-                    stderr=message.get('stderr'),
52
-                    command=self.get_command())
53
-
54
-    def process_failure(self):
55
-        return dict(command=self.get_command())
56
-
57
-
58
-class ExecutorException(Exception):
59
-    def __init__(self, record, message):
60
-        super(ExecutorException, self).__init__(message)
61
-        self.record = record

+ 0
- 30
performa/executors/shell.py View File

@@ -1,30 +0,0 @@
1
-# Copyright (c) 2016 OpenStack Foundation
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License");
4
-# you may not use this file except in compliance with the License.
5
-# You may obtain a copy of the License at
6
-#
7
-#   http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS,
11
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
-# implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-from oslo_log import log as logging
17
-
18
-from performa.executors import base
19
-
20
-
21
-LOG = logging.getLogger(__name__)
22
-
23
-
24
-class ShellExecutor(base.BaseExecutor):
25
-    def get_command(self):
26
-        if 'program' in self.test_definition:
27
-            cmd = base.CommandLine(self.test_definition['program'])
28
-        elif 'script' in self.test_definition:
29
-            cmd = base.Script(self.test_definition['script'])
30
-        return cmd.make()

Loading…
Cancel
Save