Merge "Skip vips tests with load balancer"

This commit is contained in:
Zuul 2023-01-24 09:43:55 +00:00 committed by Gerrit Code Review
commit 8cc77acc41
4 changed files with 44 additions and 21 deletions

View File

@ -157,6 +157,10 @@ subparsers:
type: Value type: Value
help: user name to be used to connect to TripleO Overcloud hosts help: user name to be used to connect to TripleO Overcloud hosts
ansible_variable: overcloud_ssh_username 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 - title: Run stage
options: options:

View File

@ -14,6 +14,7 @@ test_default_conf:
undercloud_ssh_hostname: "{{ undercloud_ssh_hostname }}" undercloud_ssh_hostname: "{{ undercloud_ssh_hostname }}"
overcloud_ssh_username: "{{ overcloud_ssh_username }}" overcloud_ssh_username: "{{ overcloud_ssh_username }}"
undercloud_ssh_key_filename: "{{ undercloud_ssh_key_filename }}" undercloud_ssh_key_filename: "{{ undercloud_ssh_key_filename }}"
has_external_load_balancer: "{{ has_external_load_balancer }}"
test_log_debug: '' test_log_debug: ''
@ -26,5 +27,6 @@ stackrc_file: '{{ ansible_user_dir }}/overcloudrc'
undercloud_hostname: '{{ groups.get("undercloud", []) | first | default("undercloud-0") }}' undercloud_hostname: '{{ groups.get("undercloud", []) | first | default("undercloud-0") }}'
undercloud_ssh_hostname: '' undercloud_ssh_hostname: ''
undercloud_ssh_key_filename: '' undercloud_ssh_key_filename: ''
has_external_load_balancer: ''
overcloud_ssh_username: '' overcloud_ssh_username: ''

View File

@ -74,6 +74,9 @@ OPTIONS = [
cfg.StrOpt('inventory_file', cfg.StrOpt('inventory_file',
default='.ansible/inventory/tripleo.yaml', default='.ansible/inventory/tripleo.yaml',
help="path to where to export tripleo inventory file"), 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"),
] ]

View File

@ -8,11 +8,13 @@ from oslo_log import log
import pandas import pandas
import tobiko import tobiko
from tobiko import config
from tobiko.tripleo import overcloud from tobiko.tripleo import overcloud
from tobiko.shell import sh from tobiko.shell import sh
from tobiko.openstack import topology from tobiko.openstack import topology
CONF = config.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -165,33 +167,45 @@ class PacemakerResourcesStatus(object):
return False return False
def vips_resource_healthy(self): def vips_resource_healthy(self):
vips_resource_str = f"({self.ocf_prefix}heartbeat:IPaddr2):" if CONF.tobiko.tripleo.has_external_load_balancer:
nodes_num = self.resource_count(vips_resource_str) LOG.info("external load balancer used - "
started_num = self.resource_count_in_state( "we can skip vips_resource sanity")
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 return True
else: else:
LOG.info( vips_resource_str = f"({self.ocf_prefix}heartbeat:IPaddr2):"
"pcs status check: resources vips are not in healthy state") nodes_num = self.resource_count(vips_resource_str)
return False 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): def ha_proxy_cinder_healthy(self):
ha_proxy_resource_str = (f"({self.ocf_prefix}heartbeat:" if CONF.tobiko.tripleo.has_external_load_balancer:
f"{self.container_runtime()}):") LOG.info("external load balancer used "
nodes_num = self.resource_count(ha_proxy_resource_str) "- we can skip ha_proxy_resource sanity")
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 return True
else: else:
LOG.info( ha_proxy_resource_str = (f"({self.ocf_prefix}heartbeat:"
"pcs status check: resources ha_proxy and cinder are not in " f"{self.container_runtime()}):")
"healthy state") nodes_num = self.resource_count(ha_proxy_resource_str)
return False 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): def ovn_resource_healthy(self):
ovn_resource_str = f"({self.ocf_prefix}ovn:ovndb-servers):" ovn_resource_str = f"({self.ocf_prefix}ovn:ovndb-servers):"