Add Multi Region Swift gate scenario

* Fix networking so that we can extend it for MR swift gate.
* Add a vars file for region A and region B.
* Add host_vars and inventory files for region A and region B
* Split out the function-test to allow all scenarios to use the same
test.yml file.
* Use -e @vars-file.yml format in tox.ini since we can't include vars
files based on a variable.
* Remove any references to include_vars: test-vars.yml as a result of
moving to use -e @vars-file.yml
* Add static routes into host_vars for swift-proxy and swift-storage
hosts so that they can route to the other region.
* Make addresses in test-vars more generic based on inventory.

Change-Id: I52b4068acbc80dcb7710d388ccbed2edcb8bfd61
This commit is contained in:
Andy McCrae 2016-08-17 20:00:48 +01:00
parent 750ccaa9e8
commit 80d2d96a5f
29 changed files with 894 additions and 60 deletions

View File

@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.101
ansible_ssh_host: 10.1.1.101
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -0,0 +1,23 @@
---
# 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: 10.1.1.101
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtA"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -0,0 +1,23 @@
---
# 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: 10.1.11.101
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtB"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -13,12 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.102
storage_address: 10.100.101.102
ansible_ssh_host: 10.1.1.102
storage_address: 10.1.2.102
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -0,0 +1,33 @@
---
# 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: 10.1.1.102
storage_address: 10.1.2.102
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtA"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageA"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.12.0/24"
gateway: "10.1.2.1"

View File

@ -0,0 +1,33 @@
---
# 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: 10.1.11.102
storage_address: 10.1.12.102
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtB"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageB"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.2.0/24"
gateway: "10.1.12.1"

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.103
storage_address: 10.100.101.103
replication_address: 10.100.102.103
ansible_ssh_host: 10.1.1.103
storage_address: 10.1.2.103
replication_address: 10.1.3.103
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.104
storage_address: 10.100.101.104
replication_address: 10.100.102.104
ansible_ssh_host: 10.1.1.104
storage_address: 10.1.2.104
replication_address: 10.1.3.104
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.105
storage_address: 10.100.101.105
replication_address: 10.100.102.105
ansible_ssh_host: 10.1.1.105
storage_address: 10.1.2.105
replication_address: 10.1.3.105
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ansible_ssh_host: 10.100.100.106
storage_address: 10.100.101.106
replication_address: 10.100.102.106
ansible_ssh_host: 10.1.1.106
storage_address: 10.1.2.106
replication_address: 10.1.3.106
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "lxcbr0"
bridge: "br-mgmt"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"

View File

@ -0,0 +1,43 @@
---
# 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: 10.1.1.103
storage_address: 10.1.2.103
replication_address: 10.1.3.103
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtA"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageA"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.12.0/24"
gateway: "10.1.2.1"
replication_address:
address: "{{ replication_address }}"
bridge: "br-replA"
interface: "eth3"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.13.0/24"
gateway: "10.1.3.1"

View File

@ -0,0 +1,43 @@
---
# 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: 10.1.1.104
storage_address: 10.1.2.104
replication_address: 10.1.3.104
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtA"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageA"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.12.0/24"
gateway: "10.1.2.1"
replication_address:
address: "{{ replication_address }}"
bridge: "br-replA"
interface: "eth3"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.13.0/24"
gateway: "10.1.3.1"

View File

@ -0,0 +1,43 @@
---
# 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: 10.1.11.103
storage_address: 10.1.12.103
replication_address: 10.1.13.103
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtB"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageB"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.2.0/24"
gateway: "10.1.12.1"
replication_address:
address: "{{ replication_address }}"
bridge: "br-replB"
interface: "eth3"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.3.0/24"
gateway: "10.1.13.1"

View File

@ -0,0 +1,44 @@
---
# 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: 10.1.11.104
storage_address: 10.1.12.104
replication_address: 10.1.13.104
container_networks:
management_address:
address: "{{ ansible_ssh_host }}"
bridge: "br-mgmtB"
interface: "eth1"
netmask: "255.255.255.0"
type: "veth"
storage_address:
address: "{{ storage_address }}"
bridge: "br-storageB"
interface: "eth2"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.2.0/24"
gateway: "10.1.12.1"
replication_address:
address: "{{ replication_address }}"
bridge: "br-replB"
interface: "eth3"
netmask: "255.255.255.0"
type: "veth"
static_routes:
- cidr: "10.1.3.0/24"
gateway: "10.1.13.1"

