X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-get-slave-addresses.sh;h=293f23658dedca2cffc0af8fe34da66295b0f2ec;hb=fd1319f04d729c56583feb758ad514f027daffee;hp=e498baab120d4d4fe564d0d643936c4cd4cc3908;hpb=01c4270a3ca956a414f262e7eefdc4242b6ed67c;p=releng%2Fbuilder.git diff --git a/jjb/integration/include-raw-integration-get-slave-addresses.sh b/jjb/integration/include-raw-integration-get-slave-addresses.sh index e498baab1..293f23658 100644 --- a/jjb/integration/include-raw-integration-get-slave-addresses.sh +++ b/jjb/integration/include-raw-integration-get-slave-addresses.sh @@ -2,21 +2,45 @@ ODL_SYSTEM=() TOOLS_SYSTEM=() +OPENSTACK_SYSTEM=() -IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}" +# TODO: Remove condition when we no longer use JClouds plugin +if [ -z "$JCLOUDS_IPS" ]; then + # If JCLOUDS_IPS is not set then we will spawn instances with + # OpenStack Heat. + source $WORKSPACE/.venv-openstack/bin/activate + CONTROLLER_IPS=`openstack --os-cloud rackspace stack show -f json -c outputs $STACK_NAME | jq -r '.outputs[] | select(.output_key=="vm_0_ips") | .output_value[]'` + MININET_IPS=`openstack --os-cloud rackspace stack show -f json -c outputs $STACK_NAME | jq -r '.outputs[] | select(.output_key=="vm_1_ips") | .output_value[]'` + ADDR=($CONTROLLER_IPS $MININET_IPS) +else + echo "OpenStack IPS are ${JCLOUDS_IPS}" + IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}" +fi for i in "${ADDR[@]}" do REMHOST=`ssh ${i} hostname` - if [ `echo ${REMHOST} | grep 'java\|devstack'` ]; then - ODL_SYSTEM=( "${ODL_SYSTEM[@]}" "${i}" ) - else - TOOLS_SYSTEM=( "${TOOLS_SYSTEM[@]}" "${i}" ) - fi + case ${REMHOST} in + *java*) + ODL_SYSTEM=( "${ODL_SYSTEM[@]}" "${i}" ) + ;; + *devstack*) + OPENSTACK_SYSTEM=( "${OPENSTACK_SYSTEM[@]}" "${i}" ) + ;; + *) + TOOLS_SYSTEM=( "${TOOLS_SYSTEM[@]}" "${i}" ) + ;; + esac done echo "NUM_ODL_SYSTEM=${#ODL_SYSTEM[@]}" >> slave_addresses.txt 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 + echo "NUM_OPENSTACK_SYSTEM=$(( ${#OPENSTACK_SYSTEM[@]} - 1 ))" >> slave_addresses.txt +else + echo "NUM_OPENSTACK_SYSTEM=${#OPENSTACK_SYSTEM[@]}" >> slave_addresses.txt +fi # Add alias for ODL_SYSTEM_1_IP as ODL_SYSTEM_IP echo "ODL_SYSTEM_IP=${ODL_SYSTEM[0]}" >> slave_addresses.txt @@ -32,4 +56,9 @@ do echo "TOOLS_SYSTEM_$((i+1))_IP=${TOOLS_SYSTEM[${i}]}" >> slave_addresses.txt done +echo "OPENSTACK_CONTROL_NODE_IP=${OPENSTACK_SYSTEM[0]}" >> slave_addresses.txt +for i in `seq 1 $(( ${#OPENSTACK_SYSTEM[@]} - 1 ))` +do + echo "OPENSTACK_COMPUTE_NODE_$((i))_IP=${OPENSTACK_SYSTEM[${i}]}" >> slave_addresses.txt +done # vim: sw=4 ts=4 sts=4 et ft=sh :