Merge "Clean up role tests"

This commit is contained in:
Zuul 2018-09-12 00:07:21 +00:00 committed by Gerrit Code Review
commit 03e744522d
10 changed files with 4 additions and 308 deletions

View File

@ -50,10 +50,6 @@
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
scm: git
version: master
- name: os_previous_glance
src: https://git.openstack.org/openstack/openstack-ansible-os_glance
scm: git
version: stable/queens
- name: systemd_service
src: https://git.openstack.org/openstack/ansible-role-systemd_service
scm: git

View File

@ -1,28 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# 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.
- name: Playbook to report resource tests
hosts: localhost
user: root
tasks:
- name: Kill resource test
command: pkill -f rolling_test
- name: Register upgrade benchmarking results
async_status: jid={{ rolling_test_benchmark.ansible_job_id }}
register: rolling_test_benchmark_results
until: rolling_test_benchmark_results.finished
- name: Display basic summary
debug:
msg: "Finished upgrade with {{ rolling_test_benchmark_results.stdout }}% API response failure rate"

View File

@ -1,56 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# 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.
- name: Playbook to run resource tests against an openstack service
hosts: localhost
user: root
become: true
# TODO: remove the static reference to openstack1
vars:
test_keystone_host: openstack1
working_dir: "{{ lookup('env', 'WORKING_DIR') }}"
upgrade_venv_folder: "/openstack/venvs/upgrades"
upgrade_test_packages:
- "python-keystoneclient"
- "python-glanceclient"
- "openstacksdk"
roles:
- openstack_openrc
post_tasks:
- name: Install openstack clients
pip:
name: "{{ upgrade_test_packages }}"
virtualenv: "{{ upgrade_venv_folder }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages
until: install_packages is success
retries: 5
delay: 2
- name: Run rolling test script
shell: |
source {{ upgrade_venv_folder }}/bin/activate
./openstack-ansible-ops/bowling_ball/rolling_tests.py glance
args:
chdir: "{{ working_dir }}"
executable: /bin/bash
async: 100000
poll: 0
register: rolling_test_benchmark
vars_files:
- common/test-vars.yml

View File

@ -1,104 +0,0 @@
#!/usr/bin/env bash
# Copyright 2016, Rackspace US, Inc.
#
# 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.
# WARNING:
# This file is use by all OpenStack-Ansible roles for testing purposes.
# Any changes here will affect all OpenStack-Ansible role repositories
# with immediate effect.
# PURPOSE:
# This script executes test Ansible playbooks required for performing
# an upgrade test of the os_neutron role.
# Due to the way Ansible caches and handles modules, we need to run
# separate Ansible runs to ensure the "upgrade" uses the new
# "neutron_migrations_facts" module, instead of the cached version
# used when deploying the previous Neutron version.
## Shell Opts ----------------------------------------------------------------
set -e
## Vars ----------------------------------------------------------------------
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export ROLE_NAME=${ROLE_NAME:-''}
export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"-vvv"}
export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test-upgrade.yml}
export TEST_CHECK_MODE=${TEST_CHECK_MODE:-false}
export TEST_IDEMPOTENCE=${TEST_IDEMPOTENCE:-false}
export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
export OSA_OPS_DIR="${WORKING_DIR}/openstack-ansible-ops"
export BOWLING_BALL_DIR="${OSA_OPS_DIR}/bowling_ball"
echo "ANSIBLE_OVERRIDES: ${ANSIBLE_OVERRIDES}"
echo "ANSIBLE_PARAMETERS: ${ANSIBLE_PARAMETERS}"
echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}"
echo "TEST_CHECK_MODE: ${TEST_CHECK_MODE}"
echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}"
## Functions -----------------------------------------------------------------
function execute_ansible_playbook {
export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS}"
export ANSIBLE_BIN=${ANSIBLE_BIN:-"ansible-playbook"}
CMD_TO_EXECUTE="${ANSIBLE_BIN} ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
echo "Executing: ${CMD_TO_EXECUTE}"
echo "With:"
echo " ANSIBLE_INVENTORY: ${ANSIBLE_INVENTORY}"
echo " ANSIBLE_LOG_PATH: ${ANSIBLE_LOG_PATH}"
${CMD_TO_EXECUTE}
}
## Main ----------------------------------------------------------------------
# Ensure that the Ansible environment is properly prepared
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
# Prepare environment for the initial deploy of (previous and current) Glance
# No upgrading or testing is done yet.
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-glance-install.log"
# Execute the setup of current infrastructure
execute_ansible_playbook
# Prepare environment for the deploy of previous glance:
# No upgrading or testing is done yet.
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-glance.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_glance-install.log"
export PREVIOUS_VENV="ansible-previous"
export ANSIBLE_BIN="${WORKING_DIR}/.tox/${PREVIOUS_VENV}/bin/ansible-playbook"
source ${COMMON_TESTS_PATH}/test-create-previous-venv.sh
# Execute the setup of previous glance
execute_ansible_playbook
# Unset previous branch overrides
unset PREVIOUS_VENV
unset ANSIBLE_BIN
# Prepare the environment for the upgrade of Glance
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade-post.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-glance-upgrade.log"
# Execute the upgrade of Glance including testing/benchmarking
execute_ansible_playbook

