Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 1 | # Copyright 2018 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # 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, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 15 | import json |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 16 | import os |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 17 | |
Oleksii Butenko | b0ca4cc | 2018-10-22 16:29:54 +0300 | [diff] [blame] | 18 | from devops.helpers import helpers |
| 19 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 20 | from tcp_tests import logger |
| 21 | from tcp_tests import settings |
| 22 | |
Oleksii Butenko | b0ca4cc | 2018-10-22 16:29:54 +0300 | [diff] [blame] | 23 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 24 | LOG = logger.logger |
| 25 | |
| 26 | TEMPEST_CFG_DIR = '/tmp/test' |
| 27 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 28 | |
| 29 | class RuntestManager(object): |
| 30 | """Helper manager for execution tempest via runtest-formula""" |
| 31 | |
| 32 | image_name = settings.TEMPEST_IMAGE |
| 33 | image_version = settings.TEMPEST_IMAGE_VERSION |
| 34 | container_name = 'run-tempest-ci' |
| 35 | master_host = "cfg01" |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 36 | control_host = "ctl01" |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 37 | class_name = "runtest" |
| 38 | run_cmd = '/bin/bash -c "run-tempest"' |
| 39 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 40 | def __init__(self, config, underlay, salt_api, cluster_name, |
Oleksii Butenko | 7456610 | 2018-09-11 11:55:13 +0300 | [diff] [blame] | 41 | domain_name, tempest_threads, |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 42 | tempest_pattern=settings.TEMPEST_PATTERN, |
| 43 | run_cmd=None, target='gtw01'): |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 44 | self.__config = config |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 45 | self.underlay = underlay |
| 46 | self.__salt_api = salt_api |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 47 | self.cluster_name = cluster_name |
| 48 | self.domain_name = domain_name |
| 49 | self.tempest_threads = tempest_threads |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 50 | self.tempest_pattern = tempest_pattern |
| 51 | self.run_cmd = run_cmd or self.run_cmd |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 52 | self.target_name = self.underlay.get_target_node_names(target)[0] |
| 53 | self.master_name = self.underlay.get_target_node_names( |
| 54 | self.master_host)[0] |
| 55 | self.control_name = self.underlay.get_target_node_names( |
| 56 | self.control_host)[0] |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 57 | |
| 58 | @property |
| 59 | def salt_api(self): |
| 60 | return self.__salt_api |
| 61 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 62 | @property |
| 63 | def runtest_pillar(self): |
| 64 | public_net = self.__config.underlay.dhcp_ranges[ |
| 65 | settings.EXTERNAL_ADDRESS_POOL_NAME] |
| 66 | public_gateway = public_net["gateway"].encode("ascii") |
| 67 | public_cidr = public_net["cidr"].encode("ascii") |
| 68 | public_allocation_start = public_net["start"].encode("ascii") |
| 69 | public_allocation_end = public_net["end"].encode("ascii") |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 70 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 71 | return { |
| 72 | 'classes': ['service.runtest.tempest', |
| 73 | 'service.runtest.tempest.public_net', |
| 74 | 'service.runtest.tempest.services.manila.glance'], |
| 75 | 'parameters': { |
| 76 | '_param': { |
| 77 | 'runtest_tempest_cfg_dir': TEMPEST_CFG_DIR, |
| 78 | 'runtest_tempest_cfg_name': 'tempest.conf', |
| 79 | 'runtest_tempest_public_net': 'public', |
| 80 | 'openstack_public_neutron_subnet_gateway': public_gateway, |
| 81 | 'openstack_public_neutron_subnet_cidr': public_cidr, |
| 82 | 'openstack_public_neutron_subnet_allocation_start': |
| 83 | public_allocation_start, |
| 84 | 'openstack_public_neutron_subnet_allocation_end': |
| 85 | public_allocation_end, |
| 86 | 'tempest_test_target': self.target_name.encode("ascii"), |
| 87 | }, |
| 88 | 'neutron': { |
| 89 | 'client': { |
| 90 | 'enabled': True |
| 91 | } |
| 92 | }, |
| 93 | 'runtest': { |
| 94 | 'enabled': True, |
| 95 | 'keystonerc_node': 'ctl01*', |
| 96 | 'tempest': { |
| 97 | 'enabled': True, |
| 98 | 'cfg_dir': '${_param:runtest_tempest_cfg_dir}', |
| 99 | 'cfg_name': '${_param:runtest_tempest_cfg_name}', |
Oleksii Butenko | 09cc0cd | 2018-10-16 14:31:57 +0300 | [diff] [blame] | 100 | 'put_keystone_rc_enabled': True, |
| 101 | 'put_local_image_file_enabled': False, |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 102 | 'DEFAULT': { |
| 103 | 'log_file': 'tempest.log' |
| 104 | }, |
| 105 | 'compute': { |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 106 | 'min_compute_nodes': 2, |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 107 | }, |
| 108 | 'convert_to_uuid': { |
| 109 | 'network': { |
| 110 | 'public_network_id': |
| 111 | '${_param:runtest_tempest_public_net}' |
| 112 | } |
| 113 | }, |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 114 | 'share': { |
| 115 | 'capability_snapshot_support': True, |
| 116 | 'run_driver_assisted_migration_tests': False, |
| 117 | 'run_manage_unmanage_snapshot_tests': False, |
| 118 | 'run_manage_unmanage_tests': False, |
| 119 | 'run_migration_with_preserve_snapshots_tests': |
| 120 | False, |
| 121 | 'run_quota_tests': True, |
| 122 | 'run_replication_tests': False, |
| 123 | 'run_snapshot_tests': True, |
| 124 | }}}}} |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 125 | |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 126 | def fetch_arficats(self, username=None, file_format='xml'): |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 127 | with self.underlay.remote(node_name=self.target_name, |
| 128 | username=None) as tgt: |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 129 | result = tgt.execute('find {} -name "report_*.{}"'.format( |
| 130 | TEMPEST_CFG_DIR, file_format)) |
| 131 | LOG.debug("Find result {0}".format(result)) |
| 132 | assert len(result['stdout']) > 0, ('No report found, please check' |
| 133 | ' if test run was successful.') |
| 134 | report = result['stdout'][0].rstrip() |
| 135 | LOG.debug("Found files {0}".format(report)) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 136 | tgt.download( |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 137 | destination=report, # noqa |
| 138 | target=os.getcwd()) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 139 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 140 | def store_runtest_model(self, runtest_pillar=None): |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 141 | with self.underlay.yaml_editor( |
| 142 | file_path="/srv/salt/reclass/classes/cluster/" |
| 143 | "{cluster_name}/infra/" |
| 144 | "{class_name}.yml".format( |
| 145 | cluster_name=self.cluster_name, |
| 146 | class_name=self.class_name), |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 147 | node_name=self.master_name) as editor: |
| 148 | editor.content = runtest_pillar or self.runtest_pillar |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 149 | with self.underlay.yaml_editor( |
| 150 | file_path="/srv/salt/reclass/nodes/_generated/" |
| 151 | "cfg01.{domain_name}.yml".format( |
| 152 | domain_name=self.domain_name), |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 153 | node_name=self.master_name) as editor: |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 154 | editor.content['classes'].append( |
| 155 | 'cluster.{cluster_name}.infra.{class_name}'.format( |
| 156 | cluster_name=self.cluster_name, |
| 157 | class_name=self.class_name)) |
| 158 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 159 | def save_runtime_logs(self, logs=None, inspect=None): |
| 160 | if logs: |
| 161 | with open("{path}/{target}_tempest_run.log".format( |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 162 | path=settings.LOGS_DIR, |
| 163 | target=self.target_name), 'w') as f: |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 164 | LOG.info("Save tempest console log") |
| 165 | container_log = logs |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 166 | f.write(container_log.encode('ascii', 'ignore')) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 167 | |
| 168 | if inspect: |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 169 | with open("{path}/{target}_tempest_container_info.json.log".format( |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 170 | path=settings.LOGS_DIR, |
| 171 | target=self.target_name), 'w') as f: |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 172 | LOG.info("Save tempest container inspect data") |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 173 | |
| 174 | container_inspect = json.dumps(inspect, |
| 175 | indent=4, sort_keys=True) |
| 176 | f.write(container_inspect) |
| 177 | |
Tatyana Leontovich | 61a821d | 2018-08-21 12:30:51 +0300 | [diff] [blame] | 178 | def prepare(self, dpdk=None): |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 179 | self.store_runtest_model() |
Oleksii Butenko | 09cc0cd | 2018-10-16 14:31:57 +0300 | [diff] [blame] | 180 | cirros_pillar = ("salt-call --out=newline_values_only " |
| 181 | "pillar.get " |
| 182 | "glance:client:identity:" |
| 183 | "admin_identity:image:cirros:location") |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 184 | salt_cmd = "salt -l info --hard-crash --state-output=mixed " |
| 185 | salt_call_cmd = "salt-call -l info --hard-crash --state-output=mixed " |
| 186 | commands = [ |
| 187 | { |
| 188 | 'description': "Sync salt objects for runtest model", |
| 189 | 'node_name': self.master_name, |
| 190 | 'cmd': ("set -ex;" + |
| 191 | salt_cmd + "'*' saltutil.refresh_pillar && " + |
| 192 | salt_cmd + "'*' saltutil.sync_all")}, |
| 193 | { |
| 194 | 'description': ("Install docker.io package and " |
| 195 | "enable packets forwarding"), |
| 196 | 'node_name': self.target_name, |
| 197 | 'cmd': ("set -ex;" + |
| 198 | salt_call_cmd + " pkg.install docker.io && " + |
| 199 | " iptables --policy FORWARD ACCEPT")}, |
| 200 | { |
| 201 | 'description': "Install PyPI docker package", |
| 202 | 'node_name': self.target_name, |
| 203 | 'cmd': ("set -ex;" + |
| 204 | salt_call_cmd + " pip.install setuptools && " + |
| 205 | salt_call_cmd + " pip.install docker")}, |
| 206 | { |
| 207 | 'description': "Run salt.minion state for runtest formula", |
| 208 | 'node_name': self.master_name, |
| 209 | 'cmd': ("set -ex;" + |
| 210 | salt_call_cmd + " state.sls salt.minion && " |
| 211 | " sleep 20")}, |
| 212 | { |
| 213 | 'description': "Enforce keystone state for neutronv2", |
| 214 | 'node_name': self.master_name, |
| 215 | 'cmd': ("set -ex;" + |
| 216 | salt_call_cmd + " state.sls keystone.client")}, |
| 217 | { |
| 218 | 'description': "Create networks for Tempest tests", |
| 219 | 'node_name': self.master_name, |
| 220 | 'cmd': ("set -ex;" + |
| 221 | salt_call_cmd + " state.sls neutron.client")}, |
| 222 | { |
| 223 | 'description': "Create flavors for Tempest tests", |
| 224 | 'node_name': self.master_name, |
| 225 | 'cmd': ("set -ex;" + |
| 226 | salt_call_cmd + " state.sls nova.client")}, |
| 227 | { |
Oleksii Butenko | 09cc0cd | 2018-10-16 14:31:57 +0300 | [diff] [blame] | 228 | 'description': "Upload images for Tempest", |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 229 | 'node_name': self.master_name, |
| 230 | 'cmd': ("set -ex;" + |
| 231 | salt_call_cmd + " state.sls glance.client")}, |
| 232 | { |
| 233 | 'description': "Generate config for Tempest", |
| 234 | 'node_name': self.master_name, |
| 235 | 'cmd': ("set -ex;" + |
| 236 | salt_call_cmd + " state.sls runtest")}, |
Oleksii Butenko | 09cc0cd | 2018-10-16 14:31:57 +0300 | [diff] [blame] | 237 | { |
| 238 | 'description': "Upload cirros image", |
| 239 | 'node_name': self.master_name, |
| 240 | 'cmd': ("set -ex;" |
| 241 | "cirros_url=$({}) && {} '{}' cmd.run " |
| 242 | "\"wget $cirros_url -O /tmp/TestCirros-0.3.5.img\"" |
| 243 | .format(cirros_pillar, salt_cmd, self.target_name))}, |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 244 | ] |
Oleksii Butenko | 5cd0a16 | 2018-06-14 18:18:10 +0300 | [diff] [blame] | 245 | |
Tatyana Leontovich | 61a821d | 2018-08-21 12:30:51 +0300 | [diff] [blame] | 246 | if dpdk: |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 247 | commands.append({ |
| 248 | 'description': "Configure flavor for DPDK", |
| 249 | 'node_name': self.control_name, |
| 250 | 'cmd': ("set -ex;" + |
| 251 | salt_call_cmd + " cmd.run " |
| 252 | " '. /root/keystonercv3;" |
| 253 | " openstack flavor set m1.tiny_test" |
| 254 | " --property hw:mem_page_size=small'")}, |
| 255 | ) |
Oleksii Butenko | 5cd0a16 | 2018-06-14 18:18:10 +0300 | [diff] [blame] | 256 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 257 | self.__salt_api.execute_commands(commands=commands, |
| 258 | label="Prepare for Tempest") |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 259 | |
| 260 | def run_tempest(self, timeout=600): |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 261 | tgt = self.target_name |
| 262 | image_nameversion = "{}:{}".format(self.image_name, self.image_version) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 263 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 264 | docker_args = ( |
Oleksii Butenko | b0ca4cc | 2018-10-22 16:29:54 +0300 | [diff] [blame] | 265 | " -t " |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 266 | " --name {container_name} " |
| 267 | " -e ARGS=\"-r {tempest_pattern} -w {tempest_threads}\"" |
| 268 | " -v {cfg_dir}/tempest.conf:/etc/tempest/tempest.conf" |
| 269 | " -v /tmp/:/tmp/" |
| 270 | " -v {cfg_dir}:/root/tempest" |
| 271 | " -v /etc/ssl/certs/:/etc/ssl/certs/" |
Oleksii Butenko | b0ca4cc | 2018-10-22 16:29:54 +0300 | [diff] [blame] | 272 | " -d " |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 273 | " {image_nameversion} {run_cmd}" |
| 274 | .format( |
| 275 | container_name=self.container_name, |
| 276 | image_nameversion=image_nameversion, |
| 277 | tempest_pattern=self.tempest_pattern, |
| 278 | tempest_threads=self.tempest_threads, |
| 279 | cfg_dir=TEMPEST_CFG_DIR, |
| 280 | run_cmd=self.run_cmd, |
| 281 | )) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 282 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 283 | commands = [ |
| 284 | { |
| 285 | 'description': "Run Tempest tests {0}".format( |
| 286 | image_nameversion), |
| 287 | 'node_name': self.target_name, |
| 288 | 'cmd': ("set -ex;" + |
| 289 | " docker rm --force {container_name} || true;" |
| 290 | " docker run {docker_args}" |
| 291 | .format(container_name=self.container_name, |
| 292 | docker_args=docker_args)), |
| 293 | 'timeout': timeout}, |
| 294 | ] |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 295 | |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 296 | self.__salt_api.execute_commands(commands=commands, |
| 297 | label="Run Tempest tests") |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 298 | |
Oleksii Butenko | b0ca4cc | 2018-10-22 16:29:54 +0300 | [diff] [blame] | 299 | def wait_status(s): |
| 300 | inspect_res = self.salt_api.local(tgt, |
| 301 | 'dockerng.inspect', |
| 302 | self.container_name) |
| 303 | if 'return' in inspect_res: |
| 304 | inspect = inspect_res['return'] |
| 305 | inspect = inspect[0] |
| 306 | inspect = next(inspect.iteritems())[1] |
| 307 | status = inspect['State']['Status'] |
| 308 | |
| 309 | return status.lower() == s.lower() |
| 310 | |
| 311 | return False |
| 312 | |
| 313 | helpers.wait(lambda: wait_status('exited'), |
| 314 | timeout=timeout, |
| 315 | timeout_msg=('Tempest run didnt finished ' |
| 316 | 'in {}'.format(timeout))) |
| 317 | |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 318 | inspect_res = self.salt_api.local(tgt, |
| 319 | 'dockerng.inspect', |
| 320 | self.container_name) |
| 321 | inspect = inspect_res['return'][0] |
| 322 | inspect = next(inspect.iteritems())[1] |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 323 | logs_res = self.salt_api.local(tgt, |
| 324 | 'dockerng.logs', |
| 325 | self.container_name) |
| 326 | logs = logs_res['return'][0] |
| 327 | logs = next(logs.iteritems())[1] |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 328 | |
| 329 | res = self.salt_api.local(tgt, 'dockerng.rm', self.container_name) |
| 330 | LOG.info("Tempest container was removed".format( |
| 331 | json.dumps(res, indent=4))) |
| 332 | |
| 333 | return {'inspect': inspect, |
| 334 | 'logs': logs} |
Oleksii Butenko | e82441d | 2018-06-12 16:01:33 +0300 | [diff] [blame] | 335 | |
Tatyana Leontovich | 61a821d | 2018-08-21 12:30:51 +0300 | [diff] [blame] | 336 | def prepare_and_run_tempest(self, username='root', dpdk=None): |
Oleksii Butenko | e82441d | 2018-06-12 16:01:33 +0300 | [diff] [blame] | 337 | """ |
| 338 | Run tempest tests |
| 339 | """ |
| 340 | tempest_timeout = settings.TEMPEST_TIMEOUT |
Tatyana Leontovich | 61a821d | 2018-08-21 12:30:51 +0300 | [diff] [blame] | 341 | self.prepare(dpdk=dpdk) |
Oleksii Butenko | e82441d | 2018-06-12 16:01:33 +0300 | [diff] [blame] | 342 | test_res = self.run_tempest(tempest_timeout) |
| 343 | self.fetch_arficats(username=username) |
| 344 | self.save_runtime_logs(**test_res) |