Add functional testing
Include functional tests for neutron to: - validate that the API is accessible - create a network - create a subnet - create a port Change-Id: I1a7b0507fb1f34bc1dde0c81072a1f88650507b8 Closes-Bug: #1553970
This commit is contained in:
parent
c7aefe6fb5
commit
50f2252445
@ -71,6 +71,8 @@
|
||||
- mysql-db-setup
|
||||
roles:
|
||||
- role: "{{ rolename | basename }}"
|
||||
post_tasks:
|
||||
- include: test-neutron-functional.yml
|
||||
vars:
|
||||
external_lb_vip_address: 10.100.100.3
|
||||
internal_lb_vip_address: 10.100.100.3
|
||||
@ -120,6 +122,7 @@
|
||||
neutron_service_password: secrete
|
||||
neutron_container_mysql_password: SuperSecrete
|
||||
neutron_management_address: "{{ internal_lb_vip_address }}"
|
||||
openrc_os_auth_url: "http://127.0.0.1:5000/v3"
|
||||
openrc_os_password: "{{ keystone_auth_admin_password }}"
|
||||
openrc_os_domain_name: Default
|
||||
memcached_servers: 127.0.0.1
|
||||
|
53
tests/test-neutron-functional.yml
Normal file
53
tests/test-neutron-functional.yml
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
# 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.
|
||||
|
||||
# Packages need to be installed outside
|
||||
# of venv to be usable by Ansible
|
||||
- name: Install testing pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- python-neutronclient
|
||||
- httplib2
|
||||
|
||||
- name: Check the neutron api
|
||||
uri:
|
||||
url: "http://localhost:9696"
|
||||
status_code: 200
|
||||
|
||||
- name: Create test network
|
||||
neutron:
|
||||
command: create_network
|
||||
openrc_path: /root/openrc
|
||||
net_name: test-network
|
||||
|
||||
- name: Create test subnet
|
||||
neutron:
|
||||
command: create_subnet
|
||||
openrc_path: /root/openrc
|
||||
net_name: test-network
|
||||
subnet_name: test-subnet
|
||||
cidr: "192.168.74.0/24"
|
||||
|
||||
- name: Create test port
|
||||
shell: |
|
||||
. /root/openrc
|
||||
neutron port-create --name test-port test-network
|
||||
register: neutron_port_create
|
||||
|
||||
- name: Ensure neutron port was created successfully
|
||||
assert:
|
||||
that:
|
||||
- neutron_port_create.rc == 0
|
Loading…
Reference in New Issue
Block a user