-if [[ "$USEFEATURESBOOT" != "True" ]]; then
-
- # wait up to 60s for karaf port 8101 to be opened, polling every 5s
- loop_count=0;
- until [[ \$loop_count -ge 12 ]]; do
- netstat -na | grep 8101 && break;
- loop_count=\$[\$loop_count+1];
- sleep 5;
- done
-
- echo "going to feature:install --no-auto-refresh ${SPACE_SEPARATED_FEATURES} one at a time"
- for feature in ${SPACE_SEPARATED_FEATURES}; do
- sshpass -p karaf ssh -o StrictHostKeyChecking=no \
- -o UserKnownHostsFile=/dev/null \
- -o LogLevel=error \
- -p 8101 karaf@localhost \
- feature:install --no-auto-refresh \$feature;
- done
-
- echo "ssh to karaf console to list -i installed features"
- sshpass -p karaf ssh -o StrictHostKeyChecking=no \
- -o UserKnownHostsFile=/dev/null \
- -o LogLevel=error \
- -p 8101 karaf@localhost \
- feature:list -i
-fi
-
-echo "Waiting up to 3 minutes for controller to come up, checking every 5 seconds..."
-for i in {1..36};
- do sleep 5;
- grep 'org.opendaylight.infrautils.ready-impl.*System ready' /tmp/${BUNDLEFOLDER}/data/log/karaf.log
- if [ \$? -eq 0 ]
- then
- echo "Controller is UP"
- break
- fi
-done;
-
-# if we ended up not finding ready status in the above loop, we can output some debugs
-grep 'org.opendaylight.infrautils.ready-impl.*System ready' /tmp/${BUNDLEFOLDER}/data/log/karaf.log
-if [ $? -ne 0 ]
-then
- echo "Timeout Controller DOWN"
- echo "Dumping first 500K bytes of karaf log..."
- head --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"
- echo "Dumping last 500K bytes of karaf log..."
- tail --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"
- echo "Listing all open ports on controller system"
- netstat -pnatu
- exit 1
-fi
-
-echo "Listing all open ports on controller system..."
-netstat -pnatu
-
-function exit_on_log_file_message {
- echo "looking for \"\$1\" in log file"
- if grep --quiet "\$1" "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"; then
- echo ABORTING: found "\$1"
- echo "Dumping first 500K bytes of karaf log..."
- head --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"
- echo "Dumping last 500K bytes of karaf log..."
- tail --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"
- exit 1
- fi
-}
-
-exit_on_log_file_message 'BindException: Address already in use'
-exit_on_log_file_message 'server is unhealthy'
-
-EOF
-# cat > ${WORKSPACE}/post-startup-script.sh <<EOF
-
-[ "$NUM_OPENSTACK_SITES" ] || NUM_OPENSTACK_SITES=1
-NUM_ODLS_PER_SITE=$((NUM_ODL_SYSTEM / NUM_OPENSTACK_SITES))
-for i in `seq 1 ${NUM_OPENSTACK_SITES}`
-do
- # Get full list of ODL nodes for this site
- odl_node_list=
- for j in `seq 1 ${NUM_ODLS_PER_SITE}`
- do
- odl_ip=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
- odl_node_list="${odl_node_list} ${!odl_ip}"
- done
-
- for j in `seq 1 ${NUM_ODLS_PER_SITE}`
- do
- odl_ip=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
- # Copy over the config script to controller and execute it (parameters are used only for cluster)
- echo "Execute the configuration script on controller ${!odl_ip} for index $j with node list ${odl_node_list}"
- scp ${WORKSPACE}/configuration-script.sh ${!odl_ip}:/tmp
- ssh ${!odl_ip} "bash /tmp/configuration-script.sh ${j} '${odl_node_list}'"
- done
-done