X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=baro_tests%2Fcollectd.py;h=2723d320e3f000a0146784d1f11b963ebac0f87c;hb=2d98d11d981dc9e6597532f130a241cd20cc963d;hp=bf310f01ea15d67a69aff93f793b3546ccd0f69b;hpb=d0f5638fbf44bdb15bad413fa20cbc677f60c2bd;p=barometer.git diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py index bf310f01..2723d320 100644 --- a/baro_tests/collectd.py +++ b/baro_tests/collectd.py @@ -23,6 +23,7 @@ import time import logging import config_server import tests +from distutils import version from opnfv.deployment import factory AODH_NAME = 'aodh' @@ -322,28 +323,28 @@ def _print_final_result_of_plugin( elif (id, out_plugin, plugin, False) in results: print_line += ' FAIL |' else: - print_line += ' NOT EX |' + print_line += ' SKIP |' elif out_plugin == 'AODH': if (id, out_plugin, plugin, True) in results: print_line += ' PASS |' elif (id, out_plugin, plugin, False) in results: print_line += ' FAIL |' else: - print_line += ' FAIL |' + print_line += ' SKIP |' elif out_plugin == 'SNMP': if (id, out_plugin, plugin, True) in results: print_line += ' PASS |' elif (id, out_plugin, plugin, False) in results: print_line += ' FAIL |' else: - print_line += ' FAIL |' + print_line += ' SKIP |' elif out_plugin == 'CSV': if (id, out_plugin, plugin, True) in results: print_line += ' PASS |' elif (id, out_plugin, plugin, False) in results: print_line += ' FAIL |' else: - print_line += ' NOT EX |' + print_line += ' SKIP |' else: print_line += ' SKIP |' return print_line @@ -504,8 +505,7 @@ def _exec_testcase( 'intel_rdt': [ 'intel_rdt-0-2'], 'hugepages': [ - 'hugepages-mm-2048Kb', 'hugepages-node0-2048Kb', - 'hugepages-node1-2048Kb'], + 'hugepages-mm-2048Kb', 'hugepages-node0-2048Kb',], # 'ipmi': ['ipmi'], 'mcelog': [ 'mcelog-SOCKET_0_CHANNEL_0_DIMM_any', @@ -561,6 +561,18 @@ def _exec_testcase( + 'following prerequisites failed:') for prerequisite in failed_prerequisites: logger.error(' * {}'.format(prerequisite)) + # optional plugin + elif "intel_rdt" == name and not conf.is_rdt_available(compute_node): + #TODO: print log message + logger.info("RDT is not available on virtual nodes, skipping test.") + res = True + print("Results for {}, pre-processing".format(str(test_labels[name]))) + print(results) + _process_result( + compute_node.get_id(), out_plugin, test_labels[name], + res, results, compute_node.get_name()) + print("Results for {}, post-processing".format(str(test_labels[name]))) + print(results) else: plugin_interval = conf.get_plugin_interval(compute_node, name) if out_plugin == 'Gnocchi': @@ -589,9 +601,13 @@ def _exec_testcase( 'Test works, but will be reported as failure,' + 'because of non-critical errors.') res = False + print("Results for {}, pre-processing".format(str(test_labels[name]))) + print(results) _process_result( compute_node.get_id(), out_plugin, test_labels[name], res, results, compute_node.get_name()) + print("Results for {}, post-processing".format(str(test_labels[name]))) + print(results) def get_results_for_ovs_events( @@ -634,38 +650,40 @@ def mcelog_install(): for node in nodes: if node.is_compute(): centos_release = node.run_cmd('uname -r') - if '3.10.0-514.26.2.el7.x86_64' not in centos_release: + if version.LooseVersion(centos_release) < version.LooseVersion('3.10.0-514.26.2.el7.x86_64'): logger.info( - 'Mcelog will not be enabled on node-{}, ' + - ' unsupported CentOS relase found ({}).'.format( - node.get_dict()['name'], - centos_release)) + 'Mcelog will NOT be enabled on node-{}.' + + ' Unsupported CentOS release found ({}).'.format( + node.get_dict()['name'],centos_release)) else: logger.info( - 'Checking if mcelog is enabled' + 'Checking if mcelog is enabled' + ' on node-{}...'.format(node.get_dict()['name'])) res = node.run_cmd('ls') - if 'mce-inject_ea' and 'corrected' in res: - logger.info( - 'Mcelog seems to be already installed ' - + 'on node-{}.'.format(node.get_dict()['name'])) - node.run_cmd('sudo modprobe mce-inject') - node.run_cmd('sudo ./mce-inject_ea < corrected') - else: - logger.info( - 'Mcelog will be enabled on node-{}...'.format( - node.get_dict()['id'])) - node.put_file(mce_bin, 'mce-inject_ea') - node.run_cmd('chmod a+x mce-inject_ea') - node.run_cmd('echo "CPU 0 BANK 0" > corrected') - node.run_cmd( - 'echo "STATUS 0xcc00008000010090" >>' - + ' corrected') - node.run_cmd( - 'echo "ADDR 0x0010FFFFFFF" >> corrected') - node.run_cmd('sudo modprobe mce-inject') - node.run_cmd('sudo ./mce-inject_ea < corrected') - logger.info('Mcelog is installed on all compute nodes') + if 'mce-inject_ea' and 'corrected' in res: + logger.info( + 'Mcelog seems to be already installed ' + + 'on node-{}.'.format(node.get_dict()['name'])) + node.run_cmd('sudo modprobe mce-inject') + node.run_cmd('sudo ./mce-inject_ea < corrected') + else: + logger.info( + 'Mcelog will be enabled ' + + 'on node-{}...'.format(node.get_dict()['name'])) + node.put_file(mce_bin, 'mce-inject_ea') + node.run_cmd('chmod a+x mce-inject_ea') + node.run_cmd('echo "CPU 0 BANK 0" > corrected') + node.run_cmd( + 'echo "STATUS 0xcc00008000010090" >>' + + ' corrected') + node.run_cmd( + 'echo "ADDR 0x0010FFFFFFF" >> corrected') + node.run_cmd('sudo modprobe mce-inject') + node.run_cmd('sudo ./mce-inject_ea < corrected') + logger.info( + 'Mcelog was installed ' + + 'on node-{}.'.format(node.get_dict()['name'])) + def mcelog_delete():