diff options
-rw-r--r-- | baro_tests/collectd.py | 19 | ||||
-rw-r--r-- | baro_tests/config_server.py | 23 |
2 files changed, 32 insertions, 10 deletions
diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py index 188afab1..3d78762c 100644 --- a/baro_tests/collectd.py +++ b/baro_tests/collectd.py @@ -468,9 +468,6 @@ def _exec_testcase( bridge for bridge in ovs_interfaces if bridge in ovs_configured_bridges] plugin_prerequisites = { - 'intel_rdt': [( - conf.is_rdt_available(compute_node), - 'RDT not avaialble on VMs')], 'mcelog': [( conf.is_mcelog_installed(compute_node, 'mcelog'), 'mcelog must be installed.')], @@ -563,6 +560,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': @@ -591,9 +600,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( diff --git a/baro_tests/config_server.py b/baro_tests/config_server.py index 2a4bc167..fd31c523 100644 --- a/baro_tests/config_server.py +++ b/baro_tests/config_server.py @@ -479,6 +479,16 @@ class ConfigServer(object): return False, warning return True, warning + def trigger_alarm_update(self, alarm, compute_node): + # TODO: move these actions to main, with criteria lists so that we can reference that + # i.e. test_plugin_with_aodh(self, compute, plugin.., logger, criteria_list, alarm_action) + if alarm == 'mcelog': + compute_node.run_cmd('sudo modprobe mce-inject') + compute_node.run_cmd('sudo ./mce-inject_ea < corrected') + if alarm == 'ovs_events': + compute_node.run_cmd('sudo ifconfig -a | grep br0') + compute_node.run_cmd('sudo ifconfig br0 down; sudo ifconfig br0 up') + def test_plugins_with_aodh( self, compute, plugin_interval, logger, criteria_list=[]): @@ -487,11 +497,13 @@ class ConfigServer(object): timestamps1 = {} timestamps2 = {} nodes = get_apex_nodes() + compute_node = [node for node in nodes if node.get_dict()['name'] == compute][0] for node in nodes: if node.is_controller(): self.__logger.info('Getting AODH Alarm list on {}' .format( (node.get_dict()['name']))) node.put_file(constants.ENV_FILE, 'overcloudrc.v3') + self.trigger_alarm_update(criteria_list, compute_node) stdout = node.run_cmd( "source overcloudrc.v3;" + "aodh alarm list | grep {0} | grep {1}" @@ -510,10 +522,9 @@ class ConfigServer(object): return False for line in stdout.splitlines()[3: -1]: line = line.replace('|', "") - if line.split()[0] == 'timestamp': + if line.split()[0] == 'state_timestamp': timestamps1 = line.split()[1] - else: - pass + self.trigger_alarm_update(criteria_list, compute_node) time.sleep(12) stdout = node.run_cmd( "source overcloudrc.v3; aodh alarm show {}" .format( @@ -523,10 +534,8 @@ class ConfigServer(object): return False for line in stdout.splitlines()[3:-1]: line = line.replace('|', "") - if line.split()[0] == 'timestamp': + if line.split()[0] == 'state_timestamp': timestamps2 = line.split()[1] - else: - pass if timestamps1 == timestamps2: self.__logger.info( "Data not updated after interval of 12 seconds") @@ -604,7 +613,7 @@ class ConfigServer(object): self, compute, plugin_interval, logger, plugin, snmp_mib_files=[], snmp_mib_strings=[], snmp_in_commands=[]): - if plugin == 'hugepages' or 'intel_rdt' or 'mcelog': + if plugin in ('hugepages', 'intel_rdt', 'mcelog'): nodes = get_apex_nodes() for node in nodes: if compute == node.get_dict()['name']: |