Use tempest for role testing
This commit deploys horizon and tempest and then validates that horizon is functioning using the dashboard scenario test. Change-Id: Iba77ecdfc437ec72a1ed3580964837c6c8429d32
This commit is contained in:
parent
8343d55bc4
commit
e66542cde3
@ -46,3 +46,7 @@
|
|||||||
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
|
src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
|
||||||
scm: git
|
scm: git
|
||||||
version: master
|
version: master
|
||||||
|
- name: os_tempest
|
||||||
|
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
|
||||||
|
scm: git
|
||||||
|
version: master
|
||||||
|
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,5 +1,26 @@
|
|||||||
[all]
|
[all]
|
||||||
localhost ansible_connection=local ansible_become=True
|
localhost ansible_connection=local ansible_become=True
|
||||||
|
infra1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root
|
||||||
|
keystone1 ansible_host=10.100.100.3 ansible_become=True ansible_user=root
|
||||||
|
horizon1 ansible_host=10.100.100.4 ansible_become=True ansible_user=root
|
||||||
|
|
||||||
[hosts]
|
[all_containers]
|
||||||
localhost ansible_ssh_host=127.0.0.1
|
infra1
|
||||||
|
keystone1
|
||||||
|
horizon1
|
||||||
|
|
||||||
|
[rabbitmq_all]
|
||||||
|
infra1
|
||||||
|
|
||||||
|
[galera_all]
|
||||||
|
infra1
|
||||||
|
|
||||||
|
[service_all:children]
|
||||||
|
rabbitmq_all
|
||||||
|
galera_all
|
||||||
|
|
||||||
|
[keystone_all]
|
||||||
|
keystone1
|
||||||
|
|
||||||
|
[horizon_all]
|
||||||
|
horizon1
|
||||||
|
28
tests/test-horizon-functional.yml
Normal file
28
tests/test-horizon-functional.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
# 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 horizon
|
||||||
|
hosts: horizon_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} tempest.scenario.test_dashboard_basic_ops
|
||||||
|
environment:
|
||||||
|
RUN_TEMPEST_OPTS: "--serial"
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
23
tests/test-install-horizon.yml
Normal file
23
tests/test-install-horizon.yml
Normal 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 horizon
|
||||||
|
hosts: horizon_all
|
||||||
|
user: root
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- role: "{{ rolename | basename }}"
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
32
tests/test-install-infra.yml
Normal file
32
tests/test-install-infra.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
# 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 infra services
|
||||||
|
hosts: service_all
|
||||||
|
user: root
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- role: "rabbitmq_server"
|
||||||
|
rabbitmq_cookie_token: secrete
|
||||||
|
- role: "galera_server"
|
||||||
|
galera_root_password: secrete
|
||||||
|
galera_root_user: root
|
||||||
|
galera_innodb_buffer_pool_size: 512M
|
||||||
|
galera_innodb_log_buffer_size: 32M
|
||||||
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
||||||
|
galera_wsrep_node_name: "{{ inventory_hostname }}"
|
||||||
|
galera_wsrep_provider_options:
|
||||||
|
- { option: "gcache.size", value: "32M" }
|
||||||
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
65
tests/test-install-keystone.yml
Normal file
65
tests/test-install-keystone.yml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
# 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 keystone
|
||||||
|
hosts: keystone_all
|
||||||
|
user: root
|
||||||
|
gather_facts: true
|
||||||
|
pre_tasks:
|
||||||
|
- name: Ensure rabbitmq vhost
|
||||||
|
rabbitmq_vhost:
|
||||||
|
name: "{{ keystone_rabbitmq_vhost }}"
|
||||||
|
state: "present"
|
||||||
|
delegate_to: "10.100.100.2"
|
||||||
|
when: inventory_hostname == groups['keystone_all'][0]
|
||||||
|
- name: Ensure rabbitmq user
|
||||||
|
rabbitmq_user:
|
||||||
|
user: "{{ keystone_rabbitmq_userid }}"
|
||||||
|
password: "{{ keystone_rabbitmq_password }}"
|
||||||
|
vhost: "{{ keystone_rabbitmq_vhost }}"
|
||||||
|
configure_priv: ".*"
|
||||||
|
read_priv: ".*"
|
||||||
|
write_priv: ".*"
|
||||||
|
state: "present"
|
||||||
|
delegate_to: "10.100.100.2"
|
||||||
|
when: inventory_hostname == groups['keystone_all'][0]
|
||||||
|
- name: Create DB for service
|
||||||
|
mysql_db:
|
||||||
|
login_user: "root"
|
||||||
|
login_password: "secrete"
|
||||||
|
login_host: "localhost"
|
||||||
|
name: "{{ keystone_galera_database }}"
|
||||||
|
state: "present"
|
||||||
|
delegate_to: "10.100.100.2"
|
||||||
|
when: inventory_hostname == groups['keystone_all'][0]
|
||||||
|
- name: Grant access to the DB for the service
|
||||||
|
mysql_user:
|
||||||
|
login_user: "root"
|
||||||
|
login_password: "secrete"
|
||||||
|
login_host: "localhost"
|
||||||
|
name: "{{ keystone_galera_database }}"
|
||||||
|
password: "{{ keystone_container_mysql_password }}"
|
||||||
|
host: "{{ item }}"
|
||||||
|
state: "present"
|
||||||
|
priv: "{{ keystone_galera_database }}.*:ALL"
|
||||||
|
with_items:
|
||||||
|
- "localhost"
|
||||||
|
- "%"
|
||||||
|
delegate_to: "10.100.100.2"
|
||||||
|
when: inventory_hostname == groups['keystone_all'][0]
|
||||||
|
roles:
|
||||||
|
- role: os_keystone
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
23
tests/test-install-tempest.yml
Normal file
23
tests/test-install-tempest.yml
Normal 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: horizon_all
|
||||||
|
user: root
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- role: "os_tempest"
|
||||||
|
vars_files:
|
||||||
|
- test-vars.yml
|
@ -1,84 +0,0 @@
|
|||||||
---
|
|
||||||
# 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: Create ssh key pairs for use with containers
|
|
||||||
hosts: 127.0.0.1
|
|
||||||
connection: local
|
|
||||||
become: false
|
|
||||||
pre_tasks:
|
|
||||||
- name: Create ssh key pair for root
|
|
||||||
user:
|
|
||||||
name: "{{ ansible_ssh_user }}"
|
|
||||||
generate_ssh_key: "yes"
|
|
||||||
ssh_key_bits: 2048
|
|
||||||
ssh_key_file: ".ssh/id_rsa"
|
|
||||||
- name: get the calling users key
|
|
||||||
command: cat ~/.ssh/id_rsa.pub
|
|
||||||
register: key_get
|
|
||||||
- set_fact:
|
|
||||||
lxc_container_ssh_key: "{{ key_get.stdout }}"
|
|
||||||
|
|
||||||
- name: Perform basic LXC host setup
|
|
||||||
hosts: localhost
|
|
||||||
connection: local
|
|
||||||
pre_tasks:
|
|
||||||
- name: First ensure apt cache is always refreshed
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
- name: Ensure root's new public ssh key is in authorized_keys
|
|
||||||
authorized_key:
|
|
||||||
user: root
|
|
||||||
key: "{{ hostvars['127.0.0.1']['lxc_container_ssh_key'] }}"
|
|
||||||
manage_dir: no
|
|
||||||
- set_fact:
|
|
||||||
lxc_container_ssh_key: "{{ hostvars['127.0.0.1']['lxc_container_ssh_key'] }}"
|
|
||||||
roles:
|
|
||||||
- role: "lxc_hosts"
|
|
||||||
lxc_net_address: 10.100.100.1
|
|
||||||
lxc_net_dhcp_range: 10.100.100.2,10.100.100.99
|
|
||||||
lxc_net_bridge: lxcbr0
|
|
||||||
lxc_kernel_options:
|
|
||||||
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
|
||||||
lxc_container_caches:
|
|
||||||
- url: "https://rpc-repo.rackspace.com/container_images/rpc-trusty-container.tgz"
|
|
||||||
name: "trusty.tgz"
|
|
||||||
sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
|
|
||||||
chroot_path: trusty/rootfs-amd64
|
|
||||||
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.101", groups: "all,all_containers,rabbitmq_all,galera_all,service_all" }
|
|
||||||
- { name: "keystone1", service: "keystone1", address: "10.100.100.102", groups: "all,all_containers,keystone_all" }
|
|
||||||
- { name: "horizon1", service: "horizon1", address: "10.100.100.103", groups: "all,all_containers,horizon_all" }
|
|
33
tests/test-prepare-containers.yml
Normal file
33
tests/test-prepare-containers.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
# 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 creating containers
|
||||||
|
hosts: all_containers
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
|
roles:
|
||||||
|
- role: "lxc_container_create"
|
||||||
|
lxc_container_release: trusty
|
||||||
|
lxc_container_backing_store: dir
|
||||||
|
global_environment_variables:
|
||||||
|
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
post_tasks:
|
||||||
|
- name: Wait for ssh to be available
|
||||||
|
local_action:
|
||||||
|
module: wait_for
|
||||||
|
port: "{{ ansible_ssh_port | default('22') }}"
|
||||||
|
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
|
||||||
|
search_regex: OpenSSH
|
||||||
|
delay: 1
|
60
tests/test-prepare-host.yml
Normal file
60
tests/test-prepare-host.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
---
|
||||||
|
# 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 configuring LXC host
|
||||||
|
hosts: localhost
|
||||||
|
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
|
||||||
|
authorized_key:
|
||||||
|
user: root
|
||||||
|
key: "{{ hostvars['localhost']['lxc_container_ssh_key'] }}"
|
||||||
|
manage_dir: no
|
||||||
|
- set_fact:
|
||||||
|
lxc_container_ssh_key: "{{ hostvars['localhost']['lxc_container_ssh_key'] }}"
|
||||||
|
- name: Check if this is an OpenStack-CI nodepool instance
|
||||||
|
stat:
|
||||||
|
path: /etc/nodepool/provider
|
||||||
|
register: nodepool
|
||||||
|
- name: Set the files to copy into the container cache for OpenStack-CI instances
|
||||||
|
set_fact:
|
||||||
|
lxc_container_cache_files:
|
||||||
|
- { src: '/etc/pip.conf', dest: '/etc/pip.conf' }
|
||||||
|
- { src: '/etc/apt/apt.conf.d/99unauthenticated', dest: '/etc/apt/apt.conf.d/99unauthenticated' }
|
||||||
|
when: nodepool.stat.exists | bool
|
||||||
|
- name: Determine the existing Ubuntu repo configuration
|
||||||
|
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
|
||||||
|
register: ubuntu_repo
|
||||||
|
changed_when: false
|
||||||
|
- name: Set apt repo facts based on discovered information
|
||||||
|
set_fact:
|
||||||
|
lxc_container_template_main_apt_repo: "{{ ubuntu_repo.stdout }}"
|
||||||
|
lxc_container_template_security_apt_rep: "{{ ubuntu_repo.stdout }}"
|
||||||
|
roles:
|
||||||
|
- role: "lxc_hosts"
|
||||||
|
lxc_net_address: 10.100.100.1
|
||||||
|
lxc_net_dhcp_range: 10.100.100.8,10.100.100.253
|
||||||
|
lxc_net_bridge: lxcbr0
|
||||||
|
lxc_kernel_options:
|
||||||
|
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
||||||
|
lxc_container_caches:
|
||||||
|
- url: "https://rpc-repo.rackspace.com/container_images/rpc-trusty-container.tgz"
|
||||||
|
name: "trusty.tgz"
|
||||||
|
sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
|
||||||
|
chroot_path: trusty/rootfs-amd64
|
33
tests/test-prepare-keys.yml
Normal file
33
tests/test-prepare-keys.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# NOTE: we use become_user because setting become: no or become: false
|
||||||
|
# doesn't seem to override the ansible_become=true in the
|
||||||
|
# inventory
|
||||||
|
- name: Playbook for establishing ssh keys
|
||||||
|
hosts: localhost
|
||||||
|
become_user: "{{ ansible_ssh_user }}"
|
||||||
|
pre_tasks:
|
||||||
|
- name: Create ssh key pair for root
|
||||||
|
user:
|
||||||
|
name: "{{ ansible_ssh_user }}"
|
||||||
|
generate_ssh_key: "yes"
|
||||||
|
ssh_key_bits: 2048
|
||||||
|
ssh_key_file: ".ssh/id_rsa"
|
||||||
|
- name: Get the calling user's key
|
||||||
|
command: cat ~/.ssh/id_rsa.pub
|
||||||
|
register: key_get
|
||||||
|
- set_fact:
|
||||||
|
lxc_container_ssh_key: "{{ key_get.stdout }}"
|
79
tests/test-vars.yml
Normal file
79
tests/test-vars.yml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
external_lb_vip_address: 10.100.100.3
|
||||||
|
galera_client_drop_config_file: false
|
||||||
|
galera_root_password: "secrete"
|
||||||
|
horizon_developer_mode: true
|
||||||
|
horizon_venv_tag: "testing"
|
||||||
|
horizon_git_install_branch: master
|
||||||
|
horizon_requirements_git_install_branch: master
|
||||||
|
horizon_galera_address: 10.100.100.2
|
||||||
|
horizon_rabbitmq_password: "secrete"
|
||||||
|
horizon_rabbitmq_userid: horizon
|
||||||
|
horizon_rabbitmq_vhost: /horizon
|
||||||
|
horizon_container_mysql_password: "SuperSecrete"
|
||||||
|
horizon_secret_key: "SuperSecreteHorizonKey"
|
||||||
|
horizon_external_ssl: false
|
||||||
|
horizon_ssl_protocol: "ALL -SSLv2 -SSLv3"
|
||||||
|
horizon_ssl_cipher_suite: "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS"
|
||||||
|
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: master
|
||||||
|
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: master
|
||||||
|
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 }}"
|
||||||
|
tempest_dashboard_login_url: "https://10.100.100.4/auth/login/"
|
||||||
|
tempest_dashboard_url: "https://10.100.100.4/"
|
||||||
|
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-horizon-functional.yml
|
||||||
|
tempest_venv_bin: "/opt/tempest_{{ tempest_venv_tag }}/bin"
|
||||||
|
tempest_log_dir: "/var/log/"
|
||||||
|
tempest_main_group: horizon_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: True
|
||||||
|
tempest_service_available_neutron: False
|
||||||
|
tempest_service_available_nova: False
|
||||||
|
tempest_service_available_swift: False
|
146
tests/test.yml
146
tests/test.yml
@ -13,134 +13,26 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Run basic prep
|
# Prepare the user ssh keys
|
||||||
- include: test-prep.yml
|
- include: test-prepare-keys.yml
|
||||||
|
|
||||||
# Run container clean up and build
|
# Prepare the host
|
||||||
- include: test-container-create.yml
|
- include: test-prepare-host.yml
|
||||||
|
|
||||||
- name: Playbook for deploying infra services
|
# Prepare the containers
|
||||||
hosts: service_all
|
- include: test-prepare-containers.yml
|
||||||
user: root
|
|
||||||
gather_facts: true
|
|
||||||
roles:
|
|
||||||
- role: "rabbitmq_server"
|
|
||||||
rabbitmq_cookie_token: secrete
|
|
||||||
- role: "galera_server"
|
|
||||||
galera_root_password: secrete
|
|
||||||
galera_root_user: root
|
|
||||||
galera_innodb_buffer_pool_size: 512M
|
|
||||||
galera_innodb_log_buffer_size: 32M
|
|
||||||
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
||||||
galera_wsrep_node_name: "{{ inventory_hostname }}"
|
|
||||||
galera_wsrep_provider_options:
|
|
||||||
- { option: "gcache.size", value: "32M" }
|
|
||||||
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
||||||
|
|
||||||
- name: Playbook for deploying keystone
|
# Install RabbitMQ/MariaDB
|
||||||
hosts: keystone_all
|
- include: test-install-infra.yml
|
||||||
user: root
|
|
||||||
gather_facts: true
|
|
||||||
pre_tasks:
|
|
||||||
- name: Ensure rabbitmq vhost
|
|
||||||
rabbitmq_vhost:
|
|
||||||
name: "{{ keystone_rabbitmq_vhost }}"
|
|
||||||
state: "present"
|
|
||||||
delegate_to: "10.100.100.101"
|
|
||||||
when: inventory_hostname == groups['keystone_all'][0]
|
|
||||||
- name: Ensure rabbitmq user
|
|
||||||
rabbitmq_user:
|
|
||||||
user: "{{ keystone_rabbitmq_userid }}"
|
|
||||||
password: "{{ keystone_rabbitmq_password }}"
|
|
||||||
vhost: "{{ keystone_rabbitmq_vhost }}"
|
|
||||||
configure_priv: ".*"
|
|
||||||
read_priv: ".*"
|
|
||||||
write_priv: ".*"
|
|
||||||
state: "present"
|
|
||||||
delegate_to: "10.100.100.101"
|
|
||||||
when: inventory_hostname == groups['keystone_all'][0]
|
|
||||||
- name: Create DB for service
|
|
||||||
mysql_db:
|
|
||||||
login_user: "root"
|
|
||||||
login_password: "secrete"
|
|
||||||
login_host: "localhost"
|
|
||||||
name: "{{ keystone_galera_database }}"
|
|
||||||
state: "present"
|
|
||||||
delegate_to: "10.100.100.101"
|
|
||||||
when: inventory_hostname == groups['keystone_all'][0]
|
|
||||||
- name: Grant access to the DB for the service
|
|
||||||
mysql_user:
|
|
||||||
login_user: "root"
|
|
||||||
login_password: "secrete"
|
|
||||||
login_host: "localhost"
|
|
||||||
name: "{{ keystone_galera_database }}"
|
|
||||||
password: "{{ keystone_container_mysql_password }}"
|
|
||||||
host: "{{ item }}"
|
|
||||||
state: "present"
|
|
||||||
priv: "{{ keystone_galera_database }}.*:ALL"
|
|
||||||
with_items:
|
|
||||||
- "localhost"
|
|
||||||
- "%"
|
|
||||||
delegate_to: "10.100.100.101"
|
|
||||||
when: inventory_hostname == groups['keystone_all'][0]
|
|
||||||
roles:
|
|
||||||
- role: os_keystone
|
|
||||||
vars:
|
|
||||||
external_lb_vip_address: 10.100.100.102
|
|
||||||
internal_lb_vip_address: 10.100.100.102
|
|
||||||
keystone_galera_address: 10.100.100.101
|
|
||||||
keystone_galera_database: keystone
|
|
||||||
keystone_venv_tag: "testing"
|
|
||||||
keystone_developer_mode: true
|
|
||||||
keystone_git_install_branch: master
|
|
||||||
keystone_requirements_git_install_branch: master
|
|
||||||
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.101
|
|
||||||
keystone_rabbitmq_use_ssl: true
|
|
||||||
galera_client_drop_config_file: false
|
|
||||||
|
|
||||||
- name: Playbook for role testing
|
# Install Keystone
|
||||||
hosts: horizon_all
|
- include: test-install-keystone.yml
|
||||||
user: root
|
|
||||||
roles:
|
# Install Horizon
|
||||||
- role: "{{ rolename | basename }}"
|
- include: test-install-horizon.yml
|
||||||
vars:
|
|
||||||
galera_client_drop_config_file: false
|
# Install Tempest
|
||||||
external_lb_vip_address: 10.100.100.102
|
- include: test-install-tempest.yml
|
||||||
internal_lb_vip_address: 10.100.100.102
|
|
||||||
horizon_developer_mode: true
|
# Test Horizon
|
||||||
horizon_venv_tag: "testing"
|
- include: test-horizon-functional.yml
|
||||||
horizon_git_install_branch: master
|
|
||||||
horizon_requirements_git_install_branch: master
|
|
||||||
horizon_galera_address: 10.100.100.101
|
|
||||||
horizon_rabbitmq_password: "secrete"
|
|
||||||
horizon_rabbitmq_userid: horizon
|
|
||||||
horizon_rabbitmq_vhost: /horizon
|
|
||||||
horizon_container_mysql_password: "SuperSecrete"
|
|
||||||
horizon_secret_key: "SuperSecreteHorizonKey"
|
|
||||||
horizon_external_ssl: true
|
|
||||||
horizon_ssl_protocol: "ALL -SSLv2 -SSLv3"
|
|
||||||
horizon_ssl_cipher_suite: "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS"
|
|
||||||
galera_root_password: "secrete"
|
|
||||||
rabbitmq_servers: 10.100.100.101
|
|
||||||
rabbitmq_use_ssl: false
|
|
||||||
rabbitmq_port: 5671
|
|
||||||
keystone_auth_admin_token: "SuperSecreteTestToken"
|
|
||||||
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"
|
|
||||||
openrc_os_password: "{{ keystone_auth_admin_password }}"
|
|
||||||
openrc_os_domain_name: "Default"
|
|
||||||
memcached_servers: 10.100.100.101
|
|
||||||
memcached_encryption_key: "secrete"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user