aboutsummaryrefslogtreecommitdiff
path: root/tests/init-core-openstack.sh
diff options
context:
space:
mode:
authorRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-02-23 17:14:47 +0100
committerRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-02-26 13:27:00 +0100
commit195813dd60ddfdef3465cdda9744d4cf65362f90 (patch)
treed1df9b7759ea5435c490a17b9f9285b7e4a6fcc5 /tests/init-core-openstack.sh
parent4ac7f6f3a0d1aa23aa805ccc261fd004ad9fe880 (diff)
downloadkolla-ansible-195813dd60ddfdef3465cdda9744d4cf65362f90.tar.gz
kolla-ansible-195813dd60ddfdef3465cdda9744d4cf65362f90.zip
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
Diffstat (limited to 'tests/init-core-openstack.sh')
-rwxr-xr-xtests/init-core-openstack.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/init-core-openstack.sh b/tests/init-core-openstack.sh
index 02a445c4c..d50e82b06 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}
}