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:
Donovan Francesco (drifterza) 2016-09-22 20:32:09 +02:00
parent c588ac18fd
commit 767682b6f4
7 changed files with 70 additions and 12 deletions

View File

@ -30,4 +30,4 @@ export ANSIBLE_SSH_ARGS="-o ControlMaster=no \
-o ForwardAgent=yes"
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"

View File

@ -22,6 +22,10 @@
src: https://git.openstack.org/openstack/openstack-ansible-lxc_container_create
scm: git
version: master
- name: memcached_server
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
scm: git
version: master
- name: galera_client
src: https://git.openstack.org/openstack/openstack-ansible-galera_client
scm: git
@ -34,11 +38,15 @@
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
scm: git
version: master
- name: os_keystone
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
scm: git
version: master
- name: openstack_openrc
src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
scm: git
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

View File

@ -76,7 +76,7 @@
when: inventory_hostname == groups['trove_all'][0]
roles:
- role: "{{ rolename | basename }}"
- role: "os_trove"
vars_files:
- playbooks/test-vars.yml
- test-vars.yml

View 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

View File

@ -34,11 +34,10 @@ trove_service_project_name: service
trove_service_region: RegionOne
trove_service_user_domain_id: default
trove_service_user_name: trove
trove_service_port: 8779
trove_venv_tag: untagged
trove_bin: "/openstack/venvs/trove-{{ trove_venv_tag }}/bin"
trove_venv_tag: "testing"
neutron_service_port: 9696
swift_proxy_port: 8080
cinder_service_port: 8776
nova_service_port: 8774

View File

@ -27,3 +27,6 @@
# Install trove
- include: test-install-trove.yml
# Test trove
- include: test-trove-functional.yml

View File

@ -22,7 +22,6 @@ passenv =
NO_PROXY
whitelist_externals =
bash
echo
git
rm
wget
@ -140,7 +139,6 @@ commands =
ansible-playbook -i {toxinidir}/tests/inventory \
--syntax-check \
--list-tasks \
-e "rolename={toxinidir}" \
{toxinidir}/tests/test.yml
@ -186,7 +184,6 @@ setenv =
commands =
{[testenv:ansible]commands}
ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
{toxinidir}/tests/test.yml -vvvv
{[testenv:func_logs]commands}