Test sahara with tempest

This change adds functional tests to the sahara role. It install tempest
and and then runs the data processing scenario tests.

Change-Id: Ie6e606fb2e624fdad57cd06b8ea8a8d8773bf243
Depends-On: I8abc5c567e0d3e5829b9f7da8be5b0d0fc065ea7
This commit is contained in:
Flávio Ramalho 2016-06-05 17:25:34 -03:00
parent 8aec726d90
commit 45afc91aaf
13 changed files with 300 additions and 68 deletions

View File

@ -2,4 +2,3 @@
host=review.openstack.org
port=29418
project=openstack/openstack-ansible-os_sahara.git
defaultbranch=stable/mitaka

4
Vagrantfile vendored
View File

@ -1,7 +1,7 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.memory = 4096
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
@ -10,4 +10,4 @@ Vagrant.configure(2) do |config|
apt-get update
./run_tests.sh
SHELL
end
end

View File

@ -14,3 +14,13 @@
# TODO(odyssey4me) remove this once https://review.openstack.org/288634 has merged
# and the disk images are rebuilt and redeployed.
curl
wget
# Requirements for Paramiko 2.0
libssl-dev [platform:dpkg]
libffi-dev [platform:dpkg]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
# For selinux
libselinux-python [platform:rpm]

View File

@ -1,6 +0,0 @@
=============================
Mitaka Series Release Notes
=============================
.. release-notes::
:branch: origin/stable/mitaka

View File

@ -14,10 +14,6 @@
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
scm: git
version: origin/stable/mitaka
- name: py_from_git
src: https://git.openstack.org/openstack/openstack-ansible-py_from_git
scm: git
version: origin/stable/mitaka
- name: lxc_hosts
src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts
scm: git
@ -46,7 +42,15 @@
src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
scm: git
version: origin/stable/mitaka
- name: os_nova
src: https://git.openstack.org/openstack/openstack-ansible-os_nova
scm: git
version: origin/stable/mitaka
- name: openstack_openrc
src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
scm: git
version: origin/stable/mitaka
- name: os_tempest
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
scm: git
version: master

View File

@ -17,6 +17,24 @@ infra1
rabbitmq_all
galera_all
[nova_api_metadata]
[nova_api_os_compute]
openstack1
[nova_cert]
[nova_compute]
[nova_conductor]
[nova_console]
[nova_scheduler]
[nova_all:children]
nova_api_os_compute
[keystone_all]
openstack1

113
tests/test-install-nova.yml Normal file
View File

@ -0,0 +1,113 @@
---
# Copyright 2015, 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 deploying nova
hosts: nova_all
user: root
gather_facts: true
pre_tasks:
# NOTE: These are typically installed in the repo server where we build the
# nova wheel
- name: Install packages required to build nova python package
apt:
name: "{{ item }}"
with_items:
- libxml2-dev
- libxslt-dev
- libffi-dev
- pkg-config
- libvirt-dev
when: inventory_hostname in groups['nova_all']
- name: Ensure rabbitmq vhost
rabbitmq_vhost:
name: "{{ nova_rabbitmq_vhost }}"
state: "present"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['nova_all'][0]
tags:
- nova-rabbitmq
- nova-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ nova_rabbitmq_userid }}"
password: "{{ nova_rabbitmq_password }}"
vhost: "{{ nova_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['nova_all'][0]
tags:
- nova-rabbitmq
- nova-rabbitmq-user
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ nova_galera_address }}"
name: "{{ nova_galera_database }}"
state: "present"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['nova_all'][0]
tags:
- mysql-db-setup
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ nova_galera_address }}"
name: "{{ nova_galera_database }}"
password: "{{ nova_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ nova_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['nova_all'][0]
tags:
- mysql-db-setup
- name: Create API DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ nova_api_galera_address }}"
name: "{{ nova_api_galera_database }}"
state: "present"
when: inventory_hostname == groups['nova_all'][0]
tags:
- nova-db-setup
- name: Grant access to the API DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ nova_api_galera_address }}"
name: "{{ nova_api_galera_user }}"
password: "{{ nova_api_container_mysql_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ nova_api_galera_database }}.*:ALL"
with_items:
- "localhost"
- "%"
when: inventory_hostname == groups['nova_all'][0]
tags:
- nova-db-setup
roles:
- role: os_nova
vars_files:
- test-vars.yml

View File

@ -25,7 +25,7 @@
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ sahara_rabbitmq_userid }}"
password: "{{ e_rabbitmq_password }}"
password: "{{ sahara_rabbitmq_password }}"
vhost: "{{ sahara_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
@ -59,7 +59,5 @@
when: inventory_hostname == groups['sahara_all'][0]
roles:
- role: "{{ rolename | basename }}"
post_tasks:
- include: test-sahara-functional.yml
vars_files:
- test-vars.yml

View File

@ -0,0 +1,23 @@
---
# Copyright 2015, 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 deploying tempest
hosts: sahara_all
user: root
gather_facts: true
roles:
- role: "os_tempest"
vars_files:
- test-vars.yml

View File

@ -11,17 +11,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Packages need to be installed outside
# of venv to be usable by Ansible
- name: Install testing pip packages
pip:
name: "{{ item }}"
with_items:
- python-saharaclient
- python-keystoneclient
- httplib2
- name: Check the sahara-api
uri:
url: "http://localhost:8386"
status_code: 300
- name: Playbook for functional testing of sahara
hosts: sahara_all
user: root
gather_facts: false
tasks:
- name: Run tempest
shell: |
. {{ tempest_venv_bin }}/activate
{{ tempest_venv_bin | dirname }}/run_tempest.sh --no-virtual-env ${RUN_TEMPEST_OPTS} data_processing
environment:
RUN_TEMPEST_OPTS: "--serial"
vars_files:
- test-vars.yml

View File

