Functional testing for the role gate
Simple REST API based functional testing for trove will now be run during the gate. Change-Id: Ie8621ebc756a82cb47cef73172881848454dba7e Closes-Bug: #1624520
This commit is contained in:
parent
c588ac18fd
commit
767682b6f4
@ -30,4 +30,4 @@ export ANSIBLE_SSH_ARGS="-o ControlMaster=no \
|
|||||||
-o ForwardAgent=yes"
|
-o ForwardAgent=yes"
|
||||||
|
|
||||||
echo "Run manual functional tests by executing the following:"
|
echo "Run manual functional tests by executing the following:"
|
||||||
echo "# ./.tox/functional/bin/ansible-playbook -i tests/inventory tests/test.yml -e \"rolename=$(pwd)\""
|
echo "# ./.tox/functional/bin/ansible-playbook -i tests/inventory tests/test.yml"
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
src: https://git.openstack.org/openstack/openstack-ansible-lxc_container_create
|
src: https://git.openstack.org/openstack/openstack-ansible-lxc_container_create
|
||||||
scm: git
|
scm: git
|
||||||
version: master
|
version: master
|
||||||
|
- name: memcached_server
|
||||||
|
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
|
||||||
|
scm: git
|
||||||
|
version: master
|
||||||
- name: galera_client
|
- name: galera_client
|
||||||
src: https://git.openstack.org/openstack/openstack-ansible-galera_client
|
src: https://git.openstack.org/openstack/openstack-ansible-galera_client
|
||||||
scm: git
|
scm: git
|
||||||
@ -34,11 +38,15 @@
|
|||||||
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
|
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
|
||||||
scm: git
|
scm: git
|
||||||
version: master
|
version: master
|
||||||
- name: os_keystone
|
|
||||||
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
|
|
||||||
scm: git
|
|
||||||
version: master
|
|
||||||
- name: openstack_openrc
|
- name: openstack_openrc
|
||||||
src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
|
src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
|
||||||
scm: git
|
scm: git
|
||||||
version: master
|
version: master
|
||||||
|
- name: os_keystone
|
||||||
|
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
|
||||||
|
scm: git
|
||||||
|
version: master
|
||||||
|
- name: openstack_hosts
|
||||||
|
src: https://github.com/openstack/openstack-ansible-openstack_hosts
|
||||||
|
scm: git
|
||||||
|
version: master
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
when: inventory_hostname == groups['trove_all'][0]
|
when: inventory_hostname == groups['trove_all'][0]
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: "{{ rolename | basename }}"
|
- role: "os_trove"
|
||||||
vars_files:
|
vars_files:
|
||||||
- playbooks/test-vars.yml
|
- playbooks/test-vars.yml
|
||||||
- test-vars.yml
|
- test-vars.yml
|
||||||
|
51
tests/test-trove-functional.yml
Normal file
51
tests/test-trove-functional.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2016 Internet Solutions (Pty) Ltd
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
|
||||||
|
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>
|
||||||
|
# Reference: http://developer.openstack.org/api-ref-database-v1.html
|
||||||
|
|
||||||
|
- name: Playbook for functional testing of trove
|
||||||
|
hosts: trove_all
|
||||||
|
user: root
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
trove_api: "http://localhost:{{ trove_service_port }}"
|
||||||
|
tasks:
|
||||||
|
- name: Install openstackclient
|
||||||
|
pip:
|
||||||
|
name: "python-openstackclient"
|
||||||
|
|
||||||
|
- name: Check the trove-api
|
||||||
|
uri:
|
||||||
|
url: "{{ trove_api }}"
|
||||||
|
status_code: 200,300
|
||||||
|
|
||||||
|
- name: Validate that auth is required
|
||||||
|
uri:
|
||||||
|
url: "{{ trove_api }}/v1.0/status"
|
||||||
|
status_code: 401
|
||||||
|
|
||||||
|
- name: Get auth token
|
||||||
|
shell: >
|
||||||
|
. /root/openrc && openstack token issue --format yaml | awk '/^id\:/ {print $2}'
|
||||||
|
register: get_keystone_token
|
||||||
|
|
||||||
|
- name: set token
|
||||||
|
set_fact:
|
||||||
|
keystone_token: "{{ get_keystone_token.stdout }}"
|
||||||
|
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
@ -34,11 +34,10 @@ trove_service_project_name: service
|
|||||||
trove_service_region: RegionOne
|
trove_service_region: RegionOne
|
||||||
trove_service_user_domain_id: default
|
trove_service_user_domain_id: default
|
||||||
trove_service_user_name: trove
|
trove_service_user_name: trove
|
||||||
|
trove_service_port: 8779
|
||||||
|
trove_venv_tag: untagged
|
||||||
trove_bin: "/openstack/venvs/trove-{{ trove_venv_tag }}/bin"
|
trove_bin: "/openstack/venvs/trove-{{ trove_venv_tag }}/bin"
|
||||||
trove_venv_tag: "testing"
|
|
||||||
|
|
||||||
neutron_service_port: 9696
|
neutron_service_port: 9696
|
||||||
swift_proxy_port: 8080
|
swift_proxy_port: 8080
|
||||||
cinder_service_port: 8776
|
cinder_service_port: 8776
|
||||||
nova_service_port: 8774
|
nova_service_port: 8774
|
||||||
|
|
||||||
|
@ -27,3 +27,6 @@
|
|||||||
|
|
||||||
# Install trove
|
# Install trove
|
||||||
- include: test-install-trove.yml
|
- include: test-install-trove.yml
|
||||||
|
|
||||||
|
# Test trove
|
||||||
|
- include: test-trove-functional.yml
|
||||||
|
3
tox.ini
3
tox.ini
@ -22,7 +22,6 @@ passenv =
|
|||||||
NO_PROXY
|
NO_PROXY
|
||||||
whitelist_externals =
|
whitelist_externals =
|
||||||
bash
|
bash
|
||||||
echo
|
|
||||||
git
|
git
|
||||||
rm
|
rm
|
||||||
wget
|
wget
|
||||||
@ -140,7 +139,6 @@ commands =
|
|||||||
ansible-playbook -i {toxinidir}/tests/inventory \
|
ansible-playbook -i {toxinidir}/tests/inventory \
|
||||||
--syntax-check \
|
--syntax-check \
|
||||||
--list-tasks \
|
--list-tasks \
|
||||||
-e "rolename={toxinidir}" \
|
|
||||||
{toxinidir}/tests/test.yml
|
{toxinidir}/tests/test.yml
|
||||||
|
|
||||||
|
|
||||||
@ -186,7 +184,6 @@ setenv =
|
|||||||
commands =
|
commands =
|
||||||
{[testenv:ansible]commands}
|
{[testenv:ansible]commands}
|
||||||
ansible-playbook -i {toxinidir}/tests/inventory \
|
ansible-playbook -i {toxinidir}/tests/inventory \
|
||||||
-e "rolename={toxinidir}" \
|
|
||||||
-e "install_test_packages=True" \
|
-e "install_test_packages=True" \
|
||||||
{toxinidir}/tests/test.yml -vvvv
|
{toxinidir}/tests/test.yml -vvvv
|
||||||
{[testenv:func_logs]commands}
|
{[testenv:func_logs]commands}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user