From 386cdb51e20581d781df800d785c35a488f5d4c7 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sun, 9 Sep 2018 11:31:11 +0100 Subject: [PATCH] Clean up role tests Now that we're using the general templates, we can slim down the role test definitions. We can also remove tests which are not being watched, or which are fundamentally broken. With this we can also remove unused scripts/plays. We do the following: 1. We remove the 'upgrade' job, given that it's been broken all cycle due to the way the job executes and we need to regroup to figure out another way to do it. The associated scripts are also removed. 2. We remove the 'pypy' tox target. The job was removed some time ago, but the tox target left behind. The associated inventory is also removed. 3. We remove the 'multireg' jobs. The jobs have been failing for some time and are very complex. If multi-region tests are re-implemented, they should be done in a simpler way - probably best using multiple nodes, rather than trying to fudge it on a single host with containers. The associated scripts and inventory items are also removed. 4. We rename the 'func_swift3' tox target to 'swift3', and reconfigure the job appropriately. The verbose logging for ansible is also removed, given that we have ARA to provide decent diagnostic output. Change-Id: I411fcaac9a1ddf17996d771f13b2de7e775e4a60 --- tests/benchmark-upgrade.yml | 21 ----- tests/host_vars/infraMR.yml | 26 ------ tests/host_vars/swift-proxyA.yml | 36 -------- tests/host_vars/swift-proxyB.yml | 36 -------- tests/host_vars/swift-storageA1.yml | 37 -------- tests/host_vars/swift-storageA2.yml | 37 -------- tests/host_vars/swift-storageB1.yml | 37 -------- tests/host_vars/swift-storageB2.yml | 37 -------- tests/inventory_MR_A | 67 -------------- tests/inventory_MR_B | 64 -------------- tests/inventory_pypy | 43 --------- tests/os_swift-overrides-MR-A.yml | 31 ------- tests/os_swift-overrides-MR-B.yml | 20 ----- tests/os_swift-overrides-pypy.yml | 63 -------------- tests/test-install-previous-swift.yml | 27 ------ tests/test-swift-multi_reg.sh | 115 ------------------------- tests/test-swift-resources-results.yml | 30 ------- tests/test-swift-resources-upgrade.yml | 59 ------------- tests/test-swift-upgrades.sh | 109 ----------------------- tests/test-upgrade.yml | 26 ------ tox.ini | 28 +----- zuul.d/jobs.yaml | 18 +--- zuul.d/project.yaml | 11 +-- 23 files changed, 7 insertions(+), 971 deletions(-) delete mode 100644 tests/benchmark-upgrade.yml delete mode 100644 tests/host_vars/infraMR.yml delete mode 100644 tests/host_vars/swift-proxyA.yml delete mode 100644 tests/host_vars/swift-proxyB.yml delete mode 100644 tests/host_vars/swift-storageA1.yml delete mode 100644 tests/host_vars/swift-storageA2.yml delete mode 100644 tests/host_vars/swift-storageB1.yml delete mode 100644 tests/host_vars/swift-storageB2.yml delete mode 100644 tests/inventory_MR_A delete mode 100644 tests/inventory_MR_B delete mode 100644 tests/inventory_pypy delete mode 100644 tests/os_swift-overrides-MR-A.yml delete mode 100644 tests/os_swift-overrides-MR-B.yml delete mode 100644 tests/os_swift-overrides-pypy.yml delete mode 100644 tests/test-install-previous-swift.yml delete mode 100755 tests/test-swift-multi_reg.sh delete mode 100644 tests/test-swift-resources-results.yml delete mode 100644 tests/test-swift-resources-upgrade.yml delete mode 100755 tests/test-swift-upgrades.sh delete mode 100644 tests/test-upgrade.yml diff --git a/tests/benchmark-upgrade.yml b/tests/benchmark-upgrade.yml deleted file mode 100644 index c888000b..00000000 --- a/tests/benchmark-upgrade.yml +++ /dev/null @@ -1,21 +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. - -- import_playbook: test-swift-resources-upgrade.yml - -- import_playbook: common/test-install-swift.yml - -- import_playbook: test-swift-resources-results.yml - diff --git a/tests/host_vars/infraMR.yml b/tests/host_vars/infraMR.yml deleted file mode 100644 index f774f47b..00000000 --- a/tests/host_vars/infraMR.yml +++ /dev/null @@ -1,26 +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. - -ansible_host: 10.1.1.101 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtA" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.11.0/24" - gateway: "10.1.1.1" diff --git a/tests/host_vars/swift-proxyA.yml b/tests/host_vars/swift-proxyA.yml deleted file mode 100644 index 8240af4e..00000000 --- a/tests/host_vars/swift-proxyA.yml +++ /dev/null @@ -1,36 +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. - -ansible_host: 10.1.1.102 -storage_address: 10.1.2.102 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtA" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.11.0/24" - gateway: "10.1.1.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageA" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.12.0/24" - gateway: "10.1.2.1" diff --git a/tests/host_vars/swift-proxyB.yml b/tests/host_vars/swift-proxyB.yml deleted file mode 100644 index a29bccbe..00000000 --- a/tests/host_vars/swift-proxyB.yml +++ /dev/null @@ -1,36 +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. - -ansible_host: 10.1.11.102 -storage_address: 10.1.12.102 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtB" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.1.0/24" - gateway: "10.1.11.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageB" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.2.0/24" - gateway: "10.1.12.1" diff --git a/tests/host_vars/swift-storageA1.yml b/tests/host_vars/swift-storageA1.yml deleted file mode 100644 index 31c7024e..00000000 --- a/tests/host_vars/swift-storageA1.yml +++ /dev/null @@ -1,37 +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. - -ansible_host: 10.1.1.103 -storage_address: 10.1.2.103 -replication_address: 10.1.2.103 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtA" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.11.0/24" - gateway: "10.1.1.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageA" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.12.0/24" - gateway: "10.1.2.1" diff --git a/tests/host_vars/swift-storageA2.yml b/tests/host_vars/swift-storageA2.yml deleted file mode 100644 index 7f41f6d0..00000000 --- a/tests/host_vars/swift-storageA2.yml +++ /dev/null @@ -1,37 +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. - -ansible_host: 10.1.1.104 -storage_address: 10.1.2.104 -replication_address: 10.1.2.104 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtA" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.11.0/24" - gateway: "10.1.1.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageA" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.12.0/24" - gateway: "10.1.2.1" diff --git a/tests/host_vars/swift-storageB1.yml b/tests/host_vars/swift-storageB1.yml deleted file mode 100644 index a3755e92..00000000 --- a/tests/host_vars/swift-storageB1.yml +++ /dev/null @@ -1,37 +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. - -ansible_host: 10.1.11.103 -storage_address: 10.1.12.103 -replication_address: 10.1.12.103 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtB" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.1.0/24" - gateway: "10.1.11.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageB" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.2.0/24" - gateway: "10.1.12.1" diff --git a/tests/host_vars/swift-storageB2.yml b/tests/host_vars/swift-storageB2.yml deleted file mode 100644 index b372ff71..00000000 --- a/tests/host_vars/swift-storageB2.yml +++ /dev/null @@ -1,37 +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. - -ansible_host: 10.1.11.104 -storage_address: 10.1.12.104 -replication_address: 10.1.12.104 -container_networks: - management_address: - address: "{{ ansible_host }}" - bridge: "br-mgmtB" - interface: "eth1" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.1.0/24" - gateway: "10.1.11.1" - storage_address: - address: "{{ storage_address }}" - bridge: "br-storageB" - interface: "eth2" - netmask: "255.255.255.0" - type: "veth" - static_routes: - - cidr: "10.1.2.0/24" - gateway: "10.1.12.1" diff --git a/tests/inventory_MR_A b/tests/inventory_MR_A deleted file mode 100644 index a00f1b2c..00000000 --- a/tests/inventory_MR_A +++ /dev/null @@ -1,67 +0,0 @@ -[all] -localhost -infraMR -swift-proxyA -swift-storageA1 -swift-storageA2 - -[all_containers] -infraMR -swift-proxyA -swift-storageA1 -swift-storageA2 -swift-proxyB -swift-storageB1 -swift-storageB2 - -[galera_all] -infraMR - -[memcached_all] -infraMR - -[oslomsg_rpc_all] -infraMR - -[oslomsg_notify_all] -infraMR - -[rabbitmq_all] -infraMR - -[service_all:children] -galera_all -memcached_all - -[keystone_all] -infraMR - -[swift_hosts] -swift-storageA1 -swift-storageA2 - -[swift_proxy] -swift-proxyA - -[swift_acc] -swift-storageA1 -swift-storageA2 - -[swift_cont] -swift-storageA1 -swift-storageA2 - -[swift_obj] -swift-storageA1 -swift-storageA2 - -[swift_all:children] -swift_acc -swift_proxy -swift_cont -swift_obj - -[swift_remote_all] -swift-proxyB -swift-storageB1 -swift-storageB2 diff --git a/tests/inventory_MR_B b/tests/inventory_MR_B deleted file mode 100644 index 5141e5d3..00000000 --- a/tests/inventory_MR_B +++ /dev/null @@ -1,64 +0,0 @@ -[all] -localhost -infraMR -swift-proxyB -swift-storageB1 -swift-storageB2 - -[all_containers] -infraMR -swift-proxyB -swift-storageB1 -swift-storageB2 - -[galera_all] -infraMR - -[memcached_all] -infraMR - -[oslomsg_rpc_all] -infraMR - -[oslomsg_notify_all] -infraMR - -[rabbitmq_all] -infraMR - -[service_all:children] -galera_all -memcached_all - -[keystone_all] -infraMR - -[swift_hosts] -swift-storageB1 -swift-storageB2 - -[swift_proxy] -swift-proxyB - -[swift_acc] -swift-storageB1 -swift-storageB2 - -[swift_cont] -swift-storageB1 -swift-storageB2 - -[swift_obj] -swift-storageB1 -swift-storageB2 - -[swift_all:children] -swift_acc -swift_proxy -swift_cont -swift_obj - -[swift_remote_all] -swift-proxyA -swift-storageA1 -swift-storageA2 diff --git a/tests/inventory_pypy b/tests/inventory_pypy deleted file mode 100644 index 6a33cf39..00000000 --- a/tests/inventory_pypy +++ /dev/null @@ -1,43 +0,0 @@ -[all] -localhost -swift-proxy -swift-storage1 -swift-storage2 - -[all_containers] -swift-proxy -swift-storage1 -swift-storage2 - -[memcached_all] -swift-proxy - -[service_all:children] -memcached_all - -[swift_hosts] -swift-storage1 -swift-storage2 - -[swift_proxy] -swift-proxy - -[swift_acc] -swift-storage1 -swift-storage2 - -[swift_cont] -swift-storage1 -swift-storage2 - -[swift_obj] -swift-storage1 -swift-storage2 - -[swift_all:children] -swift_acc -swift_proxy -swift_cont -swift_obj - -[swift_remote_all] diff --git a/tests/os_swift-overrides-MR-A.yml b/tests/os_swift-overrides-MR-A.yml deleted file mode 100644 index 083dda1c..00000000 --- a/tests/os_swift-overrides-MR-A.yml +++ /dev/null @@ -1,31 +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. - -# Only MR-A needs the bridges as it does the host setup -bridges: - - name: "br-mgmtA" - ip_addr: "10.1.1.1" - - name: "br-storageA" - ip_addr: "10.1.2.1" - - name: "br-mgmtB" - ip_addr: "10.1.11.1" - - name: "br-storageB" - ip_addr: "10.1.12.1" - -test_swift_region: 1 -test_swift_repl_network: "eth2" -swift_pretend_min_part_hours_passed: True - -swift_package_state: present diff --git a/tests/os_swift-overrides-MR-B.yml b/tests/os_swift-overrides-MR-B.yml deleted file mode 100644 index 9afcfbee..00000000 --- a/tests/os_swift-overrides-MR-B.yml +++ /dev/null @@ -1,20 +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. - -test_swift_region: 2 -test_swift_repl_network: "eth2" -swift_pretend_min_part_hours_passed: True - -swift_package_state: present diff --git a/tests/os_swift-overrides-pypy.yml b/tests/os_swift-overrides-pypy.yml deleted file mode 100644 index b8145750..00000000 --- a/tests/os_swift-overrides-pypy.yml +++ /dev/null @@ -1,63 +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. - -bridges: - - name: "br-mgmt" - ip_addr: "10.1.1.1" - - name: "br-storage" - ip_addr: "10.1.2.1" - - name: "br-repl" - ip_addr: "10.1.3.1" - -# These values are quite low due to memory constraints in an AIO -swift_pypy_gc_min: "5M" -swift_pypy_gc_max: "200M" -swift_pypy_enabled: True - -swift_middleware_list: - - catch_errors - - gatekeeper - - healthcheck - - proxy-logging - - "{% if swift_ceilometer_enabled | bool %}ceilometer{% endif %}" - - cache - - container_sync - - bulk - - tempurl - - ratelimit - - tempauth - - staticweb - - container-quotas - - account-quotas - - slo - - dlo - - proxy-logging - - proxy-server - -swift_tempauth_users: - - "user_admin_admin = admin .admin .reseller_admin" - - "user_test1_test1 = test1 .admin" - - "user_test2_test2 = test2 .admin" - - "user_test1_test3 = test3" - - "user_test5_test5 = test5 service" - - "user_test6_test6 = test6 .reseller_admin" - -swift_hard_open_file_limits: 30720 -swift_soft_open_file_limits: 12288 - -swift_rsync_module_per_drive: True -test_swift_repl_number: 2 - -swift_package_state: present diff --git a/tests/test-install-previous-swift.yml b/tests/test-install-previous-swift.yml deleted file mode 100644 index 6e85d4d6..00000000 --- a/tests/test-install-previous-swift.yml +++ /dev/null @@ -1,27 +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 -- import_playbook: common/previous/test-repo-setup.yml - -- name: Playbook for deploying swift - hosts: "{{ swift_groups | default('swift_all:swift_remote_all') }}" - user: root - become: true - gather_facts: true - roles: - - role: "os_previous_swift" - vars_files: - - common/previous/test-vars.yml diff --git a/tests/test-swift-multi_reg.sh b/tests/test-swift-multi_reg.sh deleted file mode 100755 index 4ca77aa6..00000000 --- a/tests/test-swift-multi_reg.sh +++ /dev/null @@ -1,115 +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 a test Ansible playbook for the purpose of -# functionally testing the role. It supports a convergence test, -# check mode and an idempotence test. - -## Shell Opts ---------------------------------------------------------------- - -set -e - -## Vars ---------------------------------------------------------------------- - -export WORKING_DIR=${WORKING_DIR:-$(pwd)} -export ROLE_NAME=${ROLE_NAME:-''} - -export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common" - -## Functions ----------------------------------------------------------------- - -function execute_ansible_playbook { - - export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS} -e @${ANSIBLE_OVERRIDES}" - CMD_TO_EXECUTE="ansible-playbook ${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} - -} - -function gate_job_exit_tasks { - source "${COMMON_TESTS_PATH}/test-log-collect.sh" -} - -## Main ---------------------------------------------------------------------- - -# Ensure that the Ansible environment is properly prepared -source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh" - -# Set gate job exit traps, this is run regardless of exit state when the job finishes. -trap gate_job_exit_tasks EXIT - -# Prepare environment for the setup of Region A -# NB we run against swift_all only since region B hosts don't exist yet. -export ANSIBLE_INVENTORY="${WORKING_DIR}/tests/inventory_MR_A" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-install-MR_A.log" -export ANSIBLE_OVERRIDES="${WORKING_DIR}/tests/${ROLE_NAME}-overrides-MR-A.yml" -export ANSIBLE_PARAMETERS="-vvv -e swift_do_setup=True -e swift_do_sync=False -e swift_groups=swift_all" -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test.yml" - -# Execute the setup of Region A -execute_ansible_playbook - -# Prepare environment for the setup of Region B -export ANSIBLE_INVENTORY="${WORKING_DIR}/tests/inventory_MR_B" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-install-MR_B.log" -export ANSIBLE_OVERRIDES="${WORKING_DIR}/tests/${ROLE_NAME}-overrides-MR-B.yml" -export ANSIBLE_PARAMETERS="-vvv" -export TEST_PLAYBOOK="${COMMON_TESTS_PATH}/test-install-swift.yml" - -# Execute the setup of Region B -execute_ansible_playbook - -# Prepare the environment for synchronising the rings from Region A -export ANSIBLE_INVENTORY="${WORKING_DIR}/tests/inventory_MR_A" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-sync-MR_A.log" -export ANSIBLE_OVERRIDES="${WORKING_DIR}/tests/${ROLE_NAME}-overrides-MR-A.yml" -export ANSIBLE_PARAMETERS="-vvv -e swift_do_setup=False -e swift_do_sync=True" -export TEST_PLAYBOOK="${COMMON_TESTS_PATH}/test-install-swift.yml" - -# Synchronise the rings from Region A -execute_ansible_playbook - -# Prepare the environment for functionally testing Region A -export ANSIBLE_INVENTORY="${WORKING_DIR}/tests/inventory_MR_A" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-test-MR_A.log" -export ANSIBLE_OVERRIDES="${WORKING_DIR}/tests/${ROLE_NAME}-overrides-MR-A.yml" -export ANSIBLE_PARAMETERS="-vvv" -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-swift-functional.yml" - -# Functionally test Region A -execute_ansible_playbook - -# Prepare the environment for functionally testing Region B -export ANSIBLE_INVENTORY="${WORKING_DIR}/tests/inventory_MR_B" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-test-MR_B.log" -export ANSIBLE_OVERRIDES="${WORKING_DIR}/tests/${ROLE_NAME}-overrides-MR-B.yml" -export ANSIBLE_PARAMETERS="-vvv" -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-swift-functional.yml" - -# Functionally test Region B -execute_ansible_playbook diff --git a/tests/test-swift-resources-results.yml b/tests/test-swift-resources-results.yml deleted file mode 100644 index 40c0b837..00000000 --- a/tests/test-swift-resources-results.yml +++ /dev/null @@ -1,30 +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 - become: yes - gather_facts: no - tasks: - - name: Kill resource test - command: pkill -f rolling_test - ignore_errors: yes - - 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" diff --git a/tests/test-swift-resources-upgrade.yml b/tests/test-swift-resources-upgrade.yml deleted file mode 100644 index 16303f32..00000000 --- a/tests/test-swift-resources-upgrade.yml +++ /dev/null @@ -1,59 +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 - become: yes - # 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" - vars_files: - - common/test-vars.yml - tasks: - - name: Generate clouds.yaml for API testing - include_role: - name: "openstack_openrc" - - name: Install openstack sdk - 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 swift - args: - chdir: "{{ working_dir }}" - executable: /bin/bash - async: 100000 - poll: 0 - environment: - OS_AUTH_URL: "{{ keystone_service_publicurl }}" - OS_PASSWORD: "{{ keystone_auth_admin_password }}" - register: rolling_test_benchmark diff --git a/tests/test-swift-upgrades.sh b/tests/test-swift-upgrades.sh deleted file mode 100755 index d738997d..00000000 --- a/tests/test-swift-upgrades.sh +++ /dev/null @@ -1,109 +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:-""} -export TEST_PLAYBOOK=$WORKING_DIR/tests/test-upgrade.yml -export TEST_CHECK_MODE=${TEST_CHECK_MODE:-false} -export TEST_IDEMPOTENCE=${TEST_IDEMPOTENCE:-false} -export ANSIBLE_OVERRIDES=$WORKING_DIR/tests/os_swift-overrides.yml - -export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common" - -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} -e @${ANSIBLE_OVERRIDES}" - 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) Swift -# No upgrading or testing is done yet. -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-swift-install.log" - -# Execute the setup of current infrastructure -execute_ansible_playbook - -# Prepare environment for the deploy of previous Nova: -# No upgrading or testing is done yet. -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-swift.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_swift-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 Neutron -execute_ansible_playbook - -# Unset previous branch overrides -unset PREVIOUS_VENV -unset ANSIBLE_BIN - -# Prepare environment for the upgrade of Swift -export TEST_PLAYBOOK="${WORKING_DIR}/tests/benchmark-upgrade.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-swift-upgrade.log" - -# Excute the upgrade of Neutron -execute_ansible_playbook - -# Prepare the environment for the testing of upgraded Swift -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-swift-functional.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-swift-upgrade-test.log" - -# Execute testing of upgraded Neutron -execute_ansible_playbook diff --git a/tests/test-upgrade.yml b/tests/test-upgrade.yml deleted file mode 100644 index 32179a9b..00000000 --- a/tests/test-upgrade.yml +++ /dev/null @@ -1,26 +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 keys, host and containers -- import_playbook: common/test-setup-host.yml - -# Install Memcached/Galera/Rabbitmq -- import_playbook: common/test-install-infra.yml - -# Install Keystone -- import_playbook: common/test-install-keystone.yml - -# Setup Swift-hosts -- import_playbook: common/test-setup-swifthosts.yml diff --git a/tox.ini b/tox.ini index b6b0710d..8eb23cc2 100644 --- a/tox.ini +++ b/tox.ini @@ -93,6 +93,7 @@ commands = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:distro_install] setenv = {[testenv]setenv} @@ -103,37 +104,16 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:upgrade] + +[testenv:swift3] setenv = {[testenv]setenv} - CLONE_UPGRADE_TESTS=yes -commands = - bash -c "{toxinidir}/tests/test-swift-upgrades.sh" - - -[testenv:func_pypy] -setenv = - {[testenv]setenv} - ANSIBLE_INVENTORY={toxinidir}/tests/inventory_pypy - ANSIBLE_OVERRIDES={toxinidir}/tests/os_swift-overrides-pypy.yml -commands = - bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" - - -[testenv:func_swift3] -setenv = - {[testenv]setenv} - ANSIBLE_PARAMETERS=-vvv -e swift_swift3_enabled=True + ANSIBLE_PARAMETERS=-e swift_swift3_enabled=True TEST_PLAYBOOK={toxinidir}/tests/test.yml {toxinidir}/tests/test-swift-functional.yml {toxinidir}/tests/test-swift3-functional.yml commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:multi_reg] -commands = - bash -c "{toxinidir}/tests/test-swift-multi_reg.sh" - - [testenv:linters] commands = bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 1837d290..6266b984 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -14,22 +14,8 @@ # limitations under the License. - job: - name: openstack-ansible-multireg-ubuntu-xenial + name: openstack-ansible-swift3-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial vars: - tox_env: multi_reg - -- job: - name: openstack-ansible-multireg-centos-7-nv - parent: openstack-ansible-functional-centos-7 - voting: false - vars: - tox_env: multi_reg - -- job: - name: openstack-ansible-swift3-ubuntu-xenial-nv - parent: openstack-ansible-functional-ubuntu-xenial - voting: false - vars: - tox_env: func_swift3 + tox_env: swift3 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 19eea044..fe56b22e 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -20,13 +20,8 @@ - release-notes-jobs-python3 check: jobs: - - openstack-ansible-upgrade-ubuntu-xenial - # TODO(odyssey4me): Revert this once the multi-region - # tests are fixed. - - openstack-ansible-multireg-ubuntu-xenial: + - openstack-ansible-swift3-ubuntu-xenial: voting: false - - openstack-ansible-multireg-centos-7-nv - - openstack-ansible-swift3-ubuntu-xenial-nv - openstack-ansible-functional-distro_install-ubuntu-xenial # NOTE(hwoarang) Centos7 is having some troubles with repo dependencies # so disabling until it's investigated. @@ -35,9 +30,5 @@ - openstack-ansible-functional-distro_install-opensuse-423 gate: jobs: - - openstack-ansible-upgrade-ubuntu-xenial - # TODO(odyssey4me): Revert this once the multi-region - # tests are fixed. - #- openstack-ansible-multireg-ubuntu-xenial - openstack-ansible-functional-distro_install-ubuntu-xenial - openstack-ansible-functional-distro_install-opensuse-423