diff --git a/tasks/swift_proxy_hosts.yml b/tasks/swift_proxy_hosts.yml index 8d0ca62f..ff7dcfa4 100644 --- a/tasks/swift_proxy_hosts.yml +++ b/tasks/swift_proxy_hosts.yml @@ -28,6 +28,7 @@ delay: 10 when: - swift_gnocchi_enabled | bool + no_log: True - name: Store Gnocchi project id set_fact: diff --git a/tasks/swift_service_setup.yml b/tasks/swift_service_setup.yml index b2d6b846..e86cf90c 100644 --- a/tasks/swift_service_setup.yml +++ b/tasks/swift_service_setup.yml @@ -29,6 +29,7 @@ until: add_service|success retries: 5 delay: 2 + no_log: True # Create an admin user - name: Ensure swift user @@ -47,6 +48,7 @@ until: add_service|success retries: 5 delay: 10 + no_log: True # Add a role to the user - name: Ensure swift user to admin role @@ -65,6 +67,7 @@ until: add_service|success retries: 5 delay: 10 + no_log: True - name: Ensure swiftoperator role keystone: @@ -79,6 +82,7 @@ until: add_service|success retries: 5 delay: 10 + no_log: True - name: "Create keystone user for swift-dispersion" keystone: @@ -96,6 +100,7 @@ until: add_service|success retries: 5 delay: 10 + no_log: True - name: "Create keystone role for ResellerAdmin" keystone: @@ -110,6 +115,7 @@ until: add_role|success retries: 5 delay: 10 + no_log: True - name: "Add ResellerAdmin role to the service tenant and ceilometer user" keystone: @@ -127,6 +133,7 @@ retries: 5 delay: 10 when: swift_ceilometer_enabled | bool + no_log: True - name: "Add swiftoperator role to swift-dispersion user" keystone: @@ -143,6 +150,7 @@ until: add_service|success retries: 5 delay: 10 + no_log: True # Create an endpoint - name: Ensure swift endpoint @@ -167,3 +175,4 @@ until: add_service|success retries: 5 delay: 10 + no_log: True diff --git a/tests/test-swift-functional.yml b/tests/test-swift-functional.yml index 3751d773..4a87396a 100644 --- a/tests/test-swift-functional.yml +++ b/tests/test-swift-functional.yml @@ -1,8 +1,24 @@ --- +# 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. + - name: Setup testing - run Swift functional tests hosts: swift_proxy[0] user: root gather_facts: true + vars_files: + - common/test-vars.yml pre_tasks: - name: Ensure test projects keystone: @@ -26,6 +42,8 @@ until: add_service|success retries: 5 delay: 10 + no_log: True + - name: Ensure required roles keystone: command: "ensure_role" @@ -44,6 +62,8 @@ until: add_service|success retries: 5 delay: 10 + no_log: True + - name: Add swift users for testing keystone: command: "ensure_user" @@ -68,6 +88,8 @@ until: add_service|success retries: 5 delay: 10 + no_log: True + - name: Ensure roles for swift test users keystone: command: "ensure_user_role" @@ -87,12 +109,13 @@ - { user_name: "test5", project_name: "test5", role_name: "test5", domain_name: "Default" } - { user_name: "test6", project_name: "test6", role_name: "ResellerAdmin", domain_name: "Default" } when: groups['keystone_all'] is defined - retries: 5 run_once: true register: add_service until: add_service|success retries: 5 delay: 10 + no_log: True + - name: Clone swift repository on proxy-host git: repo: "https://git.openstack.org/openstack/swift" @@ -100,6 +123,7 @@ update: yes clone: yes version: "{{ swift_git_install_branch }}" + - name: Install requirements for swift pip: requirements: "{{ item }}" @@ -110,6 +134,7 @@ {{ pip_install_options | default('') }} with_items: - "/opt/swift/test-requirements.txt" + - name: Setup test.conf for testing template: src: "swift_test.conf.j2" @@ -120,10 +145,12 @@ command: dd if=/dev/zero of=/swift_swap bs=1M count=1024 when: - inventory_hostname in groups['swift_hosts'] + - name: Make swap for swift-storage hosts command: mkswap /swift_swap when: - inventory_hostname in groups['swift_hosts'] + - name: Add swap to fstab for swift-storage hosts lineinfile: dest: /etc/fstab @@ -132,10 +159,12 @@ state: present when: - inventory_hostname in groups['swift_hosts'] + - name: Turn swap on for swift-storage hosts command: swapon -a when: - inventory_hostname in groups['swift_hosts'] + - name: Run functional tests for swift shell: "source /openstack/venvs/swift-untagged/bin/activate && ./.functests" args: @@ -143,5 +172,3 @@ executable: "/bin/bash" tags: - skip_ansible_lint - vars_files: - - common/test-vars.yml