[train][goal] Define new blazar-devstack-dsvm-ipv6-only job
As part of Train community goal 'Support IPv6-Only Deployments and Testing' [1], we need to define the integration job which deploy services on IPv6 and perform testing to make sure service listen and communicate over IPv6 properly. Blazar has legacy zuul jobs only so base zuulv3 IPv6 job 'devstack-ipv6' and 'devstack-tempest-ipv6' cannot be used and we have to copy the whole run.yaml to set the IPv6 setting and run the IPv6 verification script via post_test_hook. This commit adds the new job 'blazar-devstack-dsvm-ipv6-only' run on gate and set the required IPv6 setting'. It also updates Blazar code so that [DEFAULT]/os_auth_host is bracketed when used to build URLs, as required for IPv6 addresses. [1] https://governance.openstack.org/tc/goals/train/ipv6-support-and-testing.html Change-Id: I9a598f591d3fbb40c90be5bd12913b851aff2c9f Co-Authored-By: Pierre Riteau <pierre@stackhpc.com> Story: #2005477 Task: #35882
This commit is contained in:
parent
6a5fd8b08a
commit
584188dbcb
@ -42,6 +42,13 @@
|
||||
- openstack/python-blazarclient
|
||||
- openstack/blazar-tempest-plugin
|
||||
|
||||
- job:
|
||||
name: blazar-devstack-dsvm-ipv6-only
|
||||
parent: blazar-devstack-dsvm-py35
|
||||
run: playbooks/legacy/blazar-devstack-dsvm-py35/run-ipv6.yaml
|
||||
required-projects:
|
||||
- openstack/tempest
|
||||
|
||||
- project:
|
||||
templates:
|
||||
- check-requirements
|
||||
@ -54,6 +61,7 @@
|
||||
jobs:
|
||||
- blazar-devstack-dsvm
|
||||
- blazar-devstack-dsvm-py35
|
||||
- blazar-devstack-dsvm-ipv6-only
|
||||
- openstack-tox-pylint:
|
||||
voting: false
|
||||
gate:
|
||||
@ -61,3 +69,4 @@
|
||||
jobs:
|
||||
- blazar-devstack-dsvm
|
||||
- blazar-devstack-dsvm-py35
|
||||
- blazar-devstack-dsvm-ipv6-only
|
||||
|
@ -13,9 +13,22 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import netaddr
|
||||
|
||||
from blazar.manager import exceptions
|
||||
|
||||
|
||||
def get_os_auth_host(conf):
|
||||
"""Description
|
||||
|
||||
Returns os_auth_host from conf, surrounded by brackets if IPv6.
|
||||
"""
|
||||
os_auth_host = conf.os_auth_host
|
||||
if netaddr.valid_ipv6(os_auth_host, netaddr.core.INET_PTON):
|
||||
os_auth_host = "[%s]" % os_auth_host
|
||||
return os_auth_host
|
||||
|
||||
|
||||
def url_for(service_catalog, service_type, admin=False,
|
||||
endpoint_interface=None,
|
||||
os_region_name=None):
|
||||
|
@ -23,6 +23,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from blazar import context
|
||||
from blazar.utils.openstack import base
|
||||
from blazar.utils.openstack import exceptions
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -56,7 +57,7 @@ class BlazarNeutronClient(object):
|
||||
|
||||
if auth_url is None:
|
||||
auth_url = "%s://%s:%s/%s/%s" % (CONF.os_auth_protocol,
|
||||
CONF.os_auth_host,
|
||||
base.get_os_auth_host(CONF),
|
||||
CONF.os_auth_port,
|
||||
CONF.os_auth_prefix,
|
||||
CONF.os_auth_version)
|
||||
|
@ -131,7 +131,7 @@ class BlazarNovaClient(object):
|
||||
|
||||
if auth_url is None:
|
||||
auth_url = "%s://%s:%s/%s" % (CONF.os_auth_protocol,
|
||||
CONF.os_auth_host,
|
||||
base.get_os_auth_host(CONF),
|
||||
CONF.os_auth_port,
|
||||
CONF.os_auth_prefix)
|
||||
|
||||
|
@ -21,6 +21,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from blazar import context
|
||||
from blazar.utils.openstack import base
|
||||
from blazar.utils.openstack import exceptions
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -59,7 +60,7 @@ class BlazarPlacementClient(object):
|
||||
|
||||
if auth_url is None:
|
||||
auth_url = "%s://%s:%s/%s/%s" % (CONF.os_auth_protocol,
|
||||
CONF.os_auth_host,
|
||||
base.get_os_auth_host(CONF),
|
||||
CONF.os_auth_port,
|
||||
CONF.os_auth_prefix,
|
||||
CONF.os_auth_version)
|
||||
|
@ -18,6 +18,7 @@ import functools
|
||||
from oslo_config import cfg
|
||||
|
||||
from blazar import context
|
||||
from blazar.utils.openstack import base
|
||||
from blazar.utils.openstack import keystone
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -59,7 +60,7 @@ def create_ctx_from_trust(trust_id):
|
||||
global_request_id=ctx.global_request_id
|
||||
)
|
||||
auth_url = "%s://%s:%s/%s" % (CONF.os_auth_protocol,
|
||||
CONF.os_auth_host,
|
||||
base.get_os_auth_host(CONF),
|
||||
CONF.os_auth_port,
|
||||
CONF.os_auth_prefix)
|
||||
client = keystone.BlazarKeystoneClient(
|
||||
|
@ -44,7 +44,7 @@ function configure_blazar {
|
||||
touch $BLAZAR_CONF_FILE
|
||||
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_auth_version v3
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_auth_host $KEYSTONE_AUTH_HOST
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_auth_host $(ipv6_unquote $KEYSTONE_AUTH_HOST)
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_auth_port 80
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_auth_prefix identity
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT os_admin_password $SERVICE_PASSWORD
|
||||
@ -58,7 +58,7 @@ function configure_blazar {
|
||||
|
||||
iniset $BLAZAR_CONF_FILE nova aggregate_freepool_name $BLAZAR_FREEPOOL_NAME
|
||||
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT host $HOST_IP
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT host $(ipv6_unquote $SERVICE_HOST)
|
||||
iniset $BLAZAR_CONF_FILE DEFAULT debug $BLAZAR_DEBUG
|
||||
|
||||
iniset $BLAZAR_CONF_FILE manager plugins physical.host.plugin,virtual.instance.plugin,virtual.floatingip.plugin
|
||||
|
74
playbooks/legacy/blazar-devstack-dsvm-py35/run-ipv6.yaml
Normal file
74
playbooks/legacy/blazar-devstack-dsvm-py35/run-ipv6.yaml
Normal file
@ -0,0 +1,74 @@
|
||||
- hosts: all
|
||||
name: legacy-blazar-devstack-dsvm-ipv6-only
|
||||
tasks:
|
||||
|
||||
- name: Ensure legacy workspace directory
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/workspace'
|
||||
state: directory
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
cat > clonemap.yaml << EOF
|
||||
clonemap:
|
||||
- name: openstack/devstack-gate
|
||||
dest: devstack-gate
|
||||
EOF
|
||||
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
|
||||
https://opendev.org \
|
||||
openstack/devstack-gate
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
cat << 'EOF' >>"/tmp/dg-local.conf"
|
||||
[[local|localrc]]
|
||||
enable_plugin blazar https://opendev.org/openstack/blazar
|
||||
# Swift is not ready for python3 yet
|
||||
disable_service s-account
|
||||
disable_service s-container
|
||||
disable_service s-object
|
||||
disable_service s-proxy
|
||||
# Without Swift, c-bak cannot run (in the Gate at least)
|
||||
disable_service c-bak
|
||||
# Enable Tempest plugin
|
||||
TEMPEST_PLUGINS='/opt/stack/new/blazar-tempest-plugin'
|
||||
SERVICE_IP_VERSION=6
|
||||
SERVICE_HOST=""
|
||||
# IPv6 and certificates known issue with python2
|
||||
# https://bugs.launchpad.net/devstack/+bug/1794929
|
||||
EOF
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
export DEVSTACK_GATE_USE_PYTHON3=True
|
||||
export PYTHONUNBUFFERED=true
|
||||
export DEVSTACK_GATE_TEMPEST=1
|
||||
export ENABLED_SERVICES=blazar,blazar-a,blazar-m,tempest
|
||||
export PROJECTS="openstack/blazar $PROJECTS"
|
||||
export PROJECTS="openstack/blazar-nova $PROJECTS"
|
||||
export PROJECTS="openstack/python-blazarclient $PROJECTS"
|
||||
export PROJECTS="openstack/blazar-tempest-plugin $PROJECTS"
|
||||
export DEVSTACK_GATE_TEMPEST_REGEX="blazar_tempest_plugin"
|
||||
export TEMPEST_CONCURRENCY=1
|
||||
function post_test_hook {
|
||||
cd $BASE/new/tempest/tools
|
||||
./verify-ipv6-only-deployments.sh
|
||||
}
|
||||
export -f post_test_hook
|
||||
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
|
||||
./safe-devstack-vm-gate-wrap.sh
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
Loading…
x
Reference in New Issue
Block a user