Adding simple functional testing for the role

Previously only role convergence was tested.

This patch paves the way to have functional testing support
the addition of Xenial support as well as adding more
thorough functional testing using the Tempest plugin
available in the zaqar source.

Change-Id: I593fe5e61df2daca0857548394e04aa2afa35499
This commit is contained in:
Travis Truman 2016-07-21 17:58:56 -04:00
parent 6dedbe271c
commit 35cde17905
8 changed files with 46 additions and 10 deletions

View File

@ -39,6 +39,8 @@
retries: 5
delay: 2
with_items: "{{ zaqar_apt_packages }}"
when:
- item != ''
tags:
- zaqar-apt-packages

View File

@ -25,12 +25,15 @@
tags:
- zaqar-httpd
- name: Add zaqar apache configuration file
- name: Add zaqar apache configuration files
template:
src: "zaqar-httpd.conf.j2"
dest: "/etc/apache2/sites-available/zaqar-httpd.conf"
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "root"
group: "root"
with_items:
- { src: "zaqar_apache_ports.conf.j2", dest: "/etc/apache2/ports.conf" }
- { src: "zaqar-httpd.conf.j2", dest: "/etc/apache2/sites-available/zaqar-httpd.conf" }
notify:
- Restart Apache
tags:

View File

@ -1,7 +1,5 @@
# {{ ansible_managed }}
Listen {{ zaqar_api_bind_port }}
<VirtualHost *:{{ zaqar_api_bind_port }}>
WSGIDaemonProcess zaqar-api user={{ zaqar_system_user_name }} group={{ zaqar_system_group_name }} processes={{ zaqar_wsgi_processes }} threads={{ zaqar_wsgi_threads }} display-name=%{GROUP}
WSGIProcessGroup zaqar-api

View File

@ -0,0 +1,3 @@
# {{ ansible_managed }}
Listen {{ zaqar_api_bind_port }}

View File

@ -19,7 +19,7 @@
roles:
- role: "{{ rolename | basename }}"
zaqar_developer_mode: true
zaqar_install_nginx: true
zaqar_install_apache: true
zaqar_mgmt_db_connection_string: 'sqlite:////tmp/zaqar.db'
external_lb_vip_address: 10.100.100.2
internal_lb_vip_address: 10.100.100.2

View File

@ -0,0 +1,27 @@
---
# 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 functional testing of zaqar
hosts: zaqar_all
user: root
gather_facts: false
tasks:
- name: Install testing pip packages
pip:
name: "httplib2"
- name: Check the zaqar-api
uri:
url: "http://localhost:8888"
status_code: 401

View File

@ -29,4 +29,7 @@
- include: test-install-keystone.yml
# Install Zaqar
- include: test-install-zaqar.yml
- include: test-install-zaqar.yml
# Test Zaqar
- include: test-zaqar-functional.yml

View File

@ -23,6 +23,6 @@ zaqar_apt_packages:
- python2.7-dev
- python-dev
- zlib1g-dev
- apache2
- nginx
- libapache2-mod-wsgi
- "{% if zaqar_install_apache %}apache2{% endif %}"
- "{% if zaqar_install_apache %}libapache2-mod-wsgi{% endif %}"
- "{% if zaqar_install_nginx %}nginx{% endif %}"