Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 1 | # Copyright 2016 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. |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 14 | import json |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 15 | import os |
| 16 | |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 17 | from devops.helpers import decorators |
| 18 | |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 19 | from tcp_tests.managers.execute_commands import ExecuteCommandsMixin |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 20 | from tcp_tests.managers.clients.prometheus import prometheus_client |
Tatyana Leontovich | 126b003 | 2017-08-30 20:51:20 +0300 | [diff] [blame] | 21 | from tcp_tests import logger |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 22 | from tcp_tests import settings |
Tatyana Leontovich | 126b003 | 2017-08-30 20:51:20 +0300 | [diff] [blame] | 23 | |
| 24 | LOG = logger.logger |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 25 | |
| 26 | |
| 27 | class SLManager(ExecuteCommandsMixin): |
| 28 | """docstring for OpenstackManager""" |
| 29 | |
| 30 | __config = None |
| 31 | __underlay = None |
| 32 | |
| 33 | def __init__(self, config, underlay, salt): |
| 34 | self.__config = config |
| 35 | self.__underlay = underlay |
| 36 | self._salt = salt |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 37 | self._p_client = None |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 38 | super(SLManager, self).__init__( |
| 39 | config=config, underlay=underlay) |
| 40 | |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 41 | def install(self, commands, label='Install SL services'): |
| 42 | self.execute_commands(commands, label=label) |
Dennis Dmitriev | fde667f | 2018-07-23 16:26:50 +0300 | [diff] [blame] | 43 | self.__config.stack_light.stacklight_installed = True |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 44 | |
| 45 | def get_sl_vip(self): |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 46 | tgt = 'I@prometheus:server:enabled:True' |
| 47 | pillar = 'keepalived:cluster:instance:prometheus_server_vip:address' |
Tatyana Leontovich | af20b67 | 2018-04-04 20:41:21 +0300 | [diff] [blame] | 48 | pill = 'keepalived:cluster:instance:stacklight_monitor_vip:address' |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 49 | sl_vip_address_pillars = self._salt.get_pillar(tgt=tgt, |
| 50 | pillar=pillar) |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 51 | sl_vip_ip = set([ip |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 52 | for item in sl_vip_address_pillars |
| 53 | for node, ip in item.items() if ip]) |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 54 | if not sl_vip_ip: |
dbrz | 19bd2ab | 2018-07-26 14:48:32 +0300 | [diff] [blame] | 55 | tgt = 'I@prometheus:server:enabled:True and mon*' |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 56 | pillar = 'keepalived:cluster:instance:VIP:address' |
| 57 | sl_vip_address_pillars = self._salt.get_pillar(tgt=tgt, |
| 58 | pillar=pillar) |
| 59 | sl_vip_ip = set([ip |
| 60 | for item in sl_vip_address_pillars |
| 61 | for node, ip in item.items() if ip]) |
Tatyana Leontovich | af20b67 | 2018-04-04 20:41:21 +0300 | [diff] [blame] | 62 | if len(sl_vip_ip) != 1: |
Tatyana Leontovich | 25e1f91 | 2018-04-04 16:29:10 +0300 | [diff] [blame] | 63 | sl_vip_address_pillars = self._salt.get_pillar(tgt=tgt, |
Tatyana Leontovich | af20b67 | 2018-04-04 20:41:21 +0300 | [diff] [blame] | 64 | pillar=pill) |
Tatyana Leontovich | 25e1f91 | 2018-04-04 16:29:10 +0300 | [diff] [blame] | 65 | sl_vip_ip = set([ip |
| 66 | for item in sl_vip_address_pillars |
| 67 | for node, ip in item.items() if ip]) |
Tatyana Leontovich | af20b67 | 2018-04-04 20:41:21 +0300 | [diff] [blame] | 68 | LOG.info("Current response is {}".format(sl_vip_address_pillars)) |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 69 | assert len(sl_vip_ip) == 1, ( |
sgudz | 4fab65f | 2017-10-25 16:51:56 +0300 | [diff] [blame] | 70 | "SL VIP not found or found more than one SL VIP in pillars:{0}, " |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 71 | "expected one!").format(sl_vip_ip) |
| 72 | sl_vip_ip_host = sl_vip_ip.pop() |
| 73 | return sl_vip_ip_host |
| 74 | |
| 75 | @property |
| 76 | def api(self): |
| 77 | if self._p_client is None: |
Dennis Dmitriev | 66650fc | 2018-11-02 11:04:37 +0200 | [diff] [blame] | 78 | self.__config.stack_light.sl_vip_host = self.get_sl_vip() |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 79 | self._p_client = prometheus_client.PrometheusClient( |
| 80 | host=self.__config.stack_light.sl_vip_host, |
| 81 | port=self.__config.stack_light.sl_prometheus_port, |
| 82 | proto=self.__config.stack_light.sl_prometheus_proto) |
| 83 | return self._p_client |
Tatyana Leontovich | 126b003 | 2017-08-30 20:51:20 +0300 | [diff] [blame] | 84 | |
| 85 | def get_monitoring_nodes(self): |
| 86 | return [node_name for node_name |
| 87 | in self.__underlay.node_names() if 'mon' in node_name] |
| 88 | |
| 89 | def get_service_info_from_node(self, node_name): |
| 90 | service_stat_dict = {} |
| 91 | with self.__underlay.remote(node_name=node_name) as node_remote: |
| 92 | result = node_remote.execute( |
| 93 | "docker service ls --format '{{.Name}}:{{.Replicas}}'") |
| 94 | LOG.debug("Service ls result {0} from node {1}".format( |
| 95 | result['stdout'], node_name)) |
| 96 | for line in result['stdout']: |
| 97 | tmp = line.split(':') |
| 98 | service_stat_dict.update({tmp[0]: tmp[1]}) |
| 99 | return service_stat_dict |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 100 | |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 101 | def setup_sl_functional_tests(self, node_to_run, |
| 102 | repo_path='/root/stacklight-pytest', |
| 103 | sl_test_repo=settings.SL_TEST_REPO, |
| 104 | sl_test_commit=settings.SL_TEST_COMMIT): |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 105 | target_node_name = [node_name for node_name |
| 106 | in self.__underlay.node_names() |
| 107 | if node_to_run in node_name] |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 108 | cmd_install = ( |
| 109 | "set -ex;" |
| 110 | "apt-get install -y build-essential python-dev " |
| 111 | " virtualenv;" |
| 112 | "[ -d venv-stacklight-pytest ] || " |
| 113 | " virtualenv --system-site-packages venv-stacklight-pytest;" |
| 114 | ". venv-stacklight-pytest/bin/activate;" |
| 115 | "if [ ! -d {repo_path} ]; then" |
| 116 | " git clone {sl_test_repo} {repo_path};" |
| 117 | "fi;" |
| 118 | "pushd {repo_path};" |
| 119 | "git checkout {sl_test_commit};" |
| 120 | "popd;" |
| 121 | "pip install {repo_path};" |
| 122 | .format(repo_path=repo_path, |
| 123 | sl_test_repo=sl_test_repo, |
| 124 | sl_test_commit=sl_test_commit) |
| 125 | ) |
| 126 | |
| 127 | cmd_configure = ( |
| 128 | "set -ex;" |
| 129 | ". venv-stacklight-pytest/bin/activate;" |
| 130 | "stl-tests gen-config-mk;" |
| 131 | "cp venv-stacklight-pytest/lib/python2.7/site-packages/" |
| 132 | "stacklight_tests/fixtures/config.yaml " |
| 133 | "{repo_path}/stacklight_tests/fixtures/config.yaml;" |
| 134 | .format(repo_path=repo_path) |
| 135 | ) |
| 136 | |
| 137 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 138 | as node_remote: |
| 139 | LOG.info("Install stacklight-pytest on the node {0}".format( |
| 140 | target_node_name[0])) |
| 141 | node_remote.check_call(cmd_install, verbose=True) |
| 142 | |
| 143 | LOG.info("Configure stacklight-pytest on the node {0}".format( |
| 144 | target_node_name[0])) |
| 145 | node_remote.check_call(cmd_configure, verbose=True) |
| 146 | |
| 147 | def run_sl_functional_tests(self, node_to_run, tests_path, |
| 148 | test_to_run, skip_tests, |
| 149 | reruns=5, reruns_delay=60, |
| 150 | junit_report_name='report.xml'): |
| 151 | target_node_name = [node_name for node_name |
| 152 | in self.__underlay.node_names() |
| 153 | if node_to_run in node_name] |
| 154 | cmd = ("set -ex;" |
| 155 | ". venv-stacklight-pytest/bin/activate;" |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 156 | "cd {tests_path}; " |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 157 | "export VOLUME_STATUS='available';" |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 158 | "pytest {reruns} {reruns_delay} --junit-xml={junit_report_name}" |
| 159 | " -k {skip_tests} {test_to_run}".format(**{ |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 160 | "tests_path": tests_path, |
| 161 | "skip_tests": ("'not " + skip_tests + "'" |
| 162 | if skip_tests else ''), |
| 163 | "test_to_run": test_to_run, |
| 164 | "reruns": ("--reruns {}".format(reruns) |
| 165 | if reruns > 1 else ""), |
| 166 | "reruns_delay": ("--reruns-delay {}".format(reruns_delay) |
| 167 | if reruns_delay > 0 else ""), |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 168 | "junit_report_name": junit_report_name, |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 169 | })) |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 170 | |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 171 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 172 | as node_remote: |
Tatyana Leontovich | 58ae755 | 2017-09-22 11:24:06 +0300 | [diff] [blame] | 173 | LOG.debug("Run {0} on the node {1}".format( |
| 174 | cmd, target_node_name[0])) |
Dennis Dmitriev | 092c6f3 | 2018-02-20 15:12:19 +0200 | [diff] [blame] | 175 | result = node_remote.execute(cmd, verbose=True) |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 176 | LOG.debug("Test execution result is {}".format(result)) |
| 177 | return result |
| 178 | |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 179 | def run_sl_tests_json(self, node_to_run, tests_path, |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 180 | test_to_run, skip_tests, reruns=5, reruns_delay=60): |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 181 | target_node_name = [node_name for node_name |
| 182 | in self.__underlay.node_names() |
| 183 | if node_to_run in node_name] |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 184 | cmd = ("set -ex;" |
| 185 | ". venv-stacklight-pytest/bin/activate;" |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 186 | "cd {tests_path}; " |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 187 | "export VOLUME_STATUS='available';" |
| 188 | "pip install pytest-json;" |
Dmitry Tyzhnenko | 11db68e | 2018-05-16 18:11:35 +0300 | [diff] [blame] | 189 | "pytest --json=report.json {reruns} {reruns_delay} " |
Dmitry Kalashnik | 1832059 | 2018-04-16 17:17:01 +0400 | [diff] [blame] | 190 | "-k {skip_tests} {test_to_run}".format(**{ |
| 191 | "tests_path": tests_path, |
| 192 | "skip_tests": ("'not " + skip_tests + "'" |
| 193 | if skip_tests else ''), |
| 194 | "test_to_run": test_to_run, |
| 195 | "reruns": ("--reruns {}".format(reruns) |
| 196 | if reruns > 1 else ""), |
| 197 | "reruns_delay": ("--reruns-delay {}".format(reruns_delay) |
| 198 | if reruns_delay > 0 else ""), |
| 199 | })) |
Dennis Dmitriev | d788311 | 2018-01-18 00:50:56 +0200 | [diff] [blame] | 200 | |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 201 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 202 | as node_remote: |
| 203 | LOG.debug("Run {0} on the node {1}".format( |
| 204 | cmd, target_node_name[0])) |
Dennis Dmitriev | 092c6f3 | 2018-02-20 15:12:19 +0200 | [diff] [blame] | 205 | node_remote.execute(cmd, verbose=True) |
Dennis Dmitriev | bc0b094 | 2018-02-07 22:37:37 +0200 | [diff] [blame] | 206 | res = node_remote.check_call('cd {0}; cat report.json'.format( |
| 207 | tests_path), verbose=True) |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 208 | LOG.debug("Test execution result is {}".format(res['stdout'])) |
| 209 | result = json.loads(res['stdout'][0]) |
| 210 | return result['report']['tests'] |
| 211 | |
Tatyana Leontovich | 063d0ff | 2017-09-05 18:11:55 +0300 | [diff] [blame] | 212 | def download_sl_test_report(self, stored_node, file_path): |
| 213 | target_node_name = [node_name for node_name |
| 214 | in self.__underlay.node_names() |
| 215 | if stored_node in node_name] |
| 216 | with self.__underlay.remote(node_name=target_node_name[0]) as r: |
| 217 | r.download( |
| 218 | destination=file_path, |
| 219 | target=os.getcwd()) |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 220 | |
| 221 | def check_docker_services(self, nodes, expected_services): |
| 222 | """Check presense of the specified docker services on all the nodes |
| 223 | :param nodes: list of strings, names of nodes to check |
| 224 | :param expected_services: list of strings, names of services to find |
| 225 | """ |
| 226 | for node in nodes: |
| 227 | services_status = self.get_service_info_from_node(node) |
Dennis Dmitriev | ea291ee | 2018-03-16 12:27:43 +0200 | [diff] [blame] | 228 | assert set(services_status) >= set(expected_services), \ |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 229 | 'Some services are missed on node {0}. ' \ |
| 230 | 'Current service list: {1}\nExpected service list: {2}' \ |
| 231 | .format(node, services_status, expected_services) |
| 232 | for service in expected_services: |
| 233 | assert service in services_status,\ |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 234 | 'Missing service {0} in {1}'.format(service, |
| 235 | services_status) |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 236 | assert '0' not in services_status.get(service),\ |
| 237 | 'Service {0} failed to start'.format(service) |
| 238 | |
| 239 | @decorators.retry(AssertionError, count=10, delay=5) |
| 240 | def check_prometheus_targets(self, nodes): |
| 241 | """Check the status for Prometheus targets |
| 242 | :param nodes: list of strings, names of nodes with keepalived VIP |
| 243 | """ |
| 244 | prometheus_client = self.api |
Dennis Dmitriev | d9403e2 | 2017-12-01 12:28:26 +0200 | [diff] [blame] | 245 | current_targets = prometheus_client.get_targets() |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 246 | |
| 247 | LOG.debug('Current targets after install {0}' |
| 248 | .format(current_targets)) |
| 249 | # Assert that targets are up |
| 250 | for entry in current_targets: |
| 251 | assert 'up' in entry['health'], \ |
| 252 | 'Next target is down {}'.format(entry) |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 253 | |
| 254 | def kill_sl_service_on_node(self, node_sub_name, service_name): |
| 255 | target_node_name = [node_name for node_name |
| 256 | in self.__underlay.node_names() |
| 257 | if node_sub_name in node_name] |
| 258 | cmd = 'kill -9 $(pidof {0})'.format(service_name) |
| 259 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 260 | as node_remote: |
| 261 | LOG.debug("Run {0} on the node {1}".format( |
| 262 | cmd, target_node_name[0])) |
| 263 | res = node_remote.execute(cmd) |
| 264 | LOG.debug("Test execution result is {}".format(res)) |
| 265 | assert res['exit_code'] == 0, ( |
| 266 | 'Unexpected exit code for command {0}, ' |
| 267 | 'current result {1}'.format(cmd, res)) |
| 268 | |
| 269 | def stop_sl_service_on_node(self, node_sub_name, service_name): |
| 270 | target_node_name = [node_name for node_name |
| 271 | in self.__underlay.node_names() |
| 272 | if node_sub_name in node_name] |
| 273 | cmd = 'systemctl stop {}'.format(service_name) |
| 274 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 275 | as node_remote: |
| 276 | LOG.debug("Run {0} on the node {1}".format( |
| 277 | cmd, target_node_name[0])) |
| 278 | res = node_remote.execute(cmd) |
| 279 | LOG.debug("Test execution result is {}".format(res)) |
| 280 | assert res['exit_code'] == 0, ( |
| 281 | 'Unexpected exit code for command {0}, ' |
| 282 | 'current result {1}'.format(cmd, res)) |
| 283 | |
| 284 | def post_data_into_influx(self, node_sub_name): |
| 285 | target_node_name = [node_name for node_name |
| 286 | in self.__underlay.node_names() |
| 287 | if node_sub_name in node_name] |
| 288 | vip = self.get_sl_vip() |
| 289 | cmd = ("curl -POST 'http://{0}:8086/write?db=lma' -u " |
| 290 | "lma:lmapass --data-binary 'mymeas value=777'".format(vip)) |
| 291 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 292 | as node_remote: |
| 293 | LOG.debug("Run {0} on the node {1}".format( |
| 294 | cmd, target_node_name[0])) |
| 295 | res = node_remote.execute(cmd) |
| 296 | assert res['exit_code'] == 0, ( |
| 297 | 'Unexpected exit code for command {0}, ' |
| 298 | 'current result {1}'.format(cmd, res)) |
| 299 | |
| 300 | def check_data_in_influxdb(self, node_sub_name): |
| 301 | target_node_name = [node_name for node_name |
| 302 | in self.__underlay.node_names() |
| 303 | if node_sub_name in node_name] |
| 304 | vip = self.get_sl_vip() |
| 305 | cmd = ("influx -host {0} -port 8086 -database lma " |
| 306 | "-username lma -password lmapass -execute " |
| 307 | "'select * from mymeas' -precision rfc3339;".format(vip)) |
| 308 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 309 | as node_remote: |
| 310 | LOG.debug("Run {0} on the node {1}".format( |
| 311 | cmd, target_node_name[0])) |
| 312 | res = node_remote.execute(cmd) |
| 313 | assert res['exit_code'] == 0, ( |
| 314 | 'Unexpected exit code for command {0}, ' |
| 315 | 'current result {1}'.format(cmd, res)) |
Dennis Dmitriev | 8ce8515 | 2017-11-29 00:05:12 +0200 | [diff] [blame] | 316 | if res['stdout']: |
| 317 | return res['stdout'][0].rstrip() |
| 318 | else: |
| 319 | return '' |
Tatyana Leontovich | a6c64a7 | 2017-10-25 22:21:18 +0300 | [diff] [blame] | 320 | |
| 321 | def start_service(self, node_sub_name, service_name): |
| 322 | target_node_name = [node_name for node_name |
| 323 | in self.__underlay.node_names() |
| 324 | if node_sub_name in node_name] |
| 325 | cmd = 'systemctl start {0}'.format(service_name) |
| 326 | with self.__underlay.remote(node_name=target_node_name[0]) \ |
| 327 | as node_remote: |
| 328 | LOG.debug("Run {0} on the node {1}".format( |
| 329 | cmd, target_node_name[0])) |
| 330 | res = node_remote.execute(cmd) |
| 331 | assert res['exit_code'] == 0, ( |
| 332 | 'Unexpected exit code for command {0}, ' |
| 333 | 'current result {1}'.format(cmd, res)) |