Move to zuulv3
To move ironicclient legacy jobs to zuulv3 the the following changes were necessary: - Change `tox.ini` to pass envrioment variables - Clean `post_test_hook.sh` to avoid legacy variables (`$USER` and `$BASE`), removing `generate_testr_results` function since we only get `testrepository.subunit` in logs and the results of the tests are present in job-output file. - Convert `post_test_hook.sh` and `run_functional.sh` into `playbooks/functional/run.yaml` to run after the setup. Also includes the changes from commit9cd6ce7eb2
Change-Id: I6a5b3f82c238083b66bdf6f379092260d367d82d (cherry picked from commit2c349cc893
)
This commit is contained in:
parent
1665244caa
commit
bab647771b
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash -xe
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# This script is executed inside post_test_hook function in devstack gate.
|
||||
|
||||
function generate_testr_results {
|
||||
if [ -f .testrepository/0 ]; then
|
||||
sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit
|
||||
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
|
||||
sudo /usr/os-testr-env/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
|
||||
sudo gzip -9 $BASE/logs/testrepository.subunit
|
||||
sudo gzip -9 $BASE/logs/testr_results.html
|
||||
sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
|
||||
sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
|
||||
fi
|
||||
}
|
||||
|
||||
export IRONICCLIENT_DIR="$BASE/new/python-ironicclient"
|
||||
|
||||
sudo chown -R $USER:stack $IRONICCLIENT_DIR
|
||||
|
||||
cd $IRONICCLIENT_DIR
|
||||
|
||||
# Run tests
|
||||
echo "Running ironicclient functional test suite"
|
||||
set +e
|
||||
|
||||
# Only admin credentials needed for ironic api
|
||||
source $BASE/new/devstack/openrc admin admin
|
||||
|
||||
# Preserve env for OS_ credentials
|
||||
sudo -E -H -u $USER ./tools/run_functional.sh
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
# Collect and parse result
|
||||
generate_testr_results
|
||||
exit $EXIT_CODE
|
|
@ -0,0 +1,49 @@
|
|||
- hosts: all
|
||||
tasks:
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
export BASE='/opt/stack'
|
||||
export IRONICCLIENT_DIR="$BASE/python-ironicclient"
|
||||
sudo chmod -R a+rw /opt/stack/
|
||||
cd $IRONICCLIENT_DIR
|
||||
set +e
|
||||
echo "Running ironicclient functional test suite"
|
||||
|
||||
# Only admin credentials needed for ironic api
|
||||
source $BASE/devstack/openrc admin admin
|
||||
|
||||
FUNC_TEST_DIR=$IRONICCLIENT_DIR/ironicclient/tests/functional
|
||||
CONFIG_FILE=$IRONICCLIENT_DIR/test.conf
|
||||
echo 'Generating configuration file for functional tests'
|
||||
|
||||
if [[ -n "$IRONIC_URL" ]]; then
|
||||
cat <<END >$CONFIG_FILE
|
||||
[functional]
|
||||
api_version = 1
|
||||
auth_strategy=noauth
|
||||
ironic_url=$IRONIC_URL
|
||||
END
|
||||
else
|
||||
cat <<END >$CONFIG_FILE
|
||||
[functional]
|
||||
api_version = 1
|
||||
os_auth_url=$OS_AUTH_URL
|
||||
os_identity_api_version=$OS_IDENTITY_API_VERSION
|
||||
os_username=$OS_USERNAME
|
||||
os_password=$OS_PASSWORD
|
||||
os_project_name=$OS_PROJECT_NAME
|
||||
os_user_domain_id=$OS_USER_DOMAIN_ID
|
||||
os_project_domain_id=$OS_PROJECT_DOMAIN_ID
|
||||
os_service_type=baremetal
|
||||
os_endpoint_type=public
|
||||
END
|
||||
fi
|
||||
echo 'Configuration file is in '$CONFIG_FILE''
|
||||
export IRONICCLIENT_TEST_CONFIG=$CONFIG_FILE
|
||||
|
||||
cd $IRONICCLIENT_DIR
|
||||
tox -e functional
|
||||
executable: /bin/bash
|
||||
chdir: '/opt/stack/python-ironicclient'
|
|
@ -1,15 +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=/logs/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
|
@ -1,68 +0,0 @@
|
|||
- hosts: all
|
||||
name: Autoconverted job legacy-ironicclient-dsvm-functional from old job gate-ironicclient-dsvm-functional-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-infra/devstack-gate
|
||||
dest: devstack-gate
|
||||
EOF
|
||||
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
|
||||
https://git.openstack.org \
|
||||
openstack-infra/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 ironic https://git.openstack.org/openstack/ironic
|
||||
IRONIC_DEPLOY_DRIVER=fake
|
||||
# neutron is not enabled here
|
||||
IRONIC_ENABLED_NETWORK_INTERFACES=noop
|
||||
IRONIC_DHCP_PROVIDER=none
|
||||
|
||||
EOF
|
||||
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_TEMPEST=0
|
||||
export DEVSTACK_PROJECT_FROM_GIT=python-ironicclient
|
||||
export OVERRIDE_ENABLED_SERVICES=key,mysql,rabbit,ir-api,ir-cond
|
||||
export BRANCH_OVERRIDE=default
|
||||
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
|
||||
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
|
||||
fi
|
||||
export PROJECTS="openstack/ironic $PROJECTS"
|
||||
|
||||
function post_test_hook {
|
||||
# Configure and run functional tests
|
||||
$BASE/new/python-ironicclient/ironicclient/tests/functional/hooks/post_test_hook.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 }}'
|
|
@ -1,15 +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=/logs/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
|
@ -1,113 +0,0 @@
|
|||
- hosts: all
|
||||
name: Autoconverted job legacy-tempest-dsvm-python-ironicclient-src from old job
|
||||
gate-tempest-dsvm-python-ironicclient-src-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-infra/devstack-gate
|
||||
dest: devstack-gate
|
||||
EOF
|
||||
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
|
||||
https://git.openstack.org \
|
||||
openstack-infra/devstack-gate
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
cat << 'EOF' >> ironic-extra-vars
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_VM_SPECS_RAM=384"
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_RAMDISK_TYPE=tinyipa"
|
||||
EOF
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
cat << 'EOF' >> ironic-extra-vars
|
||||
export DEVSTACK_GATE_TEMPEST_REGEX="ironic_tempest_plugin.tests.scenario"
|
||||
|
||||
EOF
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
cat << 'EOF' >> ironic-extra-vars
|
||||
export DEVSTACK_PROJECT_FROM_GIT="python-ironicclient,$DEVSTACK_PROJECT_FROM_GIT"
|
||||
|
||||
EOF
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
cat << 'EOF' >> ironic-vars-early
|
||||
# use tempest plugin
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"TEMPEST_PLUGINS+=' /opt/stack/new/ironic-tempest-plugin'"
|
||||
export TEMPEST_CONCURRENCY=1
|
||||
EOF
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
export PROJECTS="openstack/ironic $PROJECTS"
|
||||
export PROJECTS="openstack/ironic-lib $PROJECTS"
|
||||
export PROJECTS="openstack/ironic-python-agent $PROJECTS"
|
||||
export PROJECTS="openstack/ironic-tempest-plugin $PROJECTS"
|
||||
export PROJECTS="openstack/python-ironicclient $PROJECTS"
|
||||
export PROJECTS="openstack/pyghmi $PROJECTS"
|
||||
export PROJECTS="openstack/virtualbmc $PROJECTS"
|
||||
export PYTHONUNBUFFERED=true
|
||||
export DEVSTACK_GATE_TEMPEST=1
|
||||
export DEVSTACK_GATE_IRONIC=1
|
||||
export DEVSTACK_GATE_NEUTRON=1
|
||||
export DEVSTACK_GATE_VIRT_DRIVER=ironic
|
||||
export DEVSTACK_GATE_CONFIGDRIVE=1
|
||||
export DEVSTACK_GATE_IRONIC_DRIVER=ipmi
|
||||
export BRANCH_OVERRIDE=default
|
||||
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
|
||||
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
|
||||
fi
|
||||
|
||||
if [[ ! "stable/newton stable/ocata stable/pike" =~ $ZUUL_BRANCH ]] ; then
|
||||
export DEVSTACK_GATE_TLSPROXY=1
|
||||
fi
|
||||
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_TEMPEST_WHOLE_DISK_IMAGE=False"
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_VM_EPHEMERAL_DISK=1"
|
||||
export DEVSTACK_GATE_IRONIC_BUILD_RAMDISK=0
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_INSPECTOR_BUILD_RAMDISK=False"
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"IRONIC_VM_COUNT=1"
|
||||
|
||||
# Ensure the ironic-vars-EARLY file exists
|
||||
touch ironic-vars-early
|
||||
# Pull in the EARLY variables injected by the optional builders
|
||||
source ironic-vars-early
|
||||
|
||||
export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin ironic https://git.openstack.org/openstack/ironic"
|
||||
|
||||
# Ensure the ironic-EXTRA-vars file exists
|
||||
touch ironic-extra-vars
|
||||
# Pull in the EXTRA variables injected by the optional builders
|
||||
source ironic-extra-vars
|
||||
|
||||
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 }}'
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
FUNC_TEST_DIR=$(dirname $0)/../ironicclient/tests/functional/
|
||||
CONFIG_FILE=$FUNC_TEST_DIR/test.conf
|
||||
|
||||
if [[ -n "$IRONIC_URL" ]]; then
|
||||
cat <<END >$CONFIG_FILE
|
||||
[functional]
|
||||
api_version = 1
|
||||
auth_strategy=noauth
|
||||
ironic_url=$IRONIC_URL
|
||||
END
|
||||
else
|
||||
cat <<END >$CONFIG_FILE
|
||||
[functional]
|
||||
api_version = 1
|
||||
os_auth_url=$OS_AUTH_URL
|
||||
os_identity_api_version=$OS_IDENTITY_API_VERSION
|
||||
os_username=$OS_USERNAME
|
||||
os_password=$OS_PASSWORD
|
||||
os_project_name=$OS_PROJECT_NAME
|
||||
os_user_domain_id=$OS_USER_DOMAIN_ID
|
||||
os_project_domain_id=$OS_PROJECT_DOMAIN_ID
|
||||
os_service_type=baremetal
|
||||
os_endpoint_type=public
|
||||
END
|
||||
fi
|
||||
tox -e functional
|
1
tox.ini
1
tox.ini
|
@ -53,6 +53,7 @@ deps =
|
|||
commands = {posargs}
|
||||
|
||||
[testenv:functional]
|
||||
passenv = *
|
||||
setenv = TESTS_DIR=./ironicclient/tests/functional
|
||||
LANGUAGE=en_US
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
- job:
|
||||
name: ironicclient-functional
|
||||
parent: devstack-minimal
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
- ^doc/.*$
|
||||
- ^ironicclient/locale/.*$
|
||||
- ^ironicclient/tests/.*$
|
||||
- ^releasenotes/.*$
|
||||
- ^setup.cfg$
|
||||
- ^tools/.*$
|
||||
- ^tox.ini$
|
||||
required-projects:
|
||||
- openstack/ironic
|
||||
- openstack/python-ironicclient
|
||||
- openstack/keystone
|
||||
- openstack/tempest
|
||||
timeout: 4800
|
||||
post-run: playbooks/functional/run.yaml
|
||||
vars:
|
||||
tox_environment:
|
||||
PYTHONUNBUFFERED: 'true'
|
||||
tox_envlist: functional
|
||||
devstack_plugins:
|
||||
ironic: https://git.openstack.org/openstack/ironic
|
||||
devstack_localrc:
|
||||
USE_PYTHON3: False
|
||||
EBTABLES_RACE_FIX: True
|
||||
IRONIC_ENABLED_NETWORK_INTERFACES: noop
|
||||
IRONIC_DHCP_PROVIDER: none
|
||||
IRONIC_DEPLOY_DRIVER: fake
|
||||
INSTALL_TEMPEST: False
|
||||
devstack_services:
|
||||
key: True
|
||||
mysql: True
|
||||
rabbit: True
|
||||
|
||||
|
||||
- job:
|
||||
name: ironicclient-tempest
|
||||
parent: ironic-base
|
||||
required-projects:
|
||||
- openstack/python-ironicclient
|
||||
timeout: 10800
|
||||
vars:
|
||||
devstack_localrc:
|
||||
USE_PYTHON3: True
|
||||
EBTABLES_RACE_FIX: True
|
|
@ -1,42 +0,0 @@
|
|||
- job:
|
||||
name: ironicclient-dsvm-functional
|
||||
parent: legacy-dsvm-base
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
- ^doc/.*$
|
||||
- ^releasenotes/.*$
|
||||
required-projects:
|
||||
- openstack-infra/devstack-gate
|
||||
- openstack/ironic
|
||||
- openstack/python-ironicclient
|
||||
run: playbooks/legacy/ironicclient-dsvm-functional/run.yaml
|
||||
post-run: playbooks/legacy/ironicclient-dsvm-functional/post.yaml
|
||||
timeout: 4800
|
||||
|
||||
- job:
|
||||
name: ironicclient-tempest-dsvm-src
|
||||
# NOTE: We do not use 'legacy-ironic-dsvm-base' as it is simpler and
|
||||
# less confusing to define it all here and use 'legacy-dsvm-base'.
|
||||
parent: legacy-dsvm-base
|
||||
irrelevant-files:
|
||||
- ^test-requirements.txt$
|
||||
- ^.*\.rst$
|
||||
- ^doc/.*$
|
||||
- ^ironicclient/tests/.*$
|
||||
- ^releasenotes/.*$
|
||||
- ^setup.cfg$
|
||||
- ^tools/.*$
|
||||
- ^tox.ini$
|
||||
required-projects:
|
||||
- openstack-infra/devstack-gate
|
||||
- openstack/ironic
|
||||
- openstack/ironic-lib
|
||||
- openstack/ironic-python-agent
|
||||
- openstack/ironic-tempest-plugin
|
||||
- openstack/pyghmi
|
||||
- openstack/python-ironicclient
|
||||
- openstack/tempest
|
||||
- openstack/virtualbmc
|
||||
run: playbooks/legacy/ironicclient-tempest-dsvm-src/run.yaml
|
||||
post-run: playbooks/legacy/ironicclient-tempest-dsvm-src/post.yaml
|
||||
timeout: 10800
|
|
@ -12,10 +12,10 @@
|
|||
- release-notes-jobs-python3
|
||||
check:
|
||||
jobs:
|
||||
- ironicclient-dsvm-functional
|
||||
- ironicclient-tempest-dsvm-src
|
||||
- ironicclient-functional
|
||||
- ironicclient-tempest
|
||||
gate:
|
||||
queue: ironic
|
||||
jobs:
|
||||
- ironicclient-dsvm-functional
|
||||
- ironicclient-tempest-dsvm-src
|
||||
- ironicclient-functional
|
||||
- ironicclient-tempest
|
||||
|
|
Loading…
Reference in New Issue