Fixing issues in operator tests
Change-Id: Ie9fa14176e4eee6d13ea575f22de3de1482b0ffb
This commit is contained in:
parent
0089419c4f
commit
ee54aee648
@ -15,11 +15,10 @@
|
|||||||
|
|
||||||
|
|
||||||
class openstack_node_obj(object):
|
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.host = host
|
||||||
self.ip = ip
|
self.ip = ip
|
||||||
self.user = user
|
self.user = user
|
||||||
self.password = password
|
|
||||||
self.role = role
|
self.role = role
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
@ -32,9 +31,6 @@ class openstack_node_obj(object):
|
|||||||
def getUser(self):
|
def getUser(self):
|
||||||
return self.user
|
return self.user
|
||||||
|
|
||||||
def getPassword(self):
|
|
||||||
return self.password
|
|
||||||
|
|
||||||
def getRole(self):
|
def getRole(self):
|
||||||
return self.role
|
return self.role
|
||||||
|
|
||||||
|
@ -40,10 +40,9 @@ class openstack_node_info_reader(object):
|
|||||||
ip = self.hostYamlObj[key]["ip"]
|
ip = self.hostYamlObj[key]["ip"]
|
||||||
hostname = key
|
hostname = key
|
||||||
username = self.hostYamlObj[key]["user"]
|
username = self.hostYamlObj[key]["user"]
|
||||||
password = self.hostYamlObj[key]["password"]
|
|
||||||
role = self.hostYamlObj[key]["role"]
|
role = self.hostYamlObj[key]["role"]
|
||||||
node_obj = openstack_node_obj(hostname, ip, username,
|
node_obj = openstack_node_obj(hostname, ip, username,
|
||||||
password, role, name)
|
role, name)
|
||||||
openstack_host_list.append(node_obj)
|
openstack_host_list.append(node_obj)
|
||||||
return openstack_host_list
|
return openstack_host_list
|
||||||
|
|
||||||
|
@ -79,13 +79,13 @@ class operator_scenario(base.Scenario):
|
|||||||
out = self.ans_runner.execute(cmd)
|
out = self.ans_runner.execute(cmd)
|
||||||
res, output = self.ans_runner.validate_results(out)
|
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', '')
|
node_status_string = node_status.replace('\n', '')
|
||||||
mathobj = re.search(
|
mathobj = re.search(
|
||||||
r'running_nodes,(.*?)}', node_status_string, re.M | re.I)
|
r'running_nodes,(.*?)}', node_status_string, re.M | re.I)
|
||||||
nodes = mathobj.group(1)
|
nodes = mathobj.group(1)
|
||||||
|
|
||||||
if res['status'] is 'PASS':
|
|
||||||
return (200, "Active Nodes : %s" % nodes,
|
return (200, "Active Nodes : %s" % nodes,
|
||||||
['RabbitMQ-server Running'])
|
['RabbitMQ-server Running'])
|
||||||
else:
|
else:
|
||||||
@ -97,8 +97,9 @@ class operator_scenario(base.Scenario):
|
|||||||
self.load()
|
self.load()
|
||||||
galera = self.os_node_info_obj.get_galera_details()
|
galera = self.os_node_info_obj.get_galera_details()
|
||||||
|
|
||||||
cmd = (r"mysql -u %s -e 'SHOW STATUS;'|grep wsrep_incoming_addresses" %
|
cmd = ((r"mysql -u %s -p%s -e 'SHOW STATUS;'|grep "
|
||||||
(galera['username']))
|
"wsrep_incoming_addresses") %
|
||||||
|
(galera['username'], galera['password']))
|
||||||
|
|
||||||
is_containerized = cfg.CONF.operator_test.containerized
|
is_containerized = cfg.CONF.operator_test.containerized
|
||||||
if is_containerized:
|
if is_containerized:
|
||||||
@ -108,14 +109,13 @@ class operator_scenario(base.Scenario):
|
|||||||
out = self.ans_runner.execute(cmd)
|
out = self.ans_runner.execute(cmd)
|
||||||
results, failed_hosts = self.ans_runner.validate_results(out)
|
results, failed_hosts = self.ans_runner.validate_results(out)
|
||||||
|
|
||||||
|
if results['status'] is 'PASS':
|
||||||
galera_status = results['contacted'][
|
galera_status = results['contacted'][
|
||||||
results['contacted'].keys()[0]]['stdout']
|
results['contacted'].keys()[0]]['stdout']
|
||||||
galera_status_string = galera_status.replace('\n', '')
|
galera_status_string = galera_status.replace('\n', '')
|
||||||
mathobj = re.search(r'wsrep_incoming_addresses\s+(.*?)$',
|
mathobj = re.search(r'wsrep_incoming_addresses\s+(.*?)$',
|
||||||
galera_status_string, re.M | re.I)
|
galera_status_string, re.M | re.I)
|
||||||
nodes = mathobj.group(1)
|
nodes = mathobj.group(1)
|
||||||
|
|
||||||
if results['status'] is 'PASS':
|
|
||||||
return (200, "Active Nodes : %s" % nodes,
|
return (200, "Active Nodes : %s" % nodes,
|
||||||
['Galera Cluster Test Passed'])
|
['Galera Cluster Test Passed'])
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user