From 1fe60daf28cd0d7c1f6f5ec7b240aee0a6f5378d Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Wed, 8 Nov 2017 11:48:57 -0800 Subject: [PATCH] Use tempest plugin for functional testing Use barbican's tempest plugin for functional testing instead. Change-Id: Ic17fd4c7c4d229ea33d1d8859e9b8b453984e7dc Depends-On: I7987c5a4dbf50e97322a5b348c3cbd817b2672d6 --- tests/ansible-role-requirements.yml | 5 ++- tests/inventory | 3 ++ tests/os_barbican-overrides.yml | 27 ++++++++++++ tests/test-barbican-functional.yml | 68 ----------------------------- tests/test.yml | 4 +- 5 files changed, 36 insertions(+), 71 deletions(-) create mode 100644 tests/os_barbican-overrides.yml delete mode 100644 tests/test-barbican-functional.yml diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index fc70148..075d762 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -42,4 +42,7 @@ src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts scm: git version: master - +- name: os_tempest + src: https://git.openstack.org/openstack/openstack-ansible-os_tempest + scm: git + version: master diff --git a/tests/inventory b/tests/inventory index af4326f..3b40774 100644 --- a/tests/inventory +++ b/tests/inventory @@ -31,3 +31,6 @@ barbican1 [barbican_all:children] barbican_api + +[utility_all] +infra1 diff --git a/tests/os_barbican-overrides.yml b/tests/os_barbican-overrides.yml new file mode 100644 index 0000000..f60713e --- /dev/null +++ b/tests/os_barbican-overrides.yml @@ -0,0 +1,27 @@ +--- +# 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. + +tempest_run: yes + +tempest_plugins: + - name: barbican-tempest-plugin + repo: https://git.openstack.org/openstack/barbican-tempest-plugin + branch: master + +tempest_test_whitelist: + - barbican_tempest_plugin.tests.api + +tempest_roles: + - key-manager:service-admin diff --git a/tests/test-barbican-functional.yml b/tests/test-barbican-functional.yml deleted file mode 100644 index 2d205e2..0000000 --- a/tests/test-barbican-functional.yml +++ /dev/null @@ -1,68 +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. - -- name: Playbook for functional testing of barbican - hosts: barbican_api - user: root - roles: - - openstack_openrc - post_tasks: - # Packages need to be installed outside - # of venv to be usable by Ansible - - name: Install testing pip packages - pip: - name: "{{ item }}" - state: present - extra_args: >- - {{ barbican_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ pip_install_options | default('') }} - with_items: - - httplib2 - - python-barbicanclient - - python-openstackclient - - - name: Check the barbican api - uri: - url: "http://localhost:9311" - status_code: 200,300 - - - name: Create a test secret - shell: | - . /root/openrc - openstack secret store --payload secrete --payload-content-type text/plain - register: barbican_secret_store - tags: - - skip_ansible_lint - - - name: Register secret location - set_fact: - secret_ref: "{{ item.split('|')[2] }}" - with_items: "{{ barbican_secret_store.stdout_lines }}" - when: item.find('Secret href') != -1 - - - name: Retrieve test secret - shell: | - . /root/openrc - openstack secret get --decrypt --payload_content_type text/plain {{ secret_ref }} - register: barbican_secret_store - tags: - - skip_ansible_lint - - - name: Check retrieved secret - assert: - that: barbican_secret_store.stdout.find('secrete') != -1 - vars_files: - - common/test-vars.yml - - test-vars.yml diff --git a/tests/test.yml b/tests/test.yml index cc8d35d..ffed9ba 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -28,5 +28,5 @@ # Install Barbican - include: test-install-barbican.yml -# Test Barbican -- include: test-barbican-functional.yml +# Install Tempest +- include: common/test-install-tempest.yml