From 4327934d160a3d289b3732ea1d92453707bbe261 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 13 Feb 2017 16:30:01 -0500 Subject: CSIT: Fixes bug with routes and compute nodes Change-Id: I2b5625ce9458ff4438ffc556bb08c4d6a6ace03d Signed-off-by: Tim Rozet --- jjb/apex/apex-snapshot-deploy.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'jjb/apex') diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh index dcae0c14d..8274740c8 100644 --- a/jjb/apex/apex-snapshot-deploy.sh +++ b/jjb/apex/apex-snapshot-deploy.sh @@ -81,6 +81,12 @@ if [ -z "$virsh_networks" ]; then exit 1 fi +echo "Checking overcloudrc" +if ! stat overcloudrc; then + echo "ERROR: overcloudrc does not exist in snap unpack" + exit 1 +fi + for network_def in ${virsh_networks}; do sudo virsh net-create ${network_def} network=$(echo ${network_def} | awk -F '.' '{print $1}') @@ -99,12 +105,16 @@ for network_def in ${virsh_networks}; do echo "Configuring IP 192.168.37.1 on br-external" sudo ip addr add 192.168.37.1/24 dev br-external sudo ip link set up dev br-external - # Route for admin network + # Routes for admin network # The overcloud controller is multi-homed and will fail to respond # to traffic from the functest container due to reverse-path-filtering # This route allows reverse traffic, by forcing admin network destined - # traffic through the external network - sudo ip route add 192.0.2.0/25 dev br-external + # traffic through the external network for controller IPs only. + # Compute nodes have no ip on external interfaces. + controller_ips=$(cat overcloudrc | grep -Eo "192.0.2.[0-9]+") + for ip in $controller_ips; do + sudo ip route add ${ip}/32 dev br-external + done fi fi done @@ -126,17 +136,11 @@ for node_def in ${virsh_vm_defs}; do echo "Node: ${node} started" done -echo "Checking overcloudrc" -if ! stat overcloudrc; then - echo "ERROR: overcloudrc does not exist in snap unpack" - exit 1 -fi - # copy overcloudrc for functest mkdir -p $HOME/cloner-info cp -f overcloudrc $HOME/cloner-info/ -admin_controller_ip=$(cat overcloudrc | grep -Eo "192.0.2.[0-9]+") +admin_controller_ip=$(cat overcloudrc | grep -Eo -m 1 "192.0.2.[0-9]+") netvirt_url="http://${admin_controller_ip}:8081/restconf/operational/network-topology:network-topology/topology/netvirt:1" source overcloudrc -- cgit 1.2.3-korg