55
tests/inventory_MR_A Normal file
View File

@ -0,0 +1,55 @@
[all]
localhost ansible_connection=local ansible_become=True
infraA1
swift-proxyA
swift-storageA1
swift-storageA2
[all_containers]
infraA1
swift-proxyA
swift-storageA1
swift-storageA2
[galera_all]
infraA1
[memcached_all]
infraA1
[service_all:children]
galera_all
memcached_all
[keystone_all]
infraA1
[swift_hosts]
swift-storageA1
swift-storageA2
[swift_proxy]
swift-proxyA
[swift_acc]
swift-storageA1
swift-storageA2
[swift_cont]
swift-storageA1
swift-storageA2
[swift_obj]
swift-storageA1
swift-storageA2
[swift_all:children]
swift_acc
swift_proxy
swift_cont
swift_obj
[swift_remote_all]
swift-proxyB
swift-storageB1
swift-storageB2

55
tests/inventory_MR_B Normal file
View File

@ -0,0 +1,55 @@
[all]
localhost ansible_connection=local ansible_become=True
infraB1
swift-proxyB
swift-storageB1
swift-storageB2
[all_containers]
infraB1
swift-proxyB
swift-storageB1
swift-storageB2
[galera_all]
infraB1
[memcached_all]
infraB1
[service_all:children]
galera_all
memcached_all
[keystone_all]
infraB1
[swift_hosts]
swift-storageB1
swift-storageB2
[swift_proxy]
swift-proxyB
[swift_acc]
swift-storageB1
swift-storageB2
[swift_cont]
swift-storageB1
swift-storageB2
[swift_obj]
swift-storageB1
swift-storageB2
[swift_all:children]
swift_acc
swift_proxy
swift_cont
swift_obj
[swift_remote_all]
swift-proxyA
swift-storageA1
swift-storageA2

View File

@ -20,5 +20,3 @@
roles:
- role: "memcached_server"
- role: "galera_server"
vars_files:
- test-vars.yml

View File

@ -48,5 +48,3 @@
- mysql-db-setup
roles:
- role: os_keystone
vars_files:
- test-vars.yml

View File

@ -13,8 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# We can set the swift_groups so that the multi-region test will run against only the local hosts
# when the remote hosts haven't been created yet.
- name: Playbook for deploying swift
hosts: swift_all
hosts: "{{ swift_groups | default('swift_all:swift_remote_all') }}"
user: root
gather_facts: true
pre_tasks:
@ -26,5 +28,3 @@
- hostvars[inventory_hostname]['container_networks']['replication_address']['address'] is defined
roles:
- role: "{{ rolename | basename }}"
vars_files:
- test-vars.yml

View File

@ -18,7 +18,6 @@
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"

View File

@ -37,17 +37,34 @@
- { src: '/etc/pip.conf', dest: '/etc/pip.conf' }
when: nodepool.stat.exists | bool
post_tasks:
- name: Create br-storage bridge
shell: /sbin/brctl addbr br-storage || true
- name: IP br-storage
command: /sbin/ifconfig br-storage 10.100.101.1 netmask 255.255.255.0
- name: Create br-repl bridge
shell: /sbin/brctl addbr br-repl || true
- name: IP br-repl
command: /sbin/ifconfig br-repl 10.100.102.1 netmask 255.255.255.0
- name: Ensure that /etc/network/interfaces.d/ exists
file:
path: /etc/network/interfaces.d/
state: directory
- name: Copy network configuration
template:
src: "{{ interfaces_file }}"
dest: /etc/network/interfaces.d/swift_interfaces.cfg
register: swift_interfaces
- name: Ensure our interfaces.d configuration files are loaded automatically
lineinfile:
dest: /etc/network/interfaces
line: "source /etc/network/interfaces.d/*.cfg"
- name: Shut down the network interfaces
command: "ifdown {{ item }}"
when: swift_interfaces | changed
with_items:
- "{{ bridges }}"
- name: Start the network interfaces
command: "ifup {{ item }}"
when: swift_interfaces | changed
with_items:
- "{{ bridges }}"
- name: Add iptables rule to ensure ssh checksum is correct
command: /sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
roles:
- role: "lxc_hosts"
vars_files:
- test-vars.yml

View File

