From 80001aa096a6a98102db5b4ce73b6c0f12e4ca6b Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Fri, 27 Apr 2018 16:49:08 +0900 Subject: [PATCH] Add ceph-s3 test non-voting job This patch added new non-voting gate job to check the s3api compatibility via swiftstack/s3compat tool that shows the ratio of compatible S3 APIs in the gate result for each patch. This is very useful to check the possibility if the new incoming patch breaks S3 API compatibility unexpectedly. Originally swift3 has this kind of the gate job but we missed the staff while migrating from swift3 into swift upstream repo so this is the porting of that. Note that currently the job is against to only tempauth because we don't have custom gate jobs using keystone environment other than dsvm. Change-Id: I6f30f74678ad35479da237361bee48c46c0ecc49 --- .zuul.yaml | 21 +++++++ doc/saio/swift/proxy-server.conf | 7 +++ tools/playbooks/ceph-s3tests/ceph-s3.conf | 18 ++++++ tools/playbooks/ceph-s3tests/post.yaml | 10 ++++ tools/playbooks/ceph-s3tests/run.yaml | 60 +++++++++++++++++++ .../install_dependencies.yaml | 1 + .../saio_single_node_setup/setup_saio.yaml | 2 +- 7 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tools/playbooks/ceph-s3tests/ceph-s3.conf create mode 100644 tools/playbooks/ceph-s3tests/post.yaml create mode 100644 tools/playbooks/ceph-s3tests/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 743f7d495a..3fbd4567cb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -173,6 +173,22 @@ HOST_IPV6: '[::1]' SERVICE_HOST: '[::1]' +- job: + name: swift-tox-func-s3api-ceph-s3tests-tempauth + parent: unittests + voting: false + nodeset: centos-7 + description: | + Setup a SAIO dev environment and run ceph-s3tests + pre-run: + - tools/playbooks/saio_single_node_setup/install_dependencies.yaml + - tools/playbooks/saio_single_node_setup/setup_saio.yaml + - tools/playbooks/saio_single_node_setup/make_rings.yaml + run: tools/playbooks/ceph-s3tests/run.yaml + post-run: + - tools/playbooks/probetests/post.yaml + - tools/playbooks/ceph-s3tests/post.yaml + - job: name: swift-probetests-centos-7 parent: unittests @@ -233,6 +249,11 @@ - ^(api-ref|doc|releasenotes)/.*$ - ^test/probe/.*$ - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ + - swift-tox-func-s3api-ceph-s3tests-tempauth: + irrelevant-files: + - ^(api-ref|releasenotes)/.*$ + - ^test/probe/.*$ + - ^(.gitreview|.mailmap|AUTHORS|CHANGELOG)$ - swift-probetests-centos-7: irrelevant-files: - ^(api-ref|releasenotes)/.*$ diff --git a/doc/saio/swift/proxy-server.conf b/doc/saio/swift/proxy-server.conf index 5dcf1e4eb3..079f941031 100644 --- a/doc/saio/swift/proxy-server.conf +++ b/doc/saio/swift/proxy-server.conf @@ -39,6 +39,13 @@ use = egg:swift#slo use = egg:swift#container_sync current = //saio/saio_endpoint +[filter:s3api] +use = egg:swift#s3api +# Add this filter to your pipeline if you want to test with the S3 protocol. +s3_acl = yes +dns_compliant_bucket_names = no +check_bucket_owner = yes + [filter:tempurl] use = egg:swift#tempurl diff --git a/tools/playbooks/ceph-s3tests/ceph-s3.conf b/tools/playbooks/ceph-s3tests/ceph-s3.conf new file mode 100644 index 0000000000..7e66923a7a --- /dev/null +++ b/tools/playbooks/ceph-s3tests/ceph-s3.conf @@ -0,0 +1,18 @@ +[DEFAULT] +host = localhost +port = 8080 +is_secure = no + +[s3 main] +user_id = test:tester +display_name = test:tester +email = test:tester +access_key = test:tester +secret_key = testing + +[s3 alt] +user_id = test:tester3 +display_name = test:tester3 +email = test:tester3 +access_key = test:tester3 +secret_key = testing3 diff --git a/tools/playbooks/ceph-s3tests/post.yaml b/tools/playbooks/ceph-s3tests/post.yaml new file mode 100644 index 0000000000..84f6be9391 --- /dev/null +++ b/tools/playbooks/ceph-s3tests/post.yaml @@ -0,0 +1,10 @@ +- hosts: all + become: true + tasks: + - name: Copy s3-tests outputs from worker nodes to executor node + synchronize: + src: '{{ ansible_env.HOME }}/s3compat/output' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true diff --git a/tools/playbooks/ceph-s3tests/run.yaml b/tools/playbooks/ceph-s3tests/run.yaml new file mode 100644 index 0000000000..4932ffc2b2 --- /dev/null +++ b/tools/playbooks/ceph-s3tests/run.yaml @@ -0,0 +1,60 @@ +# 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: + # TODO: remove this task when s3api is in the pipeline by default + - name: Add s3api in proxy-server.conf + replace: + path: "/etc/swift/proxy-server.conf" + regexp: "container_sync tempauth" + replace: "container_sync s3api tempauth" + become: true + + - name: Starts main swift servers + shell: "swift-init main start" + become: true + + - name: Clone s3compat repository + git: + repo: "https://github.com/swiftstack/s3compat.git" + dest: "{{ ansible_env.HOME }}/s3compat" + + - name: Install s3compat requirements + pip: + requirements: "{{ ansible_env.HOME }}/s3compat/requirements.txt" + virtualenv: "{{ ansible_env.HOME }}/venv" + become: true + + - name: Run s3compat tests + shell: '{{ ansible_env.HOME }}/venv/bin/python {{ ansible_env.HOME }}/s3compat/bin/run_ceph_tests.py "$@" || true' + environment: + S3TEST_CONF: "{{ ansible_env.HOME }}/{{ zuul.project.src_dir }}/tools/playbooks/ceph-s3tests/ceph-s3.conf" + S3ACL: "true" + DNS_BUCKET_NAMES: "false" + CHECK_BUCKET_OWNER: "true" + args: + chdir: '{{ ansible_env.HOME }}/s3compat' + + - name: Show report + shell: | + set -o pipefail + "{{ ansible_env.HOME }}/venv/bin/python" ./bin/get_ceph_test_attributes.py + "{{ ansible_env.HOME }}/venv/bin/python" ./bin/report.py --detailed "{{ ansible_env.HOME }}/s3compat/output/ceph-s3.out.yaml" \ + --known-failures "{{ ansible_env.HOME}}/{{ zuul.project.src_dir }}/doc/s3api/conf/ceph-known-failures-tempauth.yaml" \ + --detailedformat console "{{ ansible_env.HOME }}/s3compat/output/ceph-s3.out.xml" | \ + tee "{{ ansible_env.HOME }}/s3compat/output/ceph-s3-summary.log" + args: + chdir: + "{{ ansible_env.HOME }}/s3compat" diff --git a/tools/playbooks/saio_single_node_setup/install_dependencies.yaml b/tools/playbooks/saio_single_node_setup/install_dependencies.yaml index 3302b99855..d34e3648c2 100644 --- a/tools/playbooks/saio_single_node_setup/install_dependencies.yaml +++ b/tools/playbooks/saio_single_node_setup/install_dependencies.yaml @@ -22,3 +22,4 @@ - python-pyeclib - python-nose - python-swiftclient + become: true diff --git a/tools/playbooks/saio_single_node_setup/setup_saio.yaml b/tools/playbooks/saio_single_node_setup/setup_saio.yaml index f41c7464c2..e809e459f3 100644 --- a/tools/playbooks/saio_single_node_setup/setup_saio.yaml +++ b/tools/playbooks/saio_single_node_setup/setup_saio.yaml @@ -19,7 +19,7 @@ file: path=/srv state=directory - name: create loopback device - command: truncate -s 1GB /srv/swift-disk creates=/srv/swift-disk + command: truncate -s 10GB /srv/swift-disk creates=/srv/swift-disk - name: create filesystem /srv/swift-disk become: true