diff --git a/doc/source/conf.py b/doc/source/conf.py index ff0b9cac..1fb47d5f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -69,7 +69,9 @@ target_name = 'openstack-ansible-' + role_name title = 'OpenStack-Ansible Documentation: ' + role_name + 'role' # The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = 'https://git.openstack.org/cgit/openstack/' + target_name +oslosphinx_cgit_link = ( + 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) +) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 6b5753e1..45466491 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -65,7 +65,9 @@ target_name = 'openstack-ansible-' + role_name title = 'OpenStack-Ansible Release Notes: ' + role_name + 'role' # The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = 'https://git.openstack.org/cgit/openstack/' + target_name +oslosphinx_cgit_link = ( + 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) +) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/run_tests.sh b/run_tests.sh index e8f6f3ac..d9dacfb8 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -49,24 +49,12 @@ install_pkg_deps() { eval sudo $pkg_mgr_cmd $pkg_deps } -git_clone_repo() { - if [[ ! -d tests/common ]]; then - # The tests repo doesn't need a clone, we can just - # symlink it. - if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then - ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common - else - git clone \ - https://git.openstack.org/openstack/openstack-ansible-tests \ - tests/common - fi - fi -} - +# Install the host distro package dependencies install_pkg_deps -git_clone_repo +# Clone the tests repo for access to the common test script +source tests/tests-repo-clone.sh -# start executing the main test script +# Execute the common test script source tests/common/run_tests_common.sh diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index 267d0416..e40bfdf0 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -57,7 +57,7 @@ - name: os_previous_neutron src: https://git.openstack.org/openstack/openstack-ansible-os_neutron scm: git - version: stable/ocata + version: stable/pike - name: opendaylight scm: git src: https://git.opendaylight.org/gerrit/p/integration/packaging/ansible-opendaylight.git diff --git a/tests/test-install-previous-neutron.yml b/tests/test-install-previous-neutron.yml index a995dda7..fe00e6f1 100644 --- a/tests/test-install-previous-neutron.yml +++ b/tests/test-install-previous-neutron.yml @@ -55,6 +55,10 @@ host: "{{ ansible_host | default(inventory_hostname) }}" search_regex: OpenSSH delay: 1 + - name: Ensure presence of iptables inside the agent before running the role + package: + name: iptables + state: present - name: Add iptables rule for communication w/ metadata agent command: /sbin/iptables -t mangle -A POSTROUTING -p tcp --sport 80 -j CHECKSUM --checksum-fill diff --git a/tests/test-upgrade.yml b/tests/test-upgrade.yml index b3201ff6..dc3ec833 100644 --- a/tests/test-upgrade.yml +++ b/tests/test-upgrade.yml @@ -30,5 +30,8 @@ # Install Keystone - include: common/test-install-keystone.yml +# Ensure the repo is setup for previous version +- include: common/previous/test-repo-setup.yml + # Install previous Neutron - include: test-install-previous-neutron.yml diff --git a/tests/tests-repo-clone.sh b/tests/tests-repo-clone.sh index 9c793c59..3e4ffd66 100755 --- a/tests/tests-repo-clone.sh +++ b/tests/tests-repo-clone.sh @@ -33,6 +33,7 @@ set -e export TESTING_HOME=${TESTING_HOME:-$HOME} export WORKING_DIR=${WORKING_DIR:-$(pwd)} export CLONE_UPGRADE_TESTS=${CLONE_UPGRADE_TESTS:-no} +export ZUUL_TESTS_CLONE_LOCATION="/home/zuul/src/git.openstack.org/openstack/openstack-ansible-tests" ## Functions ----------------------------------------------------------------- @@ -52,7 +53,11 @@ EOF # If zuul-cloner is present, use it so that we # also include any dependent patches from the # tests repo noted in the commit message. -if [[ -x /usr/zuul-env/bin/zuul-cloner ]]; then +# We only want to use zuul-cloner if we detect +# zuul v2 running, so we check for the presence +# of the ZUUL_REF environment variable. +# ref: http://git.openstack.org/cgit/openstack-infra/zuul/tree/zuul/ansible/filter/zuul_filters.py?h=feature/zuulv3#n17 +if [[ -x /usr/zuul-env/bin/zuul-cloner ]] && [[ "${ZUUL_REF:-none}" != "none" ]]; then # Prepare the clonemap for zuul-cloner to use create_tests_clonemap @@ -74,9 +79,22 @@ if [[ -x /usr/zuul-env/bin/zuul-cloner ]]; then elif [[ ! -d tests/common ]]; then # The tests repo doesn't need a clone, we can just - # symlink it. - if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then + # symlink it. As zuul v3 clones into a folder called + # 'workspace' we have to use one of its environment + # variables to determine the project name. + if [[ "${ZUUL_SHORT_PROJECT_NAME:-none}" == "openstack-ansible-tests" ]] ||\ + [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common + + # In zuul v3 any dependent repository is placed into + # /home/zuul/src/git.openstack.org, so we check to see + # if there is a tests checkout there already. If so, we + # symlink that and use it. + elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then + ln -s "${ZUUL_TESTS_CLONE_LOCATION}" ${WORKING_DIR}/tests/common + + # Otherwise we're clearly not in zuul or using a previously setup + # repo in some way, so just clone it from upstream. else git clone \ https://git.openstack.org/openstack/openstack-ansible-tests \ @@ -92,7 +110,7 @@ fi # tests repo are not supported. if [[ "${CLONE_UPGRADE_TESTS}" == "yes" ]]; then if [[ ! -d "${WORKING_DIR}/tests/common/previous" ]]; then - git clone -b stable/ocata \ + git clone -b stable/pike \ https://git.openstack.org/openstack/openstack-ansible-tests \ ${WORKING_DIR}/tests/common/previous fi diff --git a/vars/main.yml b/vars/main.yml index 7b09a8f0..4f926650 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -39,6 +39,9 @@ neutron_package_list: |- {% if neutron_services['neutron-vpnaas-agent']['group'] in group_names and neutron_vpnaas | bool %} {% set _ = packages.extend(neutron_vpnaas_distro_packages) %} {% endif %} + {% if neutron_developer_mode | bool %} + {% set _ = packages.extend(neutron_developer_mode_distro_packages) %} + {% endif %} {{ packages }} # Set the Calico Felix agent executable destination path diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 242d7d9b..42885932 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -27,11 +27,15 @@ neutron_distro_packages: - ebtables - haproxy - ipset + - iptables - iputils - keepalived - radvd - which +neutron_developer_mode_distro_packages: + - git + neutron_lxb_distro_packages: - bridge-utils diff --git a/vars/suse-42.yml b/vars/suse-42.yml index 71a0b5a6..f25ff00f 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -34,6 +34,9 @@ neutron_distro_packages: - radvd - which +neutron_developer_mode_distro_packages: + - git-core + neutron_lxb_distro_packages: - bridge-utils diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 4c7d6bfd..d89dff3c 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -31,10 +31,14 @@ neutron_distro_packages: - ebtables - haproxy - ipset + - iptables - iputils-arping - keepalived - radvd +neutron_developer_mode_distro_packages: + - git-core + neutron_lxb_distro_packages: - bridge-utils diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml new file mode 100644 index 00000000..b8ad2ba8 --- /dev/null +++ b/zuul.d/jobs.yaml @@ -0,0 +1,42 @@ +--- +# Copyright 2017, 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. + +- job: + name: openstack-ansible-ovs-ubuntu-xenial-nv + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: func_ovs + +- job: + name: openstack-ansible-calico-ubuntu-xenial-nv + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: calico + +- job: + name: openstack-ansible-dragonflow-ubuntu-xenial-nv + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: dragonflow + +- job: + name: openstack-ansible-opendaylight-ubuntu-xenial-nv + parent: openstack-ansible-functional-ubuntu-xenial + voting: false + vars: + tox_env: opendaylight diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 00000000..efbad9cd --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,35 @@ +--- +# Copyright 2017, 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. + +- project: + name: openstack/openstack-ansible-os_neutron + check: + jobs: + - openstack-ansible-functional-centos-7 + - openstack-ansible-functional-opensuse-423 + - openstack-ansible-functional-ubuntu-xenial + # - openstack-ansible-upgrade-ubuntu-xenial + - openstack-ansible-ovs-ubuntu-xenial-nv + - openstack-ansible-calico-ubuntu-xenial-nv + - openstack-ansible-dragonflow-ubuntu-xenial-nv + - openstack-ansible-opendaylight-ubuntu-xenial-nv + gate: + queue: openstack-ansible + jobs: + - openstack-ansible-functional-centos-7 + - openstack-ansible-functional-opensuse-423 + - openstack-ansible-functional-ubuntu-xenial + # - openstack-ansible-upgrade-ubuntu-xenial +