Using updated tempest method for trove api.

Change-Id: I3e8498db924ef095078e56bbedb8fbd587f4986c
This commit is contained in:
Donovan Francesco (drifterza) 2016-11-17 10:43:04 +02:00
parent 88aa21d43a
commit b9babfe3f4
8 changed files with 32 additions and 116 deletions

7
.gitignore vendored
View File

@ -61,11 +61,8 @@ ChangeLog
releasenotes/build
# Test temp files
tests/plugins
tests/playbooks
tests/test.retry
tests/common
tests/*.retry
# Vagrant artifacts
.vagrant

View File

@ -72,6 +72,7 @@ trove_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/trove.tgz
trove_git_repo: "https://git.openstack.org/openstack/trove"
trove_git_install_branch: master
trove_developer_mode: false
trove_developer_constraints:
- "git+{{ trove_git_repo }}@{{ trove_git_install_branch }}#egg=trove"
@ -133,8 +134,6 @@ trove_requires_pip_packages:
- httplib2
- python-glanceclient
- python-keystoneclient
- python-memcached
- python-troveclient
- virtualenv
- virtualenv-tools
@ -144,6 +143,8 @@ trove_pip_packages:
- pexpect
- pycrypto
- trove
- python-troveclient
- python-memcached
# This variable is used by the repo_build process to determine
# which host group to check for members of before building the

View File

@ -46,3 +46,7 @@
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
scm: git
version: master
- name: os_tempest
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
scm: git
version: master

View File

@ -16,6 +16,9 @@ infra1
[memcached_all]
infra1
[utility_all]
openstack1
[service_all:children]
rabbitmq_all
galera_all

View File

@ -37,9 +37,19 @@ trove_service_region: RegionOne
trove_service_user_domain_id: default
trove_service_user_name: trove
trove_service_port: 8779
trove_venv_tag: untagged
trove_venv_tag: "untagged"
trove_bin: "/openstack/venvs/trove-{{ trove_venv_tag }}/bin"
neutron_service_port: 9696
swift_proxy_port: 8080
cinder_service_port: 8776
nova_service_port: 8774
tempest_run: yes
tempest_plugins:
- name: trove
repo: https://git.openstack.org/openstack/trove
branch: master
tempest_test_whitelist:
- trove.tests.tempest.tests.api.database.versions.*

View File

@ -21,62 +21,14 @@
user: root
gather_facts: true
pre_tasks:
# NOTE: These are typically installed in the repo server where we build the
# trove wheel
- name: Install packages required to build trove python package
apt:
name: "{{ item }}"
with_items:
- libxml2-dev
- libxslt-dev
- libffi-dev
- pkg-config
- libvirt-dev
when: inventory_hostname in groups['trove_all']
- name: Ensure rabbitmq vhost
rabbitmq_vhost:
name: "{{ trove_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
when: inventory_hostname == groups['trove_all'][0]
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ trove_rabbitmq_userid }}"
password: "{{ trove_rabbitmq_password }}"
vhost: "{{ trove_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
when: inventory_hostname == groups['trove_all'][0]
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ trove_galera_address }}"
name: "{{ trove_galera_database_name }}"
state: "present"
delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
when: inventory_hostname == groups['trove_all'][0]
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ trove_galera_address }}"
name: "{{ trove_galera_database_name }}"
password: "{{ trove_galera_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ trove_galera_database_name }}.*:ALL"
with_items:
- "localhost"
- "%"
delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
when: inventory_hostname == groups['trove_all'][0]
- include: common/create-grant-db.yml
db_name: "{{ trove_galera_database_name }}"
db_password: "{{ trove_galera_password }}"
- include: common/ensure-rabbitmq.yml
vhost_name: "{{ trove_rabbitmq_vhost }}"
user_name: "{{ trove_rabbitmq_userid }}"
user_password: "{{ trove_rabbitmq_password }}"
roles:
- role: "os_trove"
vars_files:
- common/test-vars.yml
- test-vars.yml

View File

@ -1,51 +0,0 @@
---
# 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

@ -28,5 +28,5 @@
# Install trove
- include: test-install-trove.yml
# Test trove
- include: test-trove-functional.yml
# Install and execute Tempest
- include: common/test-install-tempest.yml