aboutsummaryrefslogtreecommitdiffstats
path: root/baro_tests
diff options
context:
space:
mode:
authorSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-09-21 22:00:49 +0000
committerSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-09-21 22:31:37 +0000
commit7b13f9babfff25d01c521a14f9db901542981945 (patch)
tree1b2d2c6276aedbddd95b7e106a0fe3f4d1088b9f /baro_tests
parentb104e2981f0b0ec19f109e220cddc76d97d0ed1a (diff)
Modyfying method to get env variables in Barometer
This patch adds changes to get the environment variables into the baroneter tests Change-Id: I93f18d64d6db25885987b702b36f6d2403bcb24d Signed-off-by: Sharada Shiddibhavi <sharada.shiddibhavi@intel.com>
Diffstat (limited to 'baro_tests')
-rw-r--r--baro_tests/collectd.py6
-rw-r--r--baro_tests/config_server.py11
2 files changed, 9 insertions, 8 deletions
diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py
index 4a7aacbd..6ddb921c 100644
--- a/baro_tests/collectd.py
+++ b/baro_tests/collectd.py
@@ -22,7 +22,6 @@ import time
import logging
import config_server
import tests
-import subprocess
from opnfv.deployment import factory
AODH_NAME = 'aodh'
@@ -30,10 +29,11 @@ GNOCCHI_NAME = 'gnocchi'
ID_RSA_SRC = '/root/.ssh/id_rsa'
ID_RSA_DST_DIR = '/root/.ssh'
ID_RSA_DST = ID_RSA_DST_DIR + '/id_rsa'
-APEX_IP = subprocess.check_output("echo $INSTALLER_IP", shell=True)
+APEX_IP = os.getenv("INSTALLER_IP").rstrip('\n')
APEX_USER = 'root'
APEX_USER_STACK = 'stack'
APEX_PKEY = '/root/.ssh/id_rsa'
+PATH = os.path.dirname(os.path.realpath(__file__))
class KeystoneException(Exception):
@@ -649,7 +649,7 @@ def mcelog_install():
'Mcelog will be enabled on node-{}...'.format(
node.get_dict()['id']))
node.put_file(
- '/usr/local/lib/python2.7/dist-packages/baro_tests/'
+ 'PATH/'
+ 'mce-inject_ea', 'mce-inject_ea')
node.run_cmd('chmod a+x mce-inject_ea')
node.run_cmd('echo "CPU 0 BANK 0" > corrected')
diff --git a/baro_tests/config_server.py b/baro_tests/config_server.py
index 3178effb..6506091b 100644
--- a/baro_tests/config_server.py
+++ b/baro_tests/config_server.py
@@ -19,7 +19,6 @@ import time
import os.path
import os
import re
-import subprocess
from opnfv.deployment import factory
ID_RSA_PATH = '/root/.ssh/id_rsa'
SSH_KEYS_SCRIPT = '/home/opnfv/barometer/baro_utils/get_ssh_keys.sh'
@@ -28,10 +27,11 @@ COLLECTD_CONF = '/etc/collectd.conf'
COLLECTD_CONF_DIR = '/etc/collectd/collectd.conf.d'
NOTIFICATION_FILE = '/var/log/python-notifications.dump'
COLLECTD_NOTIFICATION = '/etc/collectd_notification_dump.py'
-APEX_IP = subprocess.check_output("echo $INSTALLER_IP", shell=True)
+APEX_IP = os.getenv("INSTALLER_IP").rstrip('\n')
APEX_USER = 'root'
APEX_USER_STACK = 'stack'
APEX_PKEY = '/root/.ssh/id_rsa'
+PATH = os.path.dirname(os.path.realpath(__file__))
class Node(object):
@@ -303,7 +303,9 @@ class ConfigServer(object):
if compute_name == node.get_dict()['name']:
stdout = node.run_cmd(
'yum list installed | grep mcelog')
- if 'mcelog' in stdout:
+ if stdout is None:
+ return 0
+ elif 'mcelog' in stdout:
return 1
else:
return 0
@@ -405,8 +407,7 @@ class ConfigServer(object):
for node in nodes:
if compute_name == node.get_dict()['name']:
node.put_file(
- '/usr/local/lib/python2.7/dist-packages/baro_tests/'
- + 'csv.conf', 'csv.conf')
+ 'PATH/csv.conf', 'csv.conf')
node.run_cmd(
'sudo cp csv.conf '
+ '/etc/collectd/collectd.conf.d/csv.conf')