From 195813dd60ddfdef3465cdda9744d4cf65362f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Sun, 23 Feb 2020 17:14:47 +0100 Subject: [PATCH] CI: Add addressing on external network This is to allow CI testing of network connectivity. Note only "primary" node gets an address on it. Hence, "primary" becomes our fake external router. Depends-on: https://review.opendev.org/709361 Change-Id: I05592888796107d6de95b940c42b2bff73ac0669 --- tests/init-core-openstack.sh | 13 +++++++++++++ tests/pre.yml | 2 ++ tests/run.yml | 7 +++++++ zuul.d/base.yaml | 2 ++ 4 files changed, 24 insertions(+) diff --git a/tests/init-core-openstack.sh b/tests/init-core-openstack.sh index 02a445c4ce..d50e82b06b 100755 --- a/tests/init-core-openstack.sh +++ b/tests/init-core-openstack.sh @@ -12,6 +12,19 @@ function init_runonce { echo "Initialising OpenStack resources via init-runonce" tools/init-runonce &> /tmp/logs/ansible/init-runonce + + echo "Setting address on the external network bridge" + if [[ $SCENARIO == "linuxbridge" ]]; then + # NOTE(yoctozepto): linuxbridge agent manages its bridges by itself + # hence, we need to find the current name of the external network bridge + devname=$(basename $(readlink /sys/class/net/${EXT_NET_SLAVE_DEVICE}/master)) + else + devname=br-ex + # NOTE(yoctozepto): ovs virtual interfaces are down (not used) by default + # hence, we need to bring the external network bridge up + sudo ip link set ${devname} up + fi + sudo ip addr add ${EXT_NET_LOCAL_ADDR} dev ${devname} } diff --git a/tests/pre.yml b/tests/pre.yml index 504e650823..7dcf4b87c8 100644 --- a/tests/pre.yml +++ b/tests/pre.yml @@ -16,6 +16,8 @@ managed_network_prefix: "{{ api_network_prefix }}" managed_network_prefix_length: "{{ api_network_prefix_length }}" managed_network_address_family: "{{ address_family }}" + # NOTE(yoctozepto): no addressing for neutron_external_interface in here + # because it is enslaved by a bridge - role: multi-node-vxlan-overlay vars: vxlan_interface_name: "{{ neutron_external_interface_name }}" diff --git a/tests/run.yml b/tests/run.yml index e9bdfece58..f5f4251fdf 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -356,6 +356,13 @@ cmd: init-core-openstack.sh executable: /bin/bash chdir: "{{ kolla_ansible_src_dir }}" + environment: + EXT_NET_CIDR: "{{ neutron_external_network_prefix }}0/{{ neutron_external_network_prefix_length }}" + EXT_NET_RANGE: "start={{ neutron_external_network_prefix }}150,end={{ neutron_external_network_prefix }}199" + EXT_NET_GATEWAY: "{{ neutron_external_network_prefix }}1" + EXT_NET_LOCAL_ADDR: "{{ neutron_external_network_prefix }}1/{{ neutron_external_network_prefix_length }}" + EXT_NET_SLAVE_DEVICE: "{{ neutron_external_interface_name }}" + SCENARIO: "{{ scenario }}" when: openstack_core_tested or scenario in ['ironic', 'scenario_nfv', 'zun'] - name: Run test-core-openstack.sh script diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index dc30e6ac44..563674edcd 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -32,6 +32,8 @@ api_interface_name: vxlan0 kolla_internal_vip_address: "192.0.2.10" address_family: 'ipv4' + neutron_external_network_prefix: "198.51.100." + neutron_external_network_prefix_length: "24" neutron_external_interface_name: vxlan1 tls_enabled: false roles: