Fixing issues in operator tests

Change-Id: Ie9fa14176e4eee6d13ea575f22de3de1482b0ffb
This commit is contained in:
Anand Shanmugam 2015-09-22 13:48:35 -07:00
parent 0089419c4f
commit ee54aee648
3 changed files with 54 additions and 59 deletions

View File

@ -15,11 +15,10 @@
class openstack_node_obj(object):
def __init__(self, host, ip, user, password, role, name):
def __init__(self, host, ip, user, role, name):
self.host = host
self.ip = ip
self.user = user
self.password = password
self.role = role
self.name = name
@ -32,9 +31,6 @@ class openstack_node_obj(object):
def getUser(self):
return self.user
def getPassword(self):
return self.password
def getRole(self):
return self.role

View File

@ -40,10 +40,9 @@ class openstack_node_info_reader(object):
ip = self.hostYamlObj[key]["ip"]
hostname = key
username = self.hostYamlObj[key]["user"]
password = self.hostYamlObj[key]["password"]
role = self.hostYamlObj[key]["role"]
node_obj = openstack_node_obj(hostname, ip, username,
password, role, name)
role, name)
openstack_host_list.append(node_obj)
return openstack_host_list

View File

@ -79,13 +79,13 @@ class operator_scenario(base.Scenario):
out = self.ans_runner.execute(cmd)
res, output = self.ans_runner.validate_results(out)
node_status = res['contacted'][res['contacted'].keys()[0]]['stdout']
if res['status'] is 'PASS':
node_status = res['contacted'][
res['contacted'].keys()[0]]['stdout']
node_status_string = node_status.replace('\n', '')
mathobj = re.search(
r'running_nodes,(.*?)}', node_status_string, re.M | re.I)
nodes = mathobj.group(1)
if res['status'] is 'PASS':
return (200, "Active Nodes : %s" % nodes,
['RabbitMQ-server Running'])
else:
@ -97,8 +97,9 @@ class operator_scenario(base.Scenario):
self.load()
galera = self.os_node_info_obj.get_galera_details()
cmd = (r"mysql -u %s -e 'SHOW STATUS;'|grep wsrep_incoming_addresses" %
(galera['username']))
cmd = ((r"mysql -u %s -p%s -e 'SHOW STATUS;'|grep "
"wsrep_incoming_addresses") %
(galera['username'], galera['password']))
is_containerized = cfg.CONF.operator_test.containerized
if is_containerized:
@ -108,14 +109,13 @@ class operator_scenario(base.Scenario):
out = self.ans_runner.execute(cmd)
results, failed_hosts = self.ans_runner.validate_results(out)
if results['status'] is 'PASS':
galera_status = results['contacted'][
results['contacted'].keys()[0]]['stdout']
galera_status_string = galera_status.replace('\n', '')
mathobj = re.search(r'wsrep_incoming_addresses\s+(.*?)$',
galera_status_string, re.M | re.I)
nodes = mathobj.group(1)
if results['status'] is 'PASS':
return (200, "Active Nodes : %s" % nodes,
['Galera Cluster Test Passed'])
else: