Merge "Skip vips tests with load balancer"
This commit is contained in:
commit
8cc77acc41
@ -157,6 +157,10 @@ subparsers:
|
||||
type: Value
|
||||
help: user name to be used to connect to TripleO Overcloud hosts
|
||||
ansible_variable: overcloud_ssh_username
|
||||
has_external_load_balancer:
|
||||
type: Bool
|
||||
help: OSP env was done with an external load balancer
|
||||
ansible_variable: has_external_load_balancer
|
||||
|
||||
- title: Run stage
|
||||
options:
|
||||
|
@ -14,6 +14,7 @@ test_default_conf:
|
||||
undercloud_ssh_hostname: "{{ undercloud_ssh_hostname }}"
|
||||
overcloud_ssh_username: "{{ overcloud_ssh_username }}"
|
||||
undercloud_ssh_key_filename: "{{ undercloud_ssh_key_filename }}"
|
||||
has_external_load_balancer: "{{ has_external_load_balancer }}"
|
||||
|
||||
test_log_debug: ''
|
||||
|
||||
@ -26,5 +27,6 @@ stackrc_file: '{{ ansible_user_dir }}/overcloudrc'
|
||||
undercloud_hostname: '{{ groups.get("undercloud", []) | first | default("undercloud-0") }}'
|
||||
undercloud_ssh_hostname: ''
|
||||
undercloud_ssh_key_filename: ''
|
||||
has_external_load_balancer: ''
|
||||
|
||||
overcloud_ssh_username: ''
|
||||
|
@ -74,6 +74,9 @@ OPTIONS = [
|
||||
cfg.StrOpt('inventory_file',
|
||||
default='.ansible/inventory/tripleo.yaml',
|
||||
help="path to where to export tripleo inventory file"),
|
||||
cfg.BoolOpt('has_external_load_balancer',
|
||||
default=False,
|
||||
help="OSP env was done with an external load balancer"),
|
||||
]
|
||||
|
||||
|
||||
|
@ -8,11 +8,13 @@ from oslo_log import log
|
||||
import pandas
|
||||
|
||||
import tobiko
|
||||
from tobiko import config
|
||||
from tobiko.tripleo import overcloud
|
||||
from tobiko.shell import sh
|
||||
from tobiko.openstack import topology
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
@ -165,33 +167,45 @@ class PacemakerResourcesStatus(object):
|
||||
return False
|
||||
|
||||
def vips_resource_healthy(self):
|
||||
vips_resource_str = f"({self.ocf_prefix}heartbeat:IPaddr2):"
|
||||
nodes_num = self.resource_count(vips_resource_str)
|
||||
started_num = self.resource_count_in_state(
|
||||
vips_resource_str, "Started")
|
||||
if nodes_num == started_num and nodes_num > 0:
|
||||
LOG.info("pcs status check: resources vips are in healthy state")
|
||||
if CONF.tobiko.tripleo.has_external_load_balancer:
|
||||
LOG.info("external load balancer used - "
|
||||
"we can skip vips_resource sanity")
|
||||
return True
|
||||
else:
|
||||
LOG.info(
|
||||
"pcs status check: resources vips are not in healthy state")
|
||||
return False
|
||||
vips_resource_str = f"({self.ocf_prefix}heartbeat:IPaddr2):"
|
||||
nodes_num = self.resource_count(vips_resource_str)
|
||||
started_num = self.resource_count_in_state(
|
||||
vips_resource_str, "Started")
|
||||
if nodes_num == started_num and nodes_num > 0:
|
||||
LOG.info("pcs status check: resources vips are "
|
||||
"in healthy state")
|
||||
return True
|
||||
else:
|
||||
LOG.info(
|
||||
"pcs status check: resources"
|
||||
" vips are not in healthy state")
|
||||
return False
|
||||
|
||||
def ha_proxy_cinder_healthy(self):
|
||||
ha_proxy_resource_str = (f"({self.ocf_prefix}heartbeat:"
|
||||
f"{self.container_runtime()}):")
|
||||
nodes_num = self.resource_count(ha_proxy_resource_str)
|
||||
started_num = self.resource_count_in_state(
|
||||
ha_proxy_resource_str, "Started")
|
||||
if nodes_num == started_num and nodes_num > 0:
|
||||
LOG.info("pcs status check: resources ha_proxy and"
|
||||
" cinder are in healthy state")
|
||||
if CONF.tobiko.tripleo.has_external_load_balancer:
|
||||
LOG.info("external load balancer used "
|
||||
"- we can skip ha_proxy_resource sanity")
|
||||
return True
|
||||
else:
|
||||
LOG.info(
|
||||
"pcs status check: resources ha_proxy and cinder are not in "
|
||||
"healthy state")
|
||||
return False
|
||||
ha_proxy_resource_str = (f"({self.ocf_prefix}heartbeat:"
|
||||
f"{self.container_runtime()}):")
|
||||
nodes_num = self.resource_count(ha_proxy_resource_str)
|
||||
started_num = self.resource_count_in_state(
|
||||
ha_proxy_resource_str, "Started")
|
||||
if nodes_num == started_num and nodes_num > 0:
|
||||
LOG.info("pcs status check: resources ha_proxy and"
|
||||
" cinder are in healthy state")
|
||||
return True
|
||||
else:
|
||||
LOG.info(
|
||||
"pcs status check: resources ha_proxy and cinder "
|
||||
"are not in healthy state")
|
||||
return False
|
||||
|
||||
def ovn_resource_healthy(self):
|
||||
ovn_resource_str = f"({self.ocf_prefix}ovn:ovndb-servers):"
|
||||
|
Loading…
x
Reference in New Issue
Block a user