View File

@ -1,34 +0,0 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# 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.
# Ensure the repo is setup for previous version
- include: common/previous/test-repo-setup.yml
- name: Playbook for deploying glance
hosts: glance_all
user: root
gather_facts: true
pre_tasks:
- include: common/ensure-rabbitmq.yml
vhost_name: "{{ glance_rabbitmq_vhost }}"
user_name: "{{ glance_rabbitmq_userid }}"
user_password: "{{ glance_rabbitmq_password }}"
- include: common/create-grant-db.yml
db_name: "{{ glance_galera_database }}"
db_password: "{{ glance_container_mysql_password }}"
roles:
- role: "os_previous_glance"
vars_files:
- common/previous/test-vars.yml

View File

@ -1,29 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# 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 playbook handles the installation of current Glance
# Benchmarking, and tempest testing.
# Install upgrade benchmarking
- include: test-benchmark-glance-upgrade.yml
# Install Glance
- include: common/test-install-glance.yml
# Install and execute Tempest
- include: common/test-install-tempest.yml
# Test upgrade benchmarking results
- include: test-benchmark-glance-upgrade-results.yml

View File

@ -1,23 +0,0 @@
---
# Copyright 2015, Rackspace US, Inc.
#
# 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.
# Setup the host
- include: common/test-setup-host.yml
# Install RabbitMQ/MariaDB
- include: common/test-install-infra.yml
# Install Keystone
- include: common/test-install-keystone.yml

16
tox.ini
View File

@ -100,14 +100,6 @@ commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:upgrade]
setenv =
{[testenv]setenv}
CLONE_UPGRADE_TESTS=yes
commands =
bash -c "{toxinidir}/tests/test-glance-upgrades.sh"
[testenv:v2_registry_enabled]
setenv =
{[testenv]setenv}
@ -125,14 +117,6 @@ commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:ssl]
setenv =
{[testenv]setenv}
ANSIBLE_PARAMETERS=-vvv -e galera_use_ssl=True
commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:linters]
commands =
bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh"

View File

@ -26,10 +26,3 @@
nodeset: ubuntu-xenial
vars:
tox_env: nfs
- job:
name: openstack-ansible-glance-ssl-nv
parent: openstack-ansible-functional-ubuntu-xenial
voting: false
vars:
tox_env: ssl

View File

@ -21,17 +21,14 @@
check:
jobs:
- openstack-ansible-nfs_glance
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-v2_registry_enabled
- openstack-ansible-glance-ssl-nv
- openstack-ansible-functional-distro_install-ubuntu-xenial
# NOTE(hwoarang) Centos7 is having some troubles with repo dependencies
# so disabling until it's investigated.
- openstack-ansible-functional-distro_install-centos-7:
voting: false
- openstack-ansible-functional-distro_install-centos-7
- openstack-ansible-functional-distro_install-opensuse-423
gate:
jobs:
- openstack-ansible-nfs_glance
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-v2_registry_enabled
- openstack-ansible-functional-distro_install-ubuntu-xenial
- openstack-ansible-functional-distro_install-centos-7
- openstack-ansible-functional-distro_install-opensuse-423