@ -13,50 +13,111 @@
# See the License for the specific language governing permissions and
# limitations under the License.
debug: True
external_lb_vip_address: 10.100.100.3
internal_lb_vip_address: 10.100.100.3
galera_client_drop_config_file: false
galera_root_user: root
galera_root_password: "secrete"
sahara_container_mysql_password: "SuperSecrete"
rabbitmq_servers: 10.100.100.2
rabbitmq_use_ssl: False
rabbitmq_port: 5672
memcached_servers: 127.0.0.1
memcached_encryption_key: "secrete"
glance_host: "{{ internal_lb_vip_address }}"
glance_service_port: 9292
cinder_backends_rbd_inuse: false
cinder_ceph_client: cinder
neutron_service_adminurl: http://{{ internal_lb_vip_address }}:9696
neutron_service_password: "secrete"
neutron_service_project_name: service
neutron_service_region: RegionOne
neutron_service_user_name: neutron
nova_api_container_mysql_password: "SuperSecrete"
nova_api_galera_address: 10.100.100.2
nova_api_galera_database: nova_api
nova_api_galera_user: nova_api
nova_container_mysql_password: "SuperSecrete"
nova_developer_mode: true
nova_galera_address: 10.100.100.2
nova_galera_database: nova
nova_git_install_branch: stable/mitaka
nova_keystone_auth_plugin: password
nova_management_address: "10.100.100.3"
nova_metadata_port: 8775
nova_metadata_proxy_secret: "secrete"
nova_novncproxy_vncserver_listen: localhost
nova_novncproxy_vncserver_proxyclient_address: localhost
nova_rabbitmq_password: "secrete"
nova_rabbitmq_userid: nova
nova_rabbitmq_vhost: /nova
nova_requirements_git_install_branch: stable/mitaka
nova_service_adminurl: "http://{{ internal_lb_vip_address }}:8774"
nova_service_password: "secrete"
nova_service_project_domain_id: default
nova_service_project_name: service
nova_service_region: RegionOne
nova_service_user_domain_id: default
nova_service_user_name: nova
nova_venv_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin"
nova_venv_tag: "testing"
nova_virt_type: qemu
keystone_venv_tag: "testing"
keystone_developer_mode: true
keystone_git_install_branch: stable/mitaka
keystone_service_password: "secrete"
keystone_galera_address: 10.100.100.2
keystone_galera_database: keystone
keystone_galera_user: keystone
keystone_container_mysql_password: "SuperSecrete"
keystone_auth_admin_token: "SuperSecreteTestToken"
keystone_admin_user_name: admin
keystone_admin_tenant_name: admin
keystone_auth_admin_password: "SuperSecretePassword"
keystone_service_adminuri_insecure: True
keystone_service_internaluri_insecure: True
keystone_service_internaluri: "http://{{ internal_lb_vip_address }}:5000"
keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3"
keystone_service_adminuri: "http://{{ internal_lb_vip_address }}:35357"
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
keystone_rabbitmq_vhost: /keystone
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_password: "secrete"
keystone_rabbitmq_use_ssl: false
keystone_rabbitmq_port: 5672
keystone_rabbitmq_servers: 10.100.100.2
keystone_requirements_git_install_branch: stable/mitaka
openrc_os_auth_url: "{{ keystone_service_internalurl }}"
openrc_os_password: "{{ keystone_auth_admin_password }}"
openrc_os_domain_name: "Default"
sahara_venv_tag: "testing"
sahara_developer_mode: true
sahara_git_install_branch: stable/mitaka
sahara_requirements_git_install_branch: stable/mitaka
sahara_service_password: "secrete"
sahara_galera_address: 10.100.100.2
sahara_galera_database: sahara
sahara_git_install_branch: stable/mitaka
sahara_profiler_hmac_key: "secrete"
sahara_galera_user: sahara
sahara_container_mysql_password: "SuperSecrete"
sahara_rabbitmq_password: "secrete"
sahara_rabbitmq_userid: sahara
sahara_rabbitmq_vhost: /sahara
sahara_requirements_git_install_branch: stable/mitaka
sahara_service_password: "secrete"
sahara_venv_tag: "testing"
internal_lb_vip_address: 10.100.100.3
keystone_admin_tenant_name: admin
keystone_admin_user_name: admin
keystone_auth_admin_password: "SuperSecretePassword"
keystone_container_mysql_password: "SuperSecrete"
keystone_developer_mode: true
keystone_galera_address: 10.100.100.2
keystone_galera_database: keystone
keystone_git_install_branch: stable/mitaka
keystone_rabbitmq_password: "secrete"
keystone_rabbitmq_port: 5671
keystone_rabbitmq_servers: 10.100.100.2
keystone_rabbitmq_use_ssl: true
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone
keystone_requirements_git_install_branch: stable/mitaka
keystone_service_adminuri: "http://{{ internal_lb_vip_address }}:35357"
keystone_service_adminuri_insecure: false
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
keystone_service_internaluri: "http://{{ internal_lb_vip_address }}:5000"
keystone_service_internaluri_insecure: false
keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3"
keystone_service_password: "secrete"
keystone_venv_tag: "testing"
memcached_encryption_key: "secrete"
memcached_servers: 127.0.0.1
openrc_os_auth_url: "http://127.0.0.1:5000/v3"
openrc_os_domain_name: "Default"
openrc_os_password: "{{ keystone_auth_admin_password }}"
rabbitmq_port: 5671
rabbitmq_servers: 10.100.100.2
rabbitmq_use_ssl: true
sahara_venv_bin: "/openstack/venvs/sahara-{{ sahara_venv_tag }}/bin"
tempest_developer_mode: True
tempest_git_install_branch: master
tempest_venv_tag: "{{ tempest_git_install_branch }}"
# tempest_venv_bin is the same as the default in os_tempest role, but we set
# it again here so we can refer to it in test-sahara-functional.yml
tempest_venv_bin: "/opt/tempest_{{ tempest_venv_tag }}/bin"
tempest_log_dir: "/var/log/"
tempest_main_group: sahara_all
tempest_service_available_aodh: False
tempest_service_available_ceilometer: False
tempest_service_available_cinder: False
tempest_service_available_glance: False
tempest_service_available_heat: False
tempest_service_available_horizon: False
tempest_service_available_neutron: False
tempest_service_available_nova: True
tempest_service_available_sahara: True
tempest_service_available_swift: False

View File

@ -28,5 +28,14 @@
# Install Keystone
- include: test-install-keystone.yml
# Install Nova
- include: test-install-nova.yml
# Install Sahara
- include: test-install-sahara.yml
# Install Tempest
- include: test-install-tempest.yml
# Test Sahara
- include: test-sahara-functional.yml

View File

@ -15,6 +15,7 @@ whitelist_externals =
bash
git
rm
wget
setenv =
VIRTUAL_ENV={envdir}
ANSIBLE_HOST_KEY_CHECKING = False
@ -108,6 +109,9 @@ commands =
rm -rf {homedir}/.ansible
git clone https://git.openstack.org/openstack/openstack-ansible-plugins \
{homedir}/.ansible/plugins
# This plugin makes the ansible-playbook output easier to read
wget -O {homedir}/.ansible/plugins/callback/human_log.py \
https://gist.githubusercontent.com/cliffano/9868180/raw/f360f306b3c6d689734a6aa8773a00edf16a0054/human_log.py
ansible-galaxy install \
--role-file={toxinidir}/tests/ansible-role-requirements.yml \
--ignore-errors \