Migrate functional tests job to the zuul v3 syntax

It migrates neutron-vpnaas-dsvm-functional-sswan job to the native
Zuulv3 syntax and renames it to be "neutron-vpnaas-functional-sswan".

Change-Id: Ibe6ac8677ace52e08edb7e47f3365616a3e6b29a
This commit is contained in:
Slawek Kaplonski 2020-02-02 11:07:12 +01:00
parent e0fb6700b1
commit 5da7b0176b
8 changed files with 65 additions and 154 deletions

View File

@ -9,7 +9,7 @@
- release-notes-jobs-python3
check:
jobs:
- neutron-vpnaas-dsvm-functional-sswan
- neutron-vpnaas-functional-sswan
- neutron-tempest-plugin-vpnaas
- neutron-tempest-plugin-vpnaas-libreswan-centos:
# TODO(mlavalle) switch to voting when this job is moved to Centos
@ -17,7 +17,7 @@
voting: false
gate:
jobs:
- neutron-vpnaas-dsvm-functional-sswan
- neutron-vpnaas-functional-sswan
- neutron-tempest-plugin-vpnaas
# TODO(mlavalle) uncomment following line when the job is moved to
# Centos 8
@ -44,20 +44,12 @@
skip_4in6_6in4_tests: true
- job:
name: neutron-vpnaas-dsvm-functional-sswan
parent: legacy-dsvm-base
run: playbooks/legacy/neutron-vpnaas-dsvm-functional-sswan/run.yaml
post-run: playbooks/legacy/neutron-vpnaas-dsvm-functional-sswan/post.yaml
timeout: 7800
required-projects:
- openstack/devstack-gate
- openstack/neutron
- openstack/neutron-vpnaas
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^neutron_vpnaas/tests/unit/.*$
- ^releasenotes/.*$
name: neutron-vpnaas-functional-sswan
parent: neutron-functional
pre-run: playbooks/configure_functional_job.yaml
vars:
project_name: neutron-vpnaas
tox_envlist: dsvm-functional-sswan
- job:
name: neutron-vpnaas-dsvm-rally

View File

@ -0,0 +1,4 @@
- hosts: all
roles:
- setup_logdir
- configure_functional_tests

View File

@ -1,80 +0,0 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*nose_results.html
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testr_results.html.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.testrepository/tmp*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testrepository.subunit.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}/tox'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.tox/*/log/*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -1,56 +0,0 @@
- hosts: all
name: Autoconverted job legacy-neutron-vpnaas-dsvm-functional-sswan from old job
gate-neutron-vpnaas-dsvm-functional-sswan-ubuntu-xenial
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
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_UNSTACK=1
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_EXERCISES=0
export DEVSTACK_GATE_NEUTRON=1
export DEVSTACK_GATE_INSTALL_TESTONLY=1
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
function gate_hook {
bash -xe $BASE/new/neutron-vpnaas/neutron_vpnaas/tests/contrib/gate_hook.sh dsvm-functional-sswan
}
export -f gate_hook
function post_test_hook {
bash -xe $BASE/new/neutron-vpnaas/neutron_vpnaas/tests/contrib/post_test_hook.sh dsvm-functional-sswan
}
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 }}'

View File

@ -0,0 +1,24 @@
Configure host to run on it Neutron functional/fullstack tests
**Role Variables**
.. zuul:rolevar:: tests_venv
:default: {{ tox_envlist }}
.. zuul:rolevar:: project_name
:default: neutron
.. zuul:rolevar:: base_dir
:default: {{ ansible_user_dir }}/src/opendev.org
.. zuul:rolevar:: gate_dest_dir
:default: {{ base_dir }}/openstack
.. zuul:rolevar:: devstack_dir
:default: {{ base_dir }}/openstack/devstack
.. zuul:rolevar:: neutron_dir
:default: {{ gate_dest_dir }}/neutron
.. zuul:rolevar:: neutron_vpnaas_dir
:default: {{ gate_dest_dir }}/neutron-vpnaas

View File

@ -0,0 +1,7 @@
tests_venv: "{{ tox_envlist }}"
project_name: "neutron"
base_dir: "{{ ansible_user_dir }}/src/opendev.org"
gate_dest_dir: "{{ base_dir }}/openstack"
devstack_dir: "{{ base_dir }}/openstack/devstack"
neutron_dir: "{{ gate_dest_dir }}/neutron"
neutron_vpnaas_dir: "{{ gate_dest_dir }}/neutron-vpnaas"

View File

@ -0,0 +1,21 @@
- shell:
cmd: |
set -e
set -x
GATE_STACK_USER={{ ansible_user }}
IS_GATE=True
BASE_DIR={{ base_dir }}
GATE_DEST={{ gate_dest_dir }}
PROJECT_NAME={{ project_name }}
NEUTRON_PATH={{ neutron_dir }}
NEUTRON_VPNAAS_PATH={{ neutron_vpnaas_dir }}
DEVSTACK_PATH={{ devstack_dir }}
VENV={{ tests_venv }}
source $DEVSTACK_PATH/functions
source $NEUTRON_PATH/devstack/lib/ovs
source $NEUTRON_VPNAAS_PATH/tools/configure_for_vpn_func_testing.sh
configure_host_for_vpn_func_testing
executable: /bin/bash

View File

@ -25,6 +25,7 @@ deps =
-r{toxinidir}/neutron_vpnaas/tests/functional/requirements.txt
setenv =
OS_SUDO_TESTING=1
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
OS_FAIL_ON_MISSING_DEPS=1
@ -50,7 +51,6 @@ setenv =
OS_TEST_PATH=./neutron_vpnaas/tests/functional/openswan
{[testenv:functional]setenv}
deps = {[testenv:functional]deps}
sitepackages=True
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
@ -61,7 +61,6 @@ setenv =
OS_TEST_PATH=./neutron_vpnaas/tests/functional/strongswan
{[testenv:functional]setenv}
deps = {[testenv:functional]deps}
sitepackages=True
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}