X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-get-slave-addresses.sh;h=9f57dfc7ae72388bb329bfc6da15c2545330008c;hb=3f313ec79d6e3a01899b60fb43736500e2cb6227;hp=22b7e624baf24b8a672e2d916f0d767fa433249a;hpb=3520ec2218d2e78739f7d195eca40113b66f3cd2;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-get-slave-addresses.sh b/jjb/integration/integration-get-slave-addresses.sh index 22b7e624b..9f57dfc7a 100644 --- a/jjb/integration/integration-get-slave-addresses.sh +++ b/jjb/integration/integration-get-slave-addresses.sh @@ -7,14 +7,11 @@ ODL_SYSTEM=() TOOLS_SYSTEM=() OPENSTACK_SYSTEM=() OPENSTACK_CONTROLLERS=() -[ "$NUM_OPENSTACK_SITES" ] || NUM_OPENSTACK_SITES=1 OPENSTACK_VENV="/tmp/v/openstack" # shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 source $OPENSTACK_VENV/bin/activate - -ADDR=($(openstack stack show -f json -c outputs "$STACK_NAME" | \ - jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]')) +mapfile -t ADDR <<< "$(openstack stack show -f json -c outputs "$STACK_NAME" | jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]')" # The next two blocks of code will parse the list of vm IP's hostnames to determine which type of node # the vm is: odl, devstack controller or compute, ha_proxy or tools. For the odl node's the hsotname will contain @@ -34,7 +31,7 @@ for i in "${ADDR[@]}" do REMHOST=$(ssh "${i}" hostname -s) case ${REMHOST} in - *java*) + *builder*) ODL_SYSTEM=( "${ODL_SYSTEM[@]}" "${i}" ) ;; *devstack*) @@ -56,7 +53,7 @@ echo "NUM_TOOLS_SYSTEM=${#TOOLS_SYSTEM[@]}" >> slave_addresses.txt #if HA Proxy is requested the last devstack node will be configured as haproxy if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then # HA Proxy is installed on one OPENSTACK_SYSTEM VM on each site - NUM_OPENSTACK_SYSTEM=$(( ${#OPENSTACK_SYSTEM[@]} - NUM_OPENSTACK_SITES )) + NUM_OPENSTACK_SYSTEM=$(( ${#OPENSTACK_SYSTEM[@]} - 1 )) else NUM_OPENSTACK_SYSTEM=${#OPENSTACK_SYSTEM[@]} fi @@ -93,7 +90,7 @@ done openstack_index=0 # Assuming number of openstack control nodes equals number of openstack sites -NUM_OPENSTACK_CONTROL_NODES=$(( NUM_OPENSTACK_SITES )) +NUM_OPENSTACK_CONTROL_NODES=1 echo "NUM_OPENSTACK_CONTROL_NODES=${NUM_OPENSTACK_CONTROL_NODES}" >> slave_addresses.txt for i in $(seq 0 $((NUM_OPENSTACK_CONTROL_NODES - 1))) do @@ -103,6 +100,15 @@ done # The rest of the openstack nodes until NUM_OPENSTACK_SYSTEM are computes NUM_OPENSTACK_COMPUTE_NODES=$(( NUM_OPENSTACK_SYSTEM - NUM_OPENSTACK_CONTROL_NODES )) echo "NUM_OPENSTACK_COMPUTE_NODES=${NUM_OPENSTACK_COMPUTE_NODES}" >> slave_addresses.txt + +# Order the computes in the list so that the devstack-0 is index 1 and devstack-1 is index 2. Currently they are +# backwards because of the controller swap earlier. +if [ ${NUM_OPENSTACK_COMPUTE_NODES} -ge 2 ]; then + tmp_addr=${OPENSTACK_SYSTEM[1]} + OPENSTACK_SYSTEM[1]=${OPENSTACK_SYSTEM[2]} + OPENSTACK_SYSTEM[2]=${tmp_addr} +fi + for i in $(seq 0 $((NUM_OPENSTACK_COMPUTE_NODES - 1))) do echo "OPENSTACK_COMPUTE_NODE_$((i+1))_IP=${OPENSTACK_SYSTEM[$((openstack_index++))]}" >> slave_addresses.txt