1 # -*- coding: utf-8 -*-
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
15 """Executing test of plugins"""
18 from keystoneclient.v3 import client
26 from opnfv.deployment import factory
29 GNOCCHI_NAME = 'gnocchi'
30 ID_RSA_SRC = '/root/.ssh/id_rsa'
31 ID_RSA_DST_DIR = '/root/.ssh'
32 ID_RSA_DST = ID_RSA_DST_DIR + '/id_rsa'
33 APEX_IP = subprocess.check_output("echo $INSTALLER_IP", shell=True)
35 APEX_USER_STACK = 'stack'
36 APEX_PKEY = '/root/.ssh/id_rsa'
39 class KeystoneException(Exception):
40 """Keystone exception class"""
41 def __init__(self, message, exc=None, response=None):
44 message -- error message
49 message += "\nReason: %s" % exc
50 super(KeystoneException, self).__init__(message)
52 self.response = response
56 class InvalidResponse(KeystoneException):
57 """Invalid Keystone exception class"""
58 def __init__(self, exc, response):
64 super(InvalidResponse, self).__init__(
65 "Invalid response", exc, response)
69 handler = factory.Factory.get_handler('apex',
73 nodes = handler.get_nodes()
77 class GnocchiClient(object):
78 # Gnocchi Client to authenticate and request meters
80 self._auth_token = None
81 self._gnocchi_url = None
82 self._meter_list = None
87 return self._auth_token
89 def get_gnocchi_url(self):
91 return self._gnocchi_url
93 def get_gnocchi_metrics(self, criteria=None):
94 # Subject to change if metric gathering is different for gnocchi
95 self._request_meters(criteria)
96 return self._meter_list
98 def _auth_server(self):
99 # Request token in authentication server
100 logger.debug('Connecting to the auth server {}'.format(
101 os.environ['OS_AUTH_URL']))
102 keystone = client.Client(username=os.environ['OS_USERNAME'],
103 password=os.environ['OS_PASSWORD'],
104 tenant_name=os.environ['OS_USERNAME'],
105 auth_url=os.environ['OS_AUTH_URL'])
106 self._auth_token = keystone.auth_token
107 for service in keystone.service_catalog.get_data():
108 if service['name'] == GNOCCHI_NAME:
109 for service_type in service['endpoints']:
110 if service_type['interface'] == 'internal':
111 self._gnocchi_url = service_type['url']
113 if self._gnocchi_url is None:
114 logger.warning('Gnocchi is not registered in service catalog')
116 def _request_meters(self, criteria):
117 """Request meter list values from ceilometer
120 criteria -- criteria for ceilometer meter list
123 url = self._gnocchi_url + ('/v2/metric?limit=400')
125 url = self._gnocchi_url \
126 + ('/v3/metric/%s?q.field=metric&limit=400' % criteria)
127 headers = {'X-Auth-Token': self._auth_token}
128 resp = requests.get(url, headers=headers)
130 resp.raise_for_status()
131 self._meter_list = resp.json()
132 except (KeyError, ValueError, requests.exceptions.HTTPError) as err:
133 raise InvalidResponse(err, resp)
136 class AodhClient(object):
137 # Gnocchi Client to authenticate and request meters
139 self._auth_token = None
140 self._aodh_url = None
141 self._meter_list = None
143 def auth_token(self):
146 return self._auth_token
148 def get_aodh_url(self):
150 return self._gnocchi_url
152 def get_aodh_metrics(self, criteria=None):
153 # Subject to change if metric gathering is different for gnocchi
154 self._request_meters(criteria)
155 return self._meter_list
157 def _auth_server(self):
158 # Request token in authentication server
159 logger.debug('Connecting to the AODH auth server {}'.format(
160 os.environ['OS_AUTH_URL']))
161 keystone = client.Client(username=os.environ['OS_USERNAME'],
162 password=os.environ['OS_PASSWORD'],
163 tenant_name=os.environ['OS_USERNAME'],
164 auth_url=os.environ['OS_AUTH_URL'])
165 self._auth_token = keystone.auth_token
166 for service in keystone.service_catalog.get_data():
167 if service['name'] == AODH_NAME:
168 for service_type in service['endpoints']:
169 if service_type['interface'] == 'internal':
170 self._gnocchi_url = service_type['url']
172 if self._aodh_url is None:
173 logger.warning('Aodh is not registered in service catalog')
176 class CSVClient(object):
177 """Client to request CSV meters"""
178 def __init__(self, conf):
181 conf -- ConfigServer instance
186 self, compute_node, plugin_subdirectories, meter_categories):
190 compute_node -- compute node instance
191 plugin_subdirectories -- list of subdirectories of plug-in
192 meter_categories -- categories which will be tested
194 Return list of metrics.
196 compute_name = compute_node.get_name()
197 nodes = get_apex_nodes()
199 if compute_name == node.get_dict()['name']:
202 hostname = node.run_cmd('hostname -A')
203 hostname = hostname.split()[0]
205 for plugin_subdir in plugin_subdirectories:
206 for meter_category in meter_categories:
207 stdout1 = node.run_cmd(
208 "tail -2 /var/lib/collectd/csv/"
209 + "{0}/{1}/{2}-{3}".format(
210 hostname, plugin_subdir,
211 meter_category, date))
212 stdout2 = node.run_cmd(
213 "tail -1 /var/lib/collectd/csv/"
214 + "{0}.jf.intel.com/{1}/{2}-{3}".format(
215 compute_node.get_name(), plugin_subdir,
216 meter_category, date))
217 # Storing last two values
221 'Getting last two CSV entries of meter category'
222 + ' {0} in {1} subdir failed'.format(
223 meter_category, plugin_subdir))
225 values = values.split(',')
226 old_value = float(values[0])
227 stdout2 = stdout2.split(',')
228 new_value = float(stdout2[0])
230 plugin_subdir, meter_category, old_value,
235 def get_csv_categories_for_ipmi(conf, compute_node):
239 compute_node -- compute node instance
241 Return list of categories.
243 stdout = conf.execute_command(
244 "date '+%Y-%m-%d'", compute_node.get_ip())
245 date = stdout[0].strip()
246 categories = conf.execute_command(
247 "ls /var/lib/collectd/csv/{0}.jf.intel.com/ipmi | grep {1}".format(
248 compute_node.get_name(), date), compute_node.get_ip())
249 return [category.strip()[:-11] for category in categories]
252 def _process_result(compute_node, out_plugin, test, result, results_list):
253 """Print test result and append it to results list.
256 test -- testcase name
257 result -- boolean test result
258 results_list -- results list
262 'Test case {0} PASSED with {1}.'.format(
266 'Test case {0} FAILED with {1}.'.format(
268 results_list.append((compute_node, out_plugin, test, result))
271 def _print_label(label):
272 """Print label on the screen
275 label -- label string
277 label = label.strip()
280 label = ' ' + label + ' '
281 length_label = len(label)
282 length1 = (length - length_label) / 2
283 length2 = length - length_label - length1
284 length1 = max(3, length1)
285 length2 = max(3, length2)
286 logger.info(('=' * length1) + label + ('=' * length2))
289 def _print_plugin_label(plugin, node_name):
290 """Print plug-in label.
293 plugin -- plug-in name
297 'Node {0}: Plug-in {1} Test case execution'.format(node_name, plugin))
300 def _print_final_result_of_plugin(
301 plugin, compute_ids, results, out_plugins, out_plugin):
302 """Print final results of plug-in.
305 plugin -- plug-in name
306 compute_ids -- list of compute node IDs
307 results -- results list
308 out_plugins -- list of out plug-ins
309 out_plugin -- used out plug-in
312 for id in compute_ids:
313 if out_plugin == 'Gnocchi':
314 if (id, out_plugin, plugin, True) in results:
315 print_line += ' PASS |'
316 elif (id, out_plugin, plugin, False) in results:
317 print_line += ' FAIL |'
319 print_line += ' NOT EX |'
320 elif out_plugin == 'AODH':
321 if (id, out_plugin, plugin, True) in results:
322 print_line += ' PASS |'
323 elif (id, out_plugin, plugin, False) in results:
324 print_line += ' FAIL |'
326 print_line += ' FAIL |'
327 elif out_plugin == 'SNMP':
328 if (id, out_plugin, plugin, True) in results:
329 print_line += ' PASS |'
330 elif (id, out_plugin, plugin, False) in results:
331 print_line += ' FAIL |'
333 print_line += ' FAIL |'
334 elif out_plugin == 'CSV':
335 if (id, out_plugin, plugin, True) in results:
336 print_line += ' PASS |'
337 elif (id, out_plugin, plugin, False) in results:
338 print_line += ' FAIL |'
340 print_line += ' NOT EX |'
342 print_line += ' SKIP |'
346 def print_overall_summary(
347 compute_ids, tested_plugins, aodh_plugins, results, out_plugins):
348 """Print overall summary table.
351 compute_ids -- list of compute IDs
352 tested_plugins -- list of plug-ins
353 results -- results list
354 out_plugins -- list of used out plug-ins
356 compute_node_names = ['Node-{}'.format(i) for i in range(
358 all_computes_in_line = ''
359 for compute in compute_node_names:
360 all_computes_in_line += '| ' + compute + (' ' * (7 - len(compute)))
361 line_of_nodes = '| Test ' + all_computes_in_line + '|'
362 logger.info('=' * 70)
363 logger.info('+' + ('-' * ((9 * len(compute_node_names))+16)) + '+')
365 '|' + ' ' * ((9*len(compute_node_names))/2)
368 9*len(compute_node_names) - (9*len(compute_node_names))/2)
371 '+' + ('-' * 16) + '+' + (('-' * 8) + '+') * len(compute_node_names))
372 logger.info(line_of_nodes)
374 '+' + ('-' * 16) + '+' + (('-' * 8) + '+') * len(compute_node_names))
375 out_plugins_print = []
376 out_plugins_print1 = []
377 for key in out_plugins.keys():
378 if 'Gnocchi' in out_plugins[key]:
379 out_plugins_print1.append('Gnocchi')
380 if 'AODH' in out_plugins[key]:
381 out_plugins_print1.append('AODH')
382 if 'SNMP' in out_plugins[key]:
383 out_plugins_print1.append('SNMP')
384 if 'CSV' in out_plugins[key]:
385 out_plugins_print1.append('CSV')
386 for i in out_plugins_print1:
387 if i not in out_plugins_print:
388 out_plugins_print.append(i)
389 for out_plugin in out_plugins_print:
390 output_plugins_line = ''
391 for id in compute_ids:
392 out_plugin_result = '----'
393 if out_plugin == 'Gnocchi':
394 out_plugin_result = \
396 elif out_plugin == 'AODH':
397 out_plugin_result = \
399 elif out_plugin == 'SNMP':
400 out_plugin_result = \
402 elif out_plugin == 'CSV':
403 out_plugin_result = \
405 plugin for comp_id, out_pl, plugin, res in results
406 if comp_id == id and res] else 'FAIL'
408 out_plugin_result = \
410 output_plugins_line += '| ' + out_plugin_result + ' '
412 '| OUT:{}'.format(out_plugin) + (' ' * (11 - len(out_plugin)))
413 + output_plugins_line + '|')
415 if out_plugin == 'AODH':
416 for plugin in sorted(aodh_plugins.values()):
417 line_plugin = _print_final_result_of_plugin(
418 plugin, compute_ids, results, out_plugins, out_plugin)
420 '| IN:{}'.format(plugin) + (' ' * (11-len(plugin)))
423 for plugin in sorted(tested_plugins.values()):
424 line_plugin = _print_final_result_of_plugin(
425 plugin, compute_ids, results, out_plugins, out_plugin)
427 '| IN:{}'.format(plugin) + (' ' * (11-len(plugin)))
430 '+' + ('-' * 16) + '+'
431 + (('-' * 8) + '+') * len(compute_node_names))
432 logger.info('=' * 70)
436 test_labels, name, out_plugin, controllers, compute_node,
437 conf, results, error_plugins, out_plugins):
438 """Execute the testcase.
441 test_labels -- dictionary of plug-in IDs and their display names
442 name -- plug-in ID, key of test_labels dictionary
443 ceilometer_running -- boolean indicating whether Ceilometer is running
444 compute_node -- compute node ID
445 conf -- ConfigServer instance
446 results -- results list
447 error_plugins -- list of tuples with plug-in errors
448 (plugin, error_description, is_critical):
449 plugin -- plug-in ID, key of test_labels dictionary
450 error_decription -- description of the error
451 is_critical -- boolean value indicating whether error is critical
453 ovs_interfaces = conf.get_ovs_interfaces(compute_node)
454 ovs_configured_interfaces = conf.get_plugin_config_values(
455 compute_node, 'ovs_events', 'Interfaces')
456 ovs_configured_bridges = conf.get_plugin_config_values(
457 compute_node, 'ovs_stats', 'Bridges')
458 ovs_existing_configured_int = [
459 interface for interface in ovs_interfaces
460 if interface in ovs_configured_interfaces]
461 ovs_existing_configured_bridges = [
462 bridge for bridge in ovs_interfaces
463 if bridge in ovs_configured_bridges]
464 plugin_prerequisites = {
466 conf.is_mcelog_installed(compute_node, 'mcelog'),
467 'mcelog must be installed.')],
469 len(ovs_existing_configured_int) > 0 or len(ovs_interfaces) > 0,
470 'Interfaces must be configured.')],
472 len(ovs_existing_configured_bridges) > 0,
473 'Bridges must be configured.')]}
474 gnocchi_criteria_lists = {
475 'hugepages': 'hugepages',
478 'ovs_events': 'interface-ovs-system',
479 'ovs_stats': 'ovs_stats-br0.br0'}
480 aodh_criteria_lists = {
482 'ovs_events': 'ovs_events'}
484 'intel_rdt': '/usr/share/snmp/mibs/Intel-Rdt.txt',
485 'hugepages': '/usr/share/snmp/mibs/Intel-Hugepages.txt',
486 'mcelog': '/usr/share/snmp/mibs/Intel-Mcelog.txt'}
488 'intel_rdt': 'INTEL-RDT-MIB::rdtLlc.1',
489 'hugepages': 'INTEL-HUGEPAGES-MIB::hugepagesPageFree',
490 'mcelog': 'INTEL-MCELOG-MIB::memoryCorrectedErrors.1'}
491 nr_hugepages = int(time.time()) % 10000
494 'hugepages': 'echo {} > /sys/kernel/'.format(nr_hugepages)
495 + 'mm/hugepages/hugepages-2048kB/nr_hugepages',
496 'mcelog': '/root/mce-inject_df < /root/corrected'}
501 'hugepages-mm-2048Kb', 'hugepages-node0-2048Kb',
502 'hugepages-node1-2048Kb'],
505 'mcelog-SOCKET_0_CHANNEL_0_DIMM_any',
506 'mcelog-SOCKET_0_CHANNEL_any_DIMM_any'],
508 'ovs_stats-br0.br0'],
511 # csv_meter_categories_ipmi = get_csv_categories_for_ipmi(conf,
513 csv_meter_categories = {
516 'hugepages': ['vmpage_number-free', 'vmpage_number-used'],
517 # 'ipmi': csv_meter_categories_ipmi,
519 'errors-corrected_memory_errors',
520 'errors-uncorrected_memory_errors'],
522 'if_dropped', 'if_errors', 'if_packets'],
523 'ovs_events': ['gauge-link_status']}
526 test_labels[name] if name in test_labels else name,
527 compute_node.get_name())
528 plugin_critical_errors = [
529 error for plugin, error, critical in error_plugins
530 if plugin == name and critical]
531 if plugin_critical_errors:
532 logger.error('Following critical errors occurred:'.format(name))
533 for error in plugin_critical_errors:
534 logger.error(' * ' + error)
536 compute_node.get_id(), out_plugin, test_labels[name], False,
540 error for plugin, error, critical in error_plugins
541 if plugin == name and not critical]
543 logger.warning('Following non-critical errors occured:')
544 for error in plugin_errors:
545 logger.warning(' * ' + error)
546 failed_prerequisites = []
547 if name in plugin_prerequisites:
548 failed_prerequisites = [
549 prerequisite_name for prerequisite_passed,
550 prerequisite_name in plugin_prerequisites[name]
551 if not prerequisite_passed]
552 if failed_prerequisites:
554 '{} test will not be executed, '.format(name)
555 + 'following prerequisites failed:')
556 for prerequisite in failed_prerequisites:
557 logger.error(' * {}'.format(prerequisite))
559 plugin_interval = conf.get_plugin_interval(compute_node, name)
560 if out_plugin == 'Gnocchi':
561 res = conf.test_plugins_with_gnocchi(
562 compute_node.get_name(), plugin_interval,
563 logger, criteria_list=gnocchi_criteria_lists[name])
564 if out_plugin == 'AODH':
565 res = conf.test_plugins_with_aodh(
566 compute_node.get_name(), plugin_interval,
567 logger, criteria_list=aodh_criteria_lists[name])
568 if out_plugin == 'SNMP':
570 name in snmp_mib_files and name in snmp_mib_strings \
571 and conf.test_plugins_with_snmp(
572 compute_node.get_name(), plugin_interval, logger, name,
573 snmp_mib_files[name], snmp_mib_strings[name],
574 snmp_in_commands[name])
575 if out_plugin == 'CSV':
576 res = tests.test_csv_handles_plugin_data(
577 compute_node, conf.get_plugin_interval(compute_node, name),
578 name, csv_subdirs[name], csv_meter_categories[name],
579 logger, CSVClient(conf))
581 if res and plugin_errors:
583 'Test works, but will be reported as failure,'
584 + 'because of non-critical errors.')
587 compute_node.get_id(), out_plugin, test_labels[name],
591 def get_results_for_ovs_events(
592 plugin_labels, plugin_name, gnocchi_running,
593 compute_node, conf, results, error_plugins):
594 """ Testing OVS Events with python plugin
596 plugin_label = 'OVS events'
597 res = conf.enable_ovs_events(
598 compute_node, plugin_label, error_plugins, create_backup=False)
600 compute_node.get_id(), plugin_label, res, results)
601 logger.info("Results for OVS Events = {}" .format(results))
604 def create_ovs_bridge():
605 """Create OVS brides on compute nodes"""
606 handler = factory.Factory.get_handler('apex',
610 nodes = handler.get_nodes()
611 logger.info("Creating OVS bridges on computes nodes")
613 if node.is_compute():
614 node.run_cmd('sudo ovs-vsctl add-br br0')
615 node.run_cmd('sudo ovs-vsctl set-manager ptcp:6640')
616 logger.info('OVS Bridges created on compute nodes')
619 def mcelog_install():
620 """Install mcelog on compute nodes."""
621 _print_label('Enabling mcelog and OVS bridges on compute nodes')
622 handler = factory.Factory.get_handler('apex',
626 nodes = handler.get_nodes()
628 if node.is_compute():
629 centos_release = node.run_cmd('uname -r')
630 if '3.10.0-514.26.2.el7.x86_64' not in centos_release:
632 'Mcelog will not be enabled '
633 + 'on node-{0}, '.format(node.get_dict()['name'])
634 + 'unsupported CentOS release found ({1}).'.format(
638 'Checking if mcelog is enabled'
639 + ' on node-{}...'.format(node.get_dict()['name']))
640 res = node.run_cmd('ls')
641 if 'mce-inject_ea' and 'corrected' in res:
643 'Mcelog seems to be already installed '
644 + 'on node-{}.'.format(node.get_dict()['name']))
645 node.run_cmd('sudo modprobe mce-inject')
646 node.run_cmd('sudo ./mce-inject_ea < corrected')
649 'Mcelog will be enabled on node-{}...'.format(
650 node.get_dict()['id']))
652 '/usr/local/lib/python2.7/dist-packages/baro_tests/'
653 + 'mce-inject_ea', 'mce-inject_ea')
654 node.run_cmd('chmod a+x mce-inject_ea')
655 node.run_cmd('echo "CPU 0 BANK 0" > corrected')
657 'echo "STATUS 0xcc00008000010090" >>'
660 'echo "ADDR 0x0010FFFFFFF" >> corrected')
661 node.run_cmd('sudo modprobe mce-inject')
662 node.run_cmd('sudo ./mce-inject_ea < corrected')
663 logger.info('Mcelog is installed on all compute nodes')
667 """Uninstall mcelog from compute nodes."""
668 handler = factory.Factory.get_handler(
669 'apex', APEX_IP, APEX_USER, APEX_PKEY)
670 nodes = handler.get_nodes()
672 if node.is_compute():
673 output = node.run_cmd('ls')
674 if 'mce-inject_ea' in output:
675 node.run_cmd('rm mce-inject_ea')
676 if 'corrected' in output:
677 node.run_cmd('rm corrected')
678 node.run_cmd('sudo systemctl restart mcelog')
679 logger.info('Mcelog is deleted from all compute nodes')
683 if not os.path.isdir(ID_RSA_DST_DIR):
684 os.makedirs(ID_RSA_DST_DIR)
685 if not os.path.isfile(ID_RSA_DST):
687 "RSA key file {} doesn't exist".format(ID_RSA_DST)
688 + ", it will be downloaded from installer node.")
689 handler = factory.Factory.get_handler(
690 'apex', APEX_IP, APEX_USER, APEX_PKEY)
691 apex = handler.get_installer_node()
692 apex.get_file(ID_RSA_SRC, ID_RSA_DST)
694 logger.info("RSA key file {} exists.".format(ID_RSA_DST))
698 """Check whether there is global logger available and if not, define one."""
699 if 'logger' not in globals():
701 logger = logger.Logger("barometercollectd").getLogger()
704 def main(bt_logger=None):
705 """Check each compute node sends gnocchi metrics.
708 bt_logger -- logger instance
710 logging.getLogger("paramiko").setLevel(logging.WARNING)
711 logging.getLogger("stevedore").setLevel(logging.WARNING)
712 logging.getLogger("opnfv.deployment.manager").setLevel(logging.WARNING)
713 if bt_logger is None:
718 _print_label("Starting barometer tests suite")
720 conf = config_server.ConfigServer(APEX_IP, APEX_USER, logger)
721 controllers = conf.get_controllers()
722 if len(controllers) == 0:
723 logger.error('No controller nodes found!')
725 computes = conf.get_computes()
726 if len(computes) == 0:
727 logger.error('No compute nodes found!')
731 'Display of Control and Compute nodes available in the set up')
732 logger.info('controllers: {}'.format([('{0}: {1}'.format(
733 node.get_name(), node.get_ip())) for node in controllers]))
734 logger.info('computes: {}'.format([('{0}: {1}'.format(
735 node.get_name(), node.get_ip())) for node in computes]))
739 gnocchi_running_on_con = False
740 aodh_running_on_con = False
742 _print_label('Testing Gnocchi, AODH and SNMP on nodes')
744 for controller in controllers:
746 gnocchi_running_on_con or conf.is_gnocchi_running(controller))
748 aodh_running_on_con or conf.is_aodh_running(controller))
751 compute_node_names = []
754 'intel_rdt': 'Intel RDT',
755 'hugepages': 'Hugepages',
758 'ovs_stats': 'OVS stats',
759 'ovs_events': 'OVS events'}
760 aodh_plugin_labels = {
762 'ovs_events': 'OVS events'}
764 for compute_node in computes:
765 node_id = compute_node.get_id()
766 node_name = compute_node.get_name()
767 out_plugins[node_id] = []
768 compute_ids.append(node_id)
769 compute_node_names.append(node_name)
770 plugins_to_enable = []
773 gnocchi_running and conf.check_gnocchi_plugin_included(
776 aodh_running and conf.check_aodh_plugin_included(compute_node))
777 logger.info("SNMP enabled on {}" .format(node_name))
779 out_plugins[node_id].append("Gnocchi")
781 out_plugins[node_id].append("AODH")
783 out_plugins[node_id].append("SNMP")
785 if 'Gnocchi' in out_plugins[node_id]:
786 logger.info("CSV will be enabled for verification")
787 plugins_to_enable.append('csv')
788 out_plugins[node_id].append("CSV")
789 if plugins_to_enable:
791 'NODE {}: Enabling Test Plug-in '.format(node_name)
792 + 'and Test case execution')
793 if plugins_to_enable and not conf.enable_plugins(
794 compute_node, plugins_to_enable, error_plugins,
795 create_backup=False):
797 'Failed to test plugins on node {}.'.format(node_id))
799 'Testcases on node {} will not be executed'.format(
802 if plugins_to_enable:
803 collectd_restarted, collectd_warnings = \
804 conf.restart_collectd(compute_node)
807 'Sleeping for {} seconds'.format(sleep_time)
808 + ' after collectd restart...')
809 time.sleep(sleep_time)
810 if plugins_to_enable and not collectd_restarted:
811 for warning in collectd_warnings:
812 logger.warning(warning)
814 'Restart of collectd on node {} failed'.format(
817 'Testcases on node {}'.format(node_id)
818 + ' will not be executed.')
820 if collectd_warnings:
821 for warning in collectd_warnings:
822 logger.warning(warning)
824 for i in out_plugins[node_id]:
826 for plugin_name in sorted(aodh_plugin_labels.keys()):
828 aodh_plugin_labels, plugin_name, i,
829 controllers, compute_node, conf, results,
830 error_plugins, out_plugins[node_id])
832 for plugin_name in sorted(plugin_labels.keys()):
834 plugin_labels, plugin_name, i,
835 controllers, compute_node, conf, results,
836 error_plugins, out_plugins[node_id])
839 print_overall_summary(
840 compute_ids, plugin_labels, aodh_plugin_labels, results, out_plugins)
842 if ((len([res for res in results if not res[2]]) > 0)
843 or (len(results) < len(computes) * len(plugin_labels))):
844 logger.error('Some tests have failed or have not been executed')
849 if __name__ == '__main__':