aboutsummaryrefslogtreecommitdiffstats
path: root/baro_tests/config_server.py
diff options
context:
space:
mode:
authorSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-09-20 11:33:46 +0000
committerSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-09-21 19:45:05 +0000
commit4a173083f549e8a30292b9af9b33b7d7a4efece0 (patch)
treefb9d338d6b4b02b9b071e33b9b3ffd8572234098 /baro_tests/config_server.py
parente58011611ccaa6ddce6f84cb0dc2b613b8545ffb (diff)
Adding improvements to SNMP testcases
This patch contains improvements to testcases for Hugepages, Intel_RDT and mcelog verification using SNMP Change-Id: I3451e0acd9c791e6145bb15e7ba8f3525bc0f0e8 Signed-off-by: Sharada Shiddibhavi <sharada.shiddibhavi@intel.com> (cherry picked from commit b104e2981f0b0ec19f109e220cddc76d97d0ed1a)
Diffstat (limited to 'baro_tests/config_server.py')
-rw-r--r--baro_tests/config_server.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/baro_tests/config_server.py b/baro_tests/config_server.py
index 102a237..3178eff 100644
--- a/baro_tests/config_server.py
+++ b/baro_tests/config_server.py
@@ -101,20 +101,20 @@ class ConfigServer(object):
stderr_lines = stderr.readlines()
if stderr_lines:
self.__logger.warning(
- "'fuel node' command failed (try {}):".format(attempt))
+ "'Apex node' command failed (try {}):".format(attempt))
for line in stderr_lines:
self.__logger.debug(line.strip())
else:
fuel_node_passed = True
if attempt > 1:
self.__logger.info(
- "'fuel node' command passed (try {})".format(attempt))
+ "'Apex node' command passed (try {})".format(attempt))
attempt += 1
if not fuel_node_passed:
self.__logger.error(
- "'fuel node' command failed. This was the last try.")
+ "'Apex node' command failed. This was the last try.")
raise OSError(
- "'fuel node' command failed. This was the last try.")
+ "'Apex node' command failed. This was the last try.")
node_table = stdout.readlines()\
# skip table title and parse table values
@@ -186,7 +186,6 @@ class ConfigServer(object):
'cat /etc/collectd/collectd.conf.d/{}.conf'.format(plugin))
for line in stdout.split('\n'):
if 'Interval' in line:
- # line = line.strip('Interval')
return 1
return default_interval
@@ -555,7 +554,7 @@ class ConfigServer(object):
self, compute, plugin_interval, logger, plugin, snmp_mib_files=[],
snmp_mib_strings=[], snmp_in_commands=[]):
- if plugin == 'intel_rdt':
+ if plugin == 'hugepages' or 'intel_rdt' or 'mcelog':
nodes = get_apex_nodes()
for node in nodes:
if compute == node.get_dict()['name']:
@@ -563,7 +562,10 @@ class ConfigServer(object):
'snmpwalk -v2c -m {0} -c public localhost {1}' .format(
snmp_mib_files, snmp_mib_strings))
self.__logger.info("{}" .format(stdout))
- if 'OID' in stdout:
+ if stdout is None:
+ self.__logger.info("No output from snmpwalk")
+ return False
+ elif 'OID' in stdout:
self.__logger.info("SNMP query failed")
return False
else:
@@ -573,7 +575,9 @@ class ConfigServer(object):
'snmpwalk -v2c -m {0} -c public localhost {1}' .format(
snmp_mib_files, snmp_mib_strings))
self.__logger.info("{}" .format(stdout))
- if 'OID' in stdout:
+ if stdout is None:
+ self.__logger.info("No output from snmpwalk")
+ elif 'OID' in stdout:
self.__logger.info(
"SNMP query failed during second check")
self.__logger.info("waiting for 10 sec")
@@ -582,7 +586,9 @@ class ConfigServer(object):
'snmpwalk -v2c -m {0} -c public localhost {1}' .format(
snmp_mib_files, snmp_mib_strings))
self.__logger.info("{}" .format(stdout))
- if 'OID' in stdout:
+ if stdout is None:
+ self.__logger.info("No output from snmpwalk")
+ elif 'OID' in stdout:
self.__logger.info("SNMP query failed again")
self.__logger.info("Failing this test case")
return False
@@ -593,3 +599,5 @@ class ConfigServer(object):
return False
else:
return True
+ else:
+ return False