aboutsummaryrefslogtreecommitdiffstats
path: root/baro_tests
diff options
context:
space:
mode:
authorSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2018-03-10 00:22:27 +0000
committerCalin Gherghe <calin.gherghe@intel.com>2018-03-10 00:54:22 +0000
commit63b55576a2290a1a9d6bb48dc72667967bbd8920 (patch)
treebbe141806f67ec68a06a01c88277a5a7532f9569 /baro_tests
parentd0f5638fbf44bdb15bad413fa20cbc677f60c2bd (diff)
Fixing the if/else logic in baro_tests/ mcelog_install()
Follow on to the change #52775 Fixed the if/else logic while installing the mcelog. And added log messages to show on which node, mcelog is installed. Change-Id: If5f61b1a780abd243516699e352a55baf0db96f7 Signed-off-by: Sharada Shiddibhavi <sharada.shiddibhavi@intel.com>
Diffstat (limited to 'baro_tests')
-rw-r--r--baro_tests/collectd.py54
1 files changed, 28 insertions, 26 deletions
diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py
index bf310f0..2682c2a 100644
--- a/baro_tests/collectd.py
+++ b/baro_tests/collectd.py
@@ -636,36 +636,38 @@ def mcelog_install():
centos_release = node.run_cmd('uname -r')
if '3.10.0-514.26.2.el7.x86_64' not in centos_release:
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():