@ -0,0 +1,67 @@
## The default networking requires several bridges. These bridges were named to be informative
## however they can be named what ever you like and is adaptable to any network infrastructure
## environment. This file serves as an example of how to setup basic networking and was ONLY
## built for the purpose of being an example and used expressly in the building of an ALL IN
## ONE development environment.
auto br-mgmtA
iface br-mgmtA inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
# Notice the bridge port is the vlan tagged interface
bridge_ports none
address 10.1.1.1
netmask 255.255.255.0
offload-sg off
auto br-storageA
iface br-storageA inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.2.1
netmask 255.255.255.0
offload-sg off
auto br-replA
iface br-replA inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.3.1
netmask 255.255.255.0
offload-sg off
auto br-mgmtB
iface br-mgmtB inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
# Notice the bridge port is the vlan tagged interface
bridge_ports none
address 10.1.11.1
netmask 255.255.255.0
offload-sg off
auto br-storageB
iface br-storageB inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.12.1
netmask 255.255.255.0
offload-sg off
auto br-replB
iface br-replB inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.13.1
netmask 255.255.255.0
offload-sg off

View File

@ -115,5 +115,3 @@
args:
chdir: "/opt/swift/"
executable: "/bin/bash"
vars_files:
- test-vars.yml

View File

@ -0,0 +1,36 @@
## The default networking requires several bridges. These bridges were named to be informative
## however they can be named what ever you like and is adaptable to any network infrastructure
## environment. This file serves as an example of how to setup basic networking and was ONLY
## built for the purpose of being an example and used expressly in the building of an ALL IN
## ONE development environment.
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
# Notice the bridge port is the vlan tagged interface
bridge_ports none
address 10.1.1.1
netmask 255.255.255.0
offload-sg off
auto br-storage
iface br-storage inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.2.1
netmask 255.255.255.0
offload-sg off
auto br-repl
iface br-repl inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.1.3.1
netmask 255.255.255.0
offload-sg off

124
tests/test-vars-MR-A.yml Normal file
View File

@ -0,0 +1,124 @@
---
# 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.
# General Environment Settings
external_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
internal_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
debug: true
# LXC Settings
lxc_net_address: 10.100.100.1
lxc_net_netmask: 255.255.255.0
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 }
# Galera Settings
galera_root_password: secrete
galera_root_user: root
galera_server_id: "{{ inventory_hostname | string_2_int }}"
galera_wsrep_node_name: "{{ inventory_hostname }}"
galera_innodb_buffer_pool_size: 512M
galera_innodb_log_buffer_size: 32M
galera_wsrep_provider_options:
- { option: "gcache.size", value: "32M" }
galera_server_id: "{{ inventory_hostname | string_2_int }}"
# Memcache Settings
memcached_listen: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_servers: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_encryption_key: "secrete"
# Network interface settings
interfaces_file: "test-swift-MR-interfaces.cfg.j2"
bridges:
- br-mgmtA
- br-storageA
- br-replA
- br-mgmtB
- br-storageB
- br-replB
# Keystone Settings
keystone_messaging_enabled: false
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_password: "secrete"
keystone_galera_database: keystone
keystone_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}"
keystone_container_mysql_password: "SuperSecrete"
keystone_venv_tag: "testing"
keystone_developer_mode: true
keystone_git_install_branch: master
keystone_requirements_git_install_branch: master
keystone_service_region: RegionOne
keystone_httpd_mpm_thread_limit: 20
keystone_httpd_mpm_min_spare_threads: 2
keystone_httpd_mpm_max_spare_threads: 10
# Optimization for MR Swift memory usage
keystone_wsgi_processes: 2
swift_account_server_workers: 2
swift_container_server_workers: 2
swift_object_server_workers: 2
swift_proxy_server_workers: 2
# Swift specific settings
swift_storage_address: "{{ ansible_ssh_host }}"
swift_container_mysql_password: "SuperSecrete"
swift_dispersion_password: "secrete"
swift_hash_path_prefix: "secrete_prefx"
swift_hash_path_suffix: "secrete_suffix"
swift_service_password: "secrete"
swift_developer_mode: true
swift_git_install_branch: master
swift_venv_tag: untagged
swift_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin"
swift_service_publicuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_adminuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_internaluri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_replication_address: "{{ replication_address }}"
swift:
storage_network: eth1
replication_network: eth3
part_power: 8
region: 1
drives:
- name: swift1
- name: swift2
mount_point: /openstack
storage_policies:
- policy:
name: gold
index: 0
repl_number: 3
default: True
swift_proxy_server_conf_overrides:
"filter:keystoneauth":
reseller_prefix: "AUTH, SERVICE"
"SERVICE_service_roles": "test5"
# openrc settings
openrc_os_password: "{{ keystone_auth_admin_password }}"
openrc_os_domain_name: "Default"
openrc_os_auth_url: "http://{{ internal_lb_vip_address }}:5000/v3"

