Merge "Functional testing for os_rally role"
This commit is contained in:
commit
58ababd57d
@ -23,6 +23,6 @@
|
|||||||
- name: Create/upgrade Rally DB schema
|
- name: Create/upgrade Rally DB schema
|
||||||
command: "{{ rally_bin }}/rally-manage db create"
|
command: "{{ rally_bin }}/rally-manage db create"
|
||||||
when:
|
when:
|
||||||
- rally_deployment_list_result.stderr | search("Table 'rally.deployments' doesn't exist")
|
- rally_deployment_list_result.stdout | search("Table 'rally.deployments' doesn't exist")
|
||||||
tags:
|
tags:
|
||||||
- rally-db-setup
|
- rally-db-setup
|
12
tests/files/scenario.json
Normal file
12
tests/files/scenario.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"KeystoneBasic.create_delete_user": [
|
||||||
|
{
|
||||||
|
"args": {},
|
||||||
|
"runner": {
|
||||||
|
"type": "constant",
|
||||||
|
"times": 10,
|
||||||
|
"concurrency": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
27
tests/group_vars/all_containers.yml
Normal file
27
tests/group_vars/all_containers.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2016, 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.
|
||||||
|
|
||||||
|
ansible_ssh_host: "{{ ansible_host }}"
|
||||||
|
container_name: "{{ inventory_hostname }}"
|
||||||
|
container_networks:
|
||||||
|
management_address:
|
||||||
|
address: "{{ ansible_host }}"
|
||||||
|
bridge: "lxcbr0"
|
||||||
|
interface: "eth1"
|
||||||
|
netmask: "255.255.252.0"
|
||||||
|
type: "veth"
|
||||||
|
physical_host: localhost
|
||||||
|
properties:
|
||||||
|
service_name: "{{ inventory_hostname }}"
|
@ -1,2 +1,24 @@
|
|||||||
[all]
|
[all]
|
||||||
localhost ansible_connection=local ansible_become=True
|
localhost ansible_connection=local ansible_become=True
|
||||||
|
infra1 ansible_ssh_host=10.100.100.2 ansible_host=10.100.100.2 ansible_become=True ansible_user=root
|
||||||
|
openstack1 ansible_ssh_host=10.100.100.3 ansible_host=10.100.100.3 ansible_become=True ansible_user=root
|
||||||
|
|
||||||
|
[all_containers]
|
||||||
|
infra1
|
||||||
|
openstack1
|
||||||
|
|
||||||
|
[rabbitmq_all]
|
||||||
|
infra1
|
||||||
|
|
||||||
|
[galera_all]
|
||||||
|
infra1
|
||||||
|
|
||||||
|
[service_all:children]
|
||||||
|
rabbitmq_all
|
||||||
|
galera_all
|
||||||
|
|
||||||
|
[keystone_all]
|
||||||
|
infra1
|
||||||
|
|
||||||
|
[rally_all]
|
||||||
|
openstack1
|
35
tests/test-functional-rally.yml
Normal file
35
tests/test-functional-rally.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2016, Comcast Corporation
|
||||||
|
#
|
||||||
|
# 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: Run a Rally scenario to ensure proper install/config
|
||||||
|
hosts: rally_all
|
||||||
|
user: root
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: Create the deployment
|
||||||
|
shell: |
|
||||||
|
. /root/openrc
|
||||||
|
. {{ rally_bin }}/activate
|
||||||
|
{{ rally_bin }}/rally deployment create --fromenv --name=existing
|
||||||
|
- name: Copy the rally scenario
|
||||||
|
copy:
|
||||||
|
src: "{{ playbook_dir }}/files/scenario.json"
|
||||||
|
dest: "/var/tmp/scenario.json"
|
||||||
|
- name: Run the rally scenario
|
||||||
|
shell: |
|
||||||
|
. {{ rally_bin }}/activate
|
||||||
|
{{ rally_bin }}/rally task start /var/tmp/scenario.json
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Deploy infra services
|
- name: Deploy infra services
|
||||||
hosts: galera_all
|
hosts: service_all
|
||||||
user: root
|
user: root
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
roles:
|
roles:
|
||||||
|
@ -61,21 +61,5 @@
|
|||||||
when: inventory_hostname == groups['keystone_all'][0]
|
when: inventory_hostname == groups['keystone_all'][0]
|
||||||
roles:
|
roles:
|
||||||
- role: os_keystone
|
- role: os_keystone
|
||||||
vars:
|
vars_files:
|
||||||
external_lb_vip_address: 10.100.100.2
|
- test-vars.yml
|
||||||
internal_lb_vip_address: 10.100.100.2
|
|
||||||
keystone_galera_address: 10.100.100.2
|
|
||||||
keystone_galera_database: keystone
|
|
||||||
keystone_venv_tag: testing
|
|
||||||
keystone_developer_mode: true
|
|
||||||
keystone_auth_admin_token: SuperSecreteTestToken
|
|
||||||
keystone_auth_admin_password: SuperSecretePassword
|
|
||||||
keystone_service_password: secrete
|
|
||||||
keystone_rabbitmq_password: secrete
|
|
||||||
keystone_container_mysql_password: SuperSecrete
|
|
||||||
keystone_rabbitmq_port: 5671
|
|
||||||
keystone_rabbitmq_userid: keystone
|
|
||||||
keystone_rabbitmq_vhost: /keystone
|
|
||||||
keystone_rabbitmq_servers: 10.100.100.2
|
|
||||||
keystone_rabbitmq_use_ssl: false
|
|
||||||
galera_client_drop_config_file: false
|
|
||||||
|
@ -44,28 +44,5 @@
|
|||||||
when: inventory_hostname == groups['rally_all'][0]
|
when: inventory_hostname == groups['rally_all'][0]
|
||||||
roles:
|
roles:
|
||||||
- role: "{{ rolename | basename }}"
|
- role: "{{ rolename | basename }}"
|
||||||
# post_tasks:
|
vars_files:
|
||||||
# - include: test-rally-functional.yml
|
- test-vars.yml
|
||||||
vars:
|
|
||||||
rally_galera_address: 10.100.100.2
|
|
||||||
rally_galera_database: rally
|
|
||||||
rally_galera_password: "SuperSecrete"
|
|
||||||
galera_client_drop_config_file: false
|
|
||||||
galera_root_password: "secrete"
|
|
||||||
rally_venv_tag: "testing"
|
|
||||||
rally_developer_mode: true
|
|
||||||
external_lb_vip_address: 10.100.100.2
|
|
||||||
internal_lb_vip_address: 10.100.100.2
|
|
||||||
keystone_admin_user_name: admin
|
|
||||||
keystone_admin_tenant_name: admin
|
|
||||||
keystone_auth_admin_password: SuperSecretePassword
|
|
||||||
keystone_service_adminuri_insecure: false
|
|
||||||
keystone_service_internaluri_insecure: false
|
|
||||||
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_service_region: RegionOne
|
|
||||||
openrc_os_auth_url: "{{ keystone_service_internalurl }}"
|
|
||||||
openrc_os_password: "{{ keystone_auth_admin_password }}"
|
|
||||||
openrc_os_domain_name: Default
|
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
connection: local
|
connection: local
|
||||||
become: yes
|
become: yes
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
# Make sure OS does not have a stale package cache.
|
||||||
|
- name: Update apt cache
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
- name: Ensure root's new public ssh key is in authorized_keys
|
- name: Ensure root's new public ssh key is in authorized_keys
|
||||||
authorized_key:
|
authorized_key:
|
||||||
user: root
|
user: root
|
||||||
@ -41,28 +46,3 @@
|
|||||||
lxc_net_bridge: lxcbr0
|
lxc_net_bridge: lxcbr0
|
||||||
lxc_kernel_options:
|
lxc_kernel_options:
|
||||||
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
||||||
post_tasks:
|
|
||||||
# Inventory is being pre-loaded using a post tasks instead of through a dynamic
|
|
||||||
# inventory system. While this is not a usual method for deployment it's being
|
|
||||||
# done for functional testing.
|
|
||||||
- name: Create container hosts
|
|
||||||
add_host:
|
|
||||||
groups: "{{ item.groups }}"
|
|
||||||
hostname: "{{ item.name }}"
|
|
||||||
inventory_hostname: "{{ item.name }}"
|
|
||||||
ansible_ssh_host: "{{ item.address }}"
|
|
||||||
ansible_become: true
|
|
||||||
properties:
|
|
||||||
service_name: "{{ item.service }}"
|
|
||||||
container_networks:
|
|
||||||
management_address:
|
|
||||||
address: "{{ item.address }}"
|
|
||||||
bridge: "lxcbr0"
|
|
||||||
interface: "eth1"
|
|
||||||
netmask: "255.255.252.0"
|
|
||||||
type: "veth"
|
|
||||||
physical_host: localhost
|
|
||||||
container_name: "{{ item.name }}"
|
|
||||||
with_items:
|
|
||||||
- { name: "infra1", service: "infra1", address: "10.100.100.2", groups: "all,all_containers,rabbitmq_all,galera_all,keystone_all" }
|
|
||||||
- { name: "openstack1", service: "openstack1", address: "10.100.100.3", groups: "all,all_containers,rally_all" }
|
|
||||||
|
65
tests/test-vars.yml
Normal file
65
tests/test-vars.yml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2016, Comcast Corporation
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
internal_lb_vip_address: 10.100.100.2
|
||||||
|
external_lb_vip_address: 10.100.100.2
|
||||||
|
|
||||||
|
galera_client_drop_config_file: False
|
||||||
|
galera_root_password: "secrete"
|
||||||
|
galera_root_user: "root"
|
||||||
|
|
||||||
|
keystone_galera_address: "{{ internal_lb_vip_address }}"
|
||||||
|
keystone_galera_database: keystone
|
||||||
|
keystone_venv_tag: "testing"
|
||||||
|
keystone_developer_mode: True
|
||||||
|
keystone_git_install_branch: master
|
||||||
|
keystone_requirements_git_install_branch: master
|
||||||
|
keystone_admin_user_name: admin
|
||||||
|
keystone_admin_tenant_name: admin
|
||||||
|
keystone_auth_admin_token: "SuperSecreteTestToken"
|
||||||
|
keystone_auth_admin_password: "SuperSecretePassword"
|
||||||
|
keystone_service_password: "secrete"
|
||||||
|
keystone_rabbitmq_password: "secrete"
|
||||||
|
keystone_container_mysql_password: "SuperSecrete"
|
||||||
|
keystone_service_adminuri_insecure: False
|
||||||
|
keystone_service_internaluri_insecure: False
|
||||||
|
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_service_region: RegionOne
|
||||||
|
keystone_rabbitmq_port: 5672
|
||||||
|
keystone_rabbitmq_userid: keystone
|
||||||
|
keystone_rabbitmq_vhost: /keystone
|
||||||
|
keystone_rabbitmq_servers: "{{ internal_lb_vip_address }}"
|
||||||
|
keystone_rabbitmq_use_ssl: False
|
||||||
|
|
||||||
|
rabbitmq_servers: "{{ internal_lb_vip_address }}"
|
||||||
|
rabbitmq_use_ssl: False
|
||||||
|
rabbitmq_port: 5672
|
||||||
|
|
||||||
|
memcached_servers: 127.0.0.1
|
||||||
|
memcached_encryption_key: "secrete"
|
||||||
|
|
||||||
|
openrc_os_password: "{{ keystone_auth_admin_password }}"
|
||||||
|
openrc_os_domain_name: "Default"
|
||||||
|
openrc_os_auth_url: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}:5000/v3"
|
||||||
|
|
||||||
|
rally_galera_address: "{{ internal_lb_vip_address }}"
|
||||||
|
rally_galera_database: rally
|
||||||
|
rally_galera_password: "SuperSecrete"
|
||||||
|
rally_venv_tag: "testing"
|
||||||
|
rally_developer_mode: True
|
||||||
|
rally_bin: "/openstack/venvs/rally-{{ rally_venv_tag }}/bin"
|
@ -29,4 +29,7 @@
|
|||||||
- include: test-install-keystone.yml
|
- include: test-install-keystone.yml
|
||||||
|
|
||||||
# Install Rally
|
# Install Rally
|
||||||
- include: test-install-rally.yml
|
- include: test-install-rally.yml
|
||||||
|
|
||||||
|
# Functional testing of Rally Install
|
||||||
|
- include: test-functional-rally.yml
|
Loading…
Reference in New Issue
Block a user