aboutsummaryrefslogtreecommitdiffstats
path: root/baro_tests/collectd.py
diff options
context:
space:
mode:
Diffstat (limited to 'baro_tests/collectd.py')
-rw-r--r--baro_tests/collectd.py54
1 files changed, 39 insertions, 15 deletions
diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py
index 2682c2a0..c1a05afb 100644
--- a/baro_tests/collectd.py
+++ b/baro_tests/collectd.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-
+#
+# Copyright 2017 OPNFV
+#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@@ -23,6 +25,8 @@ import time
import logging
import config_server
import tests
+import dma
+from distutils import version
from opnfv.deployment import factory
AODH_NAME = 'aodh'
@@ -322,28 +326,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 +508,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 +564,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 +604,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,7 +653,7 @@ 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 release found ({}).'.format(
@@ -777,15 +796,15 @@ def main(bt_logger=None):
compute_node_names.append(node_name)
plugins_to_enable = []
error_plugins = []
- gnocchi_running = (
+ gnocchi_running_com = (
gnocchi_running and conf.check_gnocchi_plugin_included(
compute_node))
- aodh_running = (
+ aodh_running_com = (
aodh_running and conf.check_aodh_plugin_included(compute_node))
# logger.info("SNMP enabled on {}" .format(node_name))
- if gnocchi_running:
+ if gnocchi_running_com:
out_plugins[node_id].append("Gnocchi")
- if aodh_running:
+ if aodh_running_com:
out_plugins[node_id].append("AODH")
if snmp_running:
out_plugins[node_id].append("SNMP")
@@ -850,14 +869,19 @@ def main(bt_logger=None):
print_overall_summary(
compute_ids, plugin_labels, aodh_plugin_labels, results, out_plugins)
+ res_overall = 0
for res in results:
- if res[3] is 'False' or 'None':
+ if not res[3]:
logger.error('Some tests have failed or have not been executed')
logger.error('Overall Result is Fail')
- return 1
+ res_overall = 1
else:
pass
- return 0
+
+ _print_label('Testing DMA on compute nodes')
+ res_agent = dma.dma_main(logger, conf, computes)
+
+ return 0 if res_overall == 0 and res_agent == 0 else 1
if __name__ == '__main__':