124
tests/test-vars-MR-B.yml Normal file
View File

@ -0,0 +1,124 @@
---
# 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.
# General Environment Settings
external_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
internal_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
debug: true
# LXC Settings
lxc_net_address: 10.100.100.1
lxc_net_netmask: 255.255.255.0
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 }
# Galera Settings
galera_root_password: secrete
galera_root_user: root
galera_server_id: "{{ inventory_hostname | string_2_int }}"
galera_wsrep_node_name: "{{ inventory_hostname }}"
galera_innodb_buffer_pool_size: 512M
galera_innodb_log_buffer_size: 32M
galera_wsrep_provider_options:
- { option: "gcache.size", value: "32M" }
galera_server_id: "{{ inventory_hostname | string_2_int }}"
# Memcache Settings
memcached_listen: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_servers: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_encryption_key: "secrete"
# Network interface settings
interfaces_file: "test-swift-MR-interfaces.cfg.j2"
bridges:
- br-mgmtA
- br-storageA
- br-replA
- br-mgmtB
- br-storageB
- br-replB
# Keystone Settings
keystone_messaging_enabled: false
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_password: "secrete"
keystone_galera_database: keystone
keystone_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}"
keystone_container_mysql_password: "SuperSecrete"
keystone_venv_tag: "testing"
keystone_developer_mode: true
keystone_git_install_branch: master
keystone_requirements_git_install_branch: master
keystone_service_region: RegionOne
keystone_httpd_mpm_thread_limit: 20
keystone_httpd_mpm_min_spare_threads: 2
keystone_httpd_mpm_max_spare_threads: 10
# Optimization for MR Swift memory usage
keystone_wsgi_processes: 2
swift_account_server_workers: 2
swift_container_server_workers: 2
swift_object_server_workers: 2
swift_proxy_server_workers: 2
# Swift specific settings
swift_storage_address: "{{ ansible_ssh_host }}"
swift_container_mysql_password: "SuperSecrete"
swift_dispersion_password: "secrete"
swift_hash_path_prefix: "secrete_prefx"
swift_hash_path_suffix: "secrete_suffix"
swift_service_password: "secrete"
swift_developer_mode: true
swift_git_install_branch: master
swift_venv_tag: untagged
swift_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin"
swift_service_publicuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_adminuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_internaluri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_replication_address: "{{ replication_address }}"
swift:
storage_network: eth1
replication_network: eth3
part_power: 8
region: 2
drives:
- name: swift1
- name: swift2
mount_point: /openstack
storage_policies:
- policy:
name: gold
index: 0
repl_number: 3
default: True
swift_proxy_server_conf_overrides:
"filter:keystoneauth":
reseller_prefix: "AUTH, SERVICE"
"SERVICE_service_roles": "test5"
# openrc settings
openrc_os_password: "{{ keystone_auth_admin_password }}"
openrc_os_domain_name: "Default"
openrc_os_auth_url: "http://{{ internal_lb_vip_address }}:5000/v3"

View File

@ -14,8 +14,8 @@
# limitations under the License.
# General Environment Settings
external_lb_vip_address: 10.100.100.101
internal_lb_vip_address: 10.100.100.101
external_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
internal_lb_vip_address: "{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}"
debug: true
# LXC Settings
@ -29,8 +29,6 @@ lxc_kernel_options:
# Galera Settings
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:
@ -38,10 +36,17 @@ galera_wsrep_provider_options:
galera_server_id: "{{ inventory_hostname | string_2_int }}"
# Memcache Settings
memcached_listen: 10.100.100.101
memcached_servers: 10.100.100.101
memcached_listen: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_servers: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}"
memcached_encryption_key: "secrete"
# Network interface settings
interfaces_file: "test-swift-interfaces.cfg.j2"
bridges:
- br-mgmt
- br-storage
- br-repl
# Keystone Settings
keystone_messaging_enabled: false
keystone_admin_user_name: admin
@ -55,7 +60,7 @@ keystone_service_adminuri: "http://{{ internal_lb_vip_address }}:35357"
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
keystone_service_password: "secrete"
keystone_galera_database: keystone
keystone_galera_address: 10.100.100.101
keystone_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}"
keystone_container_mysql_password: "SuperSecrete"
keystone_venv_tag: "testing"
keystone_developer_mode: true
@ -74,9 +79,9 @@ swift_developer_mode: true
swift_git_install_branch: master
swift_venv_tag: untagged
swift_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin"
swift_service_publicuri: "http://10.100.100.102:8080"
swift_service_adminuri: "http://10.100.100.102:8080"
swift_service_internaluri: "http://10.100.100.102:8080"
swift_service_publicuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_adminuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_service_internaluri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080"
swift_replication_address: "{{ replication_address }}"
swift:
storage_network: eth1

