4eee5af862
https://review.openstack.org/#/c/148718/ has been merged so including the post-up-checksum-rules script is no longer necessary. A new task has been added so that the script will be removed during upgrades from Liberty. Tests have been added to ensure that the dhcp agent is active, that the dhcp network namespace is being created as expected, and that this iptables rule is being created within that namespace. The unconfined apparmor profile has also been applied to the neutron test container so that it has the permissions required to create network namespaces. Change-Id: I068d091873d2744b0849b0d52a8083e129841b1b
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
---
|
|
# 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: Ensure that the DHCP agent is alive
|
|
shell: |
|
|
. /root/openrc
|
|
neutron agent-list | grep DHCP
|
|
register: neutron_dhcp_agent
|
|
until: neutron_dhcp_agent.stdout.find(':-)') != -1
|
|
retries: 5
|
|
delay: 10
|
|
|
|
- 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
|
|
until: neutron_port_create.rc == 0
|
|
retries: 5
|
|
delay: 10
|
|
|
|
- name: Check for dhcp network namespace
|
|
shell: |
|
|
ip netns | grep "^qdhcp"
|
|
register: dhcp_namespace
|
|
until: dhcp_namespace.rc == 0
|
|
retries: 5
|
|
delay: 10
|
|
|
|
- name: Check for iptables checksum rule
|
|
shell: |
|
|
ip netns exec {{ dhcp_namespace.stdout }} iptables -C neutron-dhcp-age-POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill
|
|
register: checksum_rule
|
|
until : checksum_rule.rc == 0
|
|
retries: 5
|
|
delay: 10
|