- _print_label('NODE {}: Test Ceilometer Plug-in'.format(node_id))
- logger.info('Checking if ceilometer plug-in is included.')
- if not conf.check_ceil_plugin_included(compute_node):
- logger.error('Ceilometer plug-in is not included.')
- logger.info('Testcases on node {} will not be executed'.format(node_id))
- else:
- collectd_restarted, collectd_warnings = conf.restart_collectd(compute_node)
- sleep_time = 30
- logger.info('Sleeping for {} seconds after collectd restart...'.format(sleep_time))
- time.sleep(sleep_time)
- if not collectd_restarted:
- for warning in collectd_warnings:
- logger.warning(warning)
- logger.error('Restart of collectd on node {} failed'.format(node_id))
- logger.info('Testcases on node {} will not be executed'.format(node_id))
+ error_plugins = []
+ gnocchi_running_com = (
+ gnocchi_running and conf.check_gnocchi_plugin_included(
+ compute_node))
+ aodh_running_com = (
+ aodh_running and conf.check_aodh_plugin_included(compute_node))
+ # logger.info("SNMP enabled on {}" .format(node_name))
+ if gnocchi_running_com:
+ out_plugins[node_id].append("Gnocchi")
+ if aodh_running_com:
+ out_plugins[node_id].append("AODH")
+ if snmp_running:
+ out_plugins[node_id].append("SNMP")
+
+ if 'Gnocchi' in out_plugins[node_id]:
+ plugins_to_enable.append('csv')
+ out_plugins[node_id].append("CSV")
+ if plugins_to_enable:
+ _print_label(
+ 'NODE {}: Enabling Test Plug-in '.format(node_name)
+ + 'and Test case execution')
+ if plugins_to_enable and not conf.enable_plugins(
+ compute_node, plugins_to_enable, error_plugins,
+ create_backup=False):
+ logger.error(
+ 'Failed to test plugins on node {}.'.format(node_id))
+ logger.info(
+ 'Testcases on node {} will not be executed'.format(
+ node_id))
+
+ for i in out_plugins[node_id]:
+ if i == 'AODH':
+ for plugin_name in sorted(aodh_plugin_labels.keys()):
+ _exec_testcase(
+ aodh_plugin_labels, plugin_name, i,
+ controllers, compute_node, conf, results,
+ error_plugins, out_plugins[node_id])
+ elif i == 'CSV':
+ _print_label("Node {}: Executing CSV Testcases".format(
+ node_name))
+ logger.info("Restarting collectd for CSV tests")
+ collectd_restarted, collectd_warnings = \
+ conf.restart_collectd(compute_node)
+ sleep_time = 10
+ logger.info(
+ 'Sleeping for {} seconds'.format(sleep_time)
+ + ' after collectd restart...')
+ time.sleep(sleep_time)
+ if not collectd_restarted:
+ for warning in collectd_warnings:
+ logger.warning(warning)
+ logger.error(
+ 'Restart of collectd on node {} failed'.format(
+ compute_node))
+ logger.info(
+ 'CSV Testcases on node {}'.format(compute_node)
+ + ' will not be executed.')
+ for plugin_name in sorted(plugin_labels.keys()):
+ _exec_testcase(
+ plugin_labels, plugin_name, i,
+ controllers, compute_node, conf, results,
+ error_plugins, out_plugins[node_id])
+