View File

@ -33,6 +33,3 @@
# Install Swift
- include: test-install-swift.yml
# Test Swift
- include: test-swift-functional.yml

88
tox.ini
View File

@ -147,18 +147,23 @@ commands =
ansible-lint {toxinidir}
[testenv:func_base]
# NOTE(odyssey4me): this target does not use constraints because
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
# drop the install_command.
install_command =
pip install -U --force-reinstall {opts} {packages}
[testenv:functional]
# Ignore_errors is set to true so that the logs are collected at the
# end of the run. This will not produce a failse positive. Any
# exception will be mark the run as failed and exit 1 after all of
# the commands have been iterated through.
ignore_errors = True
# NOTE(odyssey4me): this target does not use constraints because
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
# drop the install_command.
# NOTE(andymccr): this will test standard Swift install.
install_command =
pip install -U --force-reinstall {opts} {packages}
{[testenv:func_base]install_command}
deps =
{[testenv:ansible]deps}
setenv =
@ -168,16 +173,21 @@ commands =
ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars.yml \
{toxinidir}/tests/test.yml -vvvv
ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars.yml \
{toxinidir}/tests/test-swift-functional.yml -vvvv
bash -c 'mkdir -p {toxinidir}/logs'
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
# NOTE(andymccr): this will test Swift running in pypy.
[testenv:func_pypy]
install_command =
pip install -U --force-reinstall {opts} {packages}
{[testenv:func_base]install_command}
deps =
{[testenv:ansible]deps}
setenv =
@ -187,12 +197,78 @@ commands =
ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars.yml \
-e "swift_pypy_enabled=True" \
{toxinidir}/tests/test.yml -vvvv
ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars.yml \
-e "swift_pypy_enabled=True" \
{toxinidir}/tests/test-swift-functional.yml -vvvv
bash -c 'mkdir -p {toxinidir}/logs'
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
# NOTE(andmccr): this will test a MR Swift deploy.
[testenv:multi_reg]
install_command =
{[testenv:func_base]install_command}
deps =
{[testenv:ansible]deps}
setenv =
{[testenv:ansible]setenv}
commands =
{[testenv:ansible]commands}
# Setup the host and Region A
# NB we run against swift_all only since region B hosts don't exist yet.
ansible-playbook -i {toxinidir}/tests/inventory_MR_A \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e "swift_do_setup=True" \
-e "swift_do_sync=False" \
-e "swift_groups='swift_all'" \
-e @{toxinidir}/tests/test-vars-MR-A.yml \
{toxinidir}/tests/test.yml -vvvv
# Setup region B
ansible-playbook -i {toxinidir}/tests/inventory_MR_B \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e "swift_do_setup=True" \
-e "swift_do_sync=False" \
-e @{toxinidir}/tests/test-vars-MR-B.yml \
{toxinidir}/tests/test.yml -vvvv
# Sync rings from region A
ansible-playbook -i {toxinidir}/tests/inventory_MR_A \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e "swift_do_setup=False" \
-e "swift_do_sync=True" \
-e @{toxinidir}/tests/test-vars-MR-A.yml \
{toxinidir}/tests/test-install-swift.yml -vvvv
# Sync rings from region B
ansible-playbook -i {toxinidir}/tests/inventory_MR_B \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e "swift_do_setup=False" \
-e "swift_do_sync=True" \
-e @{toxinidir}/tests/test-vars-MR-B.yml \
{toxinidir}/tests/test-install-swift.yml -vvvv
# Run functional tests against region A
ansible-playbook -i {toxinidir}/tests/inventory_MR_A \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars-MR-A.yml \
{toxinidir}/tests/test-swift-functional.yml -vvvv
# Run functional tests against region B
ansible-playbook -i {toxinidir}/tests/inventory_MR_B \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
-e @{toxinidir}/tests/test-vars-MR-B.yml \
{toxinidir}/tests/test-swift-functional.yml -vvvv
bash -c 'mkdir -p {toxinidir}/logs'
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
[testenv:linters]
deps =