From 27db5213dca4d9302b843dd22914a16e871f0b51 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Fri, 20 May 2022 12:00:16 -0700 Subject: [PATCH] CI: Run s3api test suite Change-Id: I70dec389c1ac608a9d2767d162bd5edc315e564b --- .zuul.yaml | 39 ++++++++++++++++++++--- tools/playbooks/ceph-s3tests/run.yaml | 9 ------ tools/playbooks/common/restart_swift.yaml | 24 ++++++++++++++ tools/playbooks/s3api-tests/run.yaml | 23 +++++++++++++ tox.ini | 7 ++++ 5 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 tools/playbooks/common/restart_swift.yaml create mode 100644 tools/playbooks/s3api-tests/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 378842921b..e63a214d5d 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -317,11 +317,32 @@ - tools/playbooks/saio_single_node_setup/setup_saio.yaml - tools/playbooks/saio_single_node_setup/add_s3api.yaml - tools/playbooks/saio_single_node_setup/make_rings.yaml + - tools/playbooks/common/restart_swift.yaml run: tools/playbooks/ceph-s3tests/run.yaml post-run: - tools/playbooks/probetests/post.yaml - tools/playbooks/ceph-s3tests/post.yaml +- job: + name: swift-tox-func-s3api-tests-tempauth + parent: unittests + nodeset: centos-8-stream + description: | + Setup a SAIO dev environment and run our s3api test suite + timeout: 1800 + vars: + s3_acl: yes + bindep_profile: test py36 + pre-run: + - tools/playbooks/common/install_dependencies.yaml + - tools/playbooks/saio_single_node_setup/setup_saio.yaml + - tools/playbooks/saio_single_node_setup/add_s3api.yaml + - tools/playbooks/saio_single_node_setup/make_rings.yaml + - tools/playbooks/common/restart_swift.yaml + run: tools/playbooks/s3api-tests/run.yaml + post-run: + - tools/playbooks/probetests/post.yaml + - job: name: swift-probetests-centos-7 parent: unittests @@ -616,7 +637,7 @@ - swift-tox-func-py36-centos-8-stream-fips: irrelevant-files: &functest-irrelevant-files - ^(api-ref|doc|releasenotes)/.*$ - - ^test/(cors|probe)/.*$ + - ^test/(cors|probe|s3api)/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG|.*\.rst)$ - swift-tox-func-encryption-py36-centos-8-stream-fips: irrelevant-files: *functest-irrelevant-files @@ -633,7 +654,7 @@ - swift-tox-py27: irrelevant-files: &unittest-irrelevant-files - ^(api-ref|doc|releasenotes)/.*$ - - ^test/(cors|functional|probe)/.*$ + - ^test/(cors|functional|probe|s3api)/.*$ - swift-tox-py36: irrelevant-files: *unittest-irrelevant-files - swift-tox-py39: @@ -661,7 +682,7 @@ - ^(api-ref|releasenotes)/.*$ # Keep doc/saio -- we use those sample configs in the saio playbooks - ^doc/(requirements.txt|(manpages|s3api|source)/.*)$ - - ^test/(unit|functional|probe)/.*$ + - ^test/(unit|functional|probe|s3api)/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ - swift-tox-func-s3api-ceph-s3tests-tempauth: irrelevant-files: @@ -669,14 +690,21 @@ # Keep doc/saio -- we use those sample configs in the saio playbooks # Also keep doc/s3api -- it holds known failures for these tests - ^doc/(requirements.txt|(manpages|source)/.*)$ - - ^test/(cors|unit|probe)/.*$ + - ^test/.*$ + - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG|.*\.rst)$ + - swift-tox-func-s3api-tests-tempauth: + irrelevant-files: + - ^(api-ref|releasenotes)/.*$ + # Keep doc/saio -- we use those sample configs in the saio playbooks + - ^doc/(requirements.txt|(manpages|s3api|source)/.*)$ + - ^test/(cors|unit|functional|probe)/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG|.*\.rst)$ - swift-probetests-centos-7: irrelevant-files: &probetest-irrelevant-files - ^(api-ref|releasenotes)/.*$ # Keep doc/saio -- we use those sample configs in the saio playbooks - ^doc/(requirements.txt|(manpages|s3api|source)/.*)$ - - ^test/(cors|unit|functional)/.*$ + - ^test/(cors|unit|functional|s3api)/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG|.*\.rst)$ - swift-probetests-centos-8-stream: irrelevant-files: *probetest-irrelevant-files @@ -722,6 +750,7 @@ - swift-tox-func-encryption-py38 - swift-tox-func-ec-py38 - swift-func-cors + - swift-tox-func-s3api-tests-tempauth - swift-probetests-centos-7: irrelevant-files: *probetest-irrelevant-files - swift-probetests-centos-8-stream: diff --git a/tools/playbooks/ceph-s3tests/run.yaml b/tools/playbooks/ceph-s3tests/run.yaml index 618c6821ac..45bb1745ee 100644 --- a/tools/playbooks/ceph-s3tests/run.yaml +++ b/tools/playbooks/ceph-s3tests/run.yaml @@ -14,15 +14,6 @@ # limitations under the License. - hosts: all tasks: - - name: Shutdown main swift services - shell: "swift-init stop main" - become: true - ignore_errors: true - - - name: Start main swift services - shell: "swift-init start main" - become: true - - name: Clone s3compat repository git: repo: "https://github.com/tipabu/s3compat.git" diff --git a/tools/playbooks/common/restart_swift.yaml b/tools/playbooks/common/restart_swift.yaml new file mode 100644 index 0000000000..4223e37741 --- /dev/null +++ b/tools/playbooks/common/restart_swift.yaml @@ -0,0 +1,24 @@ +# Copyright (c) 2018 OpenStack Foundation +# +# 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. +- hosts: all + tasks: + - name: Shutdown main swift services + shell: "swift-init stop main" + become: true + ignore_errors: true + + - name: Start main swift services + shell: "swift-init start main" + become: true diff --git a/tools/playbooks/s3api-tests/run.yaml b/tools/playbooks/s3api-tests/run.yaml new file mode 100644 index 0000000000..d73c2d840f --- /dev/null +++ b/tools/playbooks/s3api-tests/run.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2022 NVIDIA +# +# 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. +- hosts: all + roles: + - ensure-tox + tasks: + - name: Run s3api tests + include_role: + name: tox + vars: + tox_envlist: s3api diff --git a/tox.ini b/tox.ini index bcc3f373bd..3b7e5f30b9 100644 --- a/tox.ini +++ b/tox.ini @@ -23,6 +23,13 @@ allowlist_externals = find passenv = SWIFT_* *_proxy +[testenv:s3api] +usedevelop = False +deps = {[testenv:py36]deps} +commands = + nosetests {posargs:test/s3api} +passenv = SWIFT_* *_proxy + [testenv:py27] deps = -c{toxinidir}/py2-constraints.txt