Increase ocata packer timeout from 60m to 75m
[releng/builder.git] / jjb / integration / integration-deploy-openstack-run-test.sh
1 #!/bin/bash
2 # Activate robotframework virtualenv
3 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
4 # script.
5 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
6 source ${ROBOT_VENV}/bin/activate
7 PYTHON="${ROBOT_VENV}/bin/python"
8 SSH="ssh -t -t"
9 ADMIN_PASSWORD=admin
10
11 # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level
12 echo "showing recent changes that made it in to the distribution used by this job"
13 $PYTHON -m pip install --upgrade urllib3
14 python ${WORKSPACE}/test/tools/distchanges/changes.py -d /tmp/distribution_folder \
15                   -u ${ACTUAL_BUNDLE_URL} -b ${DISTROBRANCH} \
16                   -r ssh://jenkins-${SILO}@git.opendaylight.org:29418 || true
17 cat << EOF
18 #################################################
19 ##         Deploy Openstack 3-node             ##
20 #################################################
21 EOF
22
23 # Catch command errors and collect logs.
24 # This ensures logs are collected when script commands fail rather than simply exiting.
25 function trap_handler() {
26     local prog="$0"
27     local lastline="$1"
28     local lasterr="$2"
29     echo "${prog}: line ${lastline}: exit status of last command: ${lasterr}"
30     echo "command: ${BASH_COMMAND}"
31     collect_logs
32     exit 1
33 } # trap_handler()
34
35 trap 'trap_handler ${LINENO} ${$?}' ERR
36
37 function print_job_parameters() {
38     cat << EOF
39
40 Job parameters:
41 DISTROBRANCH: ${DISTROBRANCH}
42 DISTROSTREAM: ${DISTROSTREAM}
43 BUNDLE_URL: ${BUNDLE_URL}
44 CONTROLLERFEATURES: ${CONTROLLERFEATURES}
45 CONTROLLERDEBUGMAP: ${CONTROLLERDEBUGMAP}
46 TESTPLAN: ${TESTPLAN}
47 SUITES: ${SUITES}
48 PATCHREFSPEC: ${PATCHREFSPEC}
49 OPENSTACK_BRANCH: ${OPENSTACK_BRANCH}
50 DEVSTACK_HASH: ${DEVSTACK_HASH}
51 ODL_ML2_DRIVER_REPO: ${ODL_ML2_DRIVER_REPO}
52 ODL_ML2_BRANCH: ${ODL_ML2_BRANCH}
53 ODL_ML2_DRIVER_VERSION: ${ODL_ML2_DRIVER_VERSION}
54 ODL_ML2_PORT_BINDING: ${ODL_ML2_PORT_BINDING}
55 DEVSTACK_KUBERNETES_PLUGIN_REPO: ${DEVSTACK_KUBERNETES_PLUGIN_REPO}
56 DEVSTACK_LBAAS_PLUGIN_REPO: ${DEVSTACK_LBAAS_PLUGIN_REPO}
57 DEVSTACK_NETWORKING_SFC_PLUGIN_REPO: ${DEVSTACK_NETWORKING_SFC_PLUGIN_REPO}
58 ODL_ENABLE_L3_FWD: ${ODL_ENABLE_L3_FWD}
59 IPSEC_VXLAN_TUNNELS_ENABLED: ${IPSEC_VXLAN_TUNNELS_ENABLED}
60 PUBLIC_BRIDGE: ${PUBLIC_BRIDGE}
61 ENABLE_HAPROXY_FOR_NEUTRON: ${ENABLE_HAPROXY_FOR_NEUTRON}
62 ENABLE_OS_SERVICES: ${ENABLE_OS_SERVICES}
63 ENABLE_OS_COMPUTE_SERVICES: ${ENABLE_OS_COMPUTE_SERVICES}
64 ENABLE_OS_PLUGINS: ${ENABLE_OS_PLUGINS}
65 DISABLE_OS_SERVICES: ${DISABLE_OS_SERVICES}
66 TENANT_NETWORK_TYPE: ${TENANT_NETWORK_TYPE}
67 SECURITY_GROUP_MODE: ${SECURITY_GROUP_MODE}
68 PUBLIC_PHYSICAL_NETWORK: ${PUBLIC_PHYSICAL_NETWORK}
69 ENABLE_NETWORKING_L2GW: ${ENABLE_NETWORKING_L2GW}
70 CREATE_INITIAL_NETWORKS: ${CREATE_INITIAL_NETWORKS}
71 LBAAS_SERVICE_PROVIDER: ${LBAAS_SERVICE_PROVIDER}
72 NUM_OPENSTACK_SITES: ${NUM_OPENSTACK_SITES}
73 ODL_SFC_DRIVER: ${ODL_SFC_DRIVER}
74 ODL_SNAT_MODE: ${ODL_SNAT_MODE}
75
76 EOF
77 }
78
79 print_job_parameters
80
81 function create_etc_hosts() {
82     NODE_IP=$1
83     CTRL_IP=$2
84     : > ${WORKSPACE}/hosts_file
85     for iter in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`
86     do
87         COMPUTE_IP=OPENSTACK_COMPUTE_NODE_${iter}_IP
88         if [ "${!COMPUTE_IP}" == "${NODE_IP}" ]; then
89            CONTROL_HNAME=$(${SSH}  ${CTRL_IP}  "hostname")
90            echo "${CTRL_IP}   ${CONTROL_HNAME}" >> ${WORKSPACE}/hosts_file
91         else
92            COMPUTE_HNAME=$(${SSH}  ${!COMPUTE_IP}  "hostname")
93            echo "${!COMPUTE_IP}   ${COMPUTE_HNAME}" >> ${WORKSPACE}/hosts_file
94         fi
95     done
96
97     echo "Created the hosts file for ${NODE_IP}:"
98     cat ${WORKSPACE}/hosts_file
99 } # create_etc_hosts()
100
101 # convert commas in csv strings to spaces (ssv)
102 function csv2ssv() {
103     local csv=$1
104     if [ -n "${csv}" ]; then
105         ssv=$(echo ${csv} | sed 's/,/ /g' | sed 's/\ \ */\ /g')
106     fi
107
108     echo "${ssv}"
109 } # csv2ssv
110
111 # Add enable_services and disable_services to the local.conf
112 function add_os_services() {
113     local core_services=$1
114     local enable_services=$2
115     local disable_services=$3
116     local local_conf_file_name=$4
117
118     cat >> ${local_conf_file_name} << EOF
119 enable_service $(csv2ssv "${core_services}")
120 EOF
121     if [ -n "${enable_services}" ]; then
122         cat >> ${local_conf_file_name} << EOF
123 enable_service $(csv2ssv "${enable_services}")
124 EOF
125     fi
126     if [ -n "${disable_services}" ]; then
127         cat >> ${local_conf_file_name} << EOF
128 disable_service $(csv2ssv "${disable_services}")
129 EOF
130     fi
131 }
132
133 function create_control_node_local_conf() {
134     HOSTIP=$1
135     MGRIP=$2
136     ODL_OVS_MANAGERS="$3"
137
138     local_conf_file_name=${WORKSPACE}/local.conf_control_${HOSTIP}
139     cat > ${local_conf_file_name} << EOF
140 [[local|localrc]]
141 LOGFILE=stack.sh.log
142 USE_SCREEN=True
143 SCREEN_LOGDIR=/opt/stack/data/log
144 LOG_COLOR=False
145 RECLONE=${RECLONE}
146
147 disable_all_services
148 EOF
149
150     add_os_services "${CORE_OS_CONTROL_SERVICES}" "${ENABLE_OS_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}"
151
152     cat >> ${local_conf_file_name} << EOF
153
154 HOST_IP=${HOSTIP}
155 SERVICE_HOST=\$HOST_IP
156 Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE}
157 NEUTRON_CREATE_INITIAL_NETWORKS=${CREATE_INITIAL_NETWORKS}
158
159 ODL_MODE=manual
160 ODL_MGR_IP=${MGRIP}
161 ODL_PORT=8080
162 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
163 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
164
165 MYSQL_HOST=\$SERVICE_HOST
166 RABBIT_HOST=\$SERVICE_HOST
167 GLANCE_HOSTPORT=\$SERVICE_HOST:9292
168 KEYSTONE_AUTH_HOST=\$SERVICE_HOST
169 KEYSTONE_SERVICE_HOST=\$SERVICE_HOST
170
171 ADMIN_PASSWORD=${ADMIN_PASSWORD}
172 DATABASE_PASSWORD=${ADMIN_PASSWORD}
173 RABBIT_PASSWORD=${ADMIN_PASSWORD}
174 SERVICE_TOKEN=${ADMIN_PASSWORD}
175 SERVICE_PASSWORD=${ADMIN_PASSWORD}
176
177 NEUTRON_LBAAS_SERVICE_PROVIDERV2=${LBAAS_SERVICE_PROVIDER} # Only relevant if neutron-lbaas plugin is enabled
178 NEUTRON_SFC_DRIVERS=${ODL_SFC_DRIVER} # Only relevant if networking-sfc plugin is enabled
179 NEUTRON_FLOWCLASSIFIER_DRIVERS=${ODL_SFC_DRIVER} # Only relevant if networking-sfc plugin is enabled
180 ETCD_PORT=2379
181 EOF
182
183     if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then
184         echo "ODL_V2DRIVER=True" >> ${local_conf_file_name}
185     fi
186
187     IFS=,
188     for plugin_name in ${ENABLE_OS_PLUGINS}; do
189         if [ "$plugin_name" == "networking-odl" ]; then
190             ENABLE_PLUGIN_ARGS="${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}"
191         elif [ "$plugin_name" == "kuryr-kubernetes" ]; then
192             ENABLE_PLUGIN_ARGS="${DEVSTACK_KUBERNETES_PLUGIN_REPO} master" # note: kuryr-kubernetes only exists in master at the moment
193         elif [ "$plugin_name" == "neutron-lbaas" ]; then
194             ENABLE_PLUGIN_ARGS="${DEVSTACK_LBAAS_PLUGIN_REPO} ${OPENSTACK_BRANCH}"
195             IS_LBAAS_PLUGIN_ENABLED="yes"
196         elif [ "$plugin_name" == "networking-sfc" ]; then
197             ENABLE_PLUGIN_ARGS="${DEVSTACK_NETWORKING_SFC_PLUGIN_REPO} ${OPENSTACK_BRANCH}"
198         else
199             echo "Error: Invalid plugin $plugin_name, unsupported"
200             continue
201         fi
202         cat >> ${local_conf_file_name} << EOF
203
204 enable_plugin ${plugin_name} ${ENABLE_PLUGIN_ARGS}
205 EOF
206     done
207     unset IFS
208
209     if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then
210         cat >> ${local_conf_file_name} << EOF
211
212 enable_plugin networking-l2gw ${NETWORKING_L2GW_DRIVER} ${ODL_ML2_BRANCH}
213 NETWORKING_L2GW_SERVICE_DRIVER=L2GW:OpenDaylight:networking_odl.l2gateway.driver.OpenDaylightL2gwDriver:default
214 EOF
215     fi
216
217     if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
218         cat >> ${local_conf_file_name} << EOF
219
220 PUBLIC_BRIDGE=${PUBLIC_BRIDGE}
221 PUBLIC_PHYSICAL_NETWORK=${PUBLIC_PHYSICAL_NETWORK}
222 ML2_VLAN_RANGES=${PUBLIC_PHYSICAL_NETWORK}
223 ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS}
224 EOF
225
226         if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then
227            SERVICE_PLUGINS="odl-router_v2"
228         else
229            SERVICE_PLUGINS="odl-router"
230         fi
231         if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then
232             SERVICE_PLUGINS+=", networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin"
233         fi
234         if [ "${IS_LBAAS_PLUGIN_ENABLED}" == "yes" ]; then
235             SERVICE_PLUGINS+=", lbaasv2"
236         fi
237     fi #check for ODL_ENABLE_L3_FWD
238
239     cat >> ${local_conf_file_name} << EOF
240
241 [[post-config|\$NEUTRON_CONF]]
242 [DEFAULT]
243 service_plugins = ${SERVICE_PLUGINS}
244
245 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
246 [agent]
247 minimize_polling=True
248
249 [ml2]
250 # Needed for VLAN provider tests - because our provider networks are always encapsulated in VXLAN (br-physnet1)
251 # MTU(1400) + VXLAN(50) + VLAN(4) = 1454 < MTU eth0/br-physnet1(1458)
252 physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1400
253 path_mtu = 1458
254
255 # workaround for port-status not working due to https://bugs.opendaylight.org/show_bug.cgi?id=9092
256 [ml2_odl]
257 odl_features=nothing
258
259 [[post-config|/etc/neutron/dhcp_agent.ini]]
260 [DEFAULT]
261 force_metadata = True
262 enable_isolated_metadata = True
263
264 [[post-config|/etc/nova/nova.conf]]
265 [DEFAULT]
266 force_config_drive = False
267
268 [scheduler]
269 discover_hosts_in_cells_interval = 30
270 EOF
271
272     echo "Control local.conf created:"
273     cat ${local_conf_file_name}
274 } # create_control_node_local_conf()
275
276 function create_compute_node_local_conf() {
277     HOSTIP=$1
278     SERVICEHOST=$2
279     MGRIP=$3
280     ODL_OVS_MANAGERS="$4"
281
282     local_conf_file_name=${WORKSPACE}/local.conf_compute_${HOSTIP}
283     cat > ${local_conf_file_name} << EOF
284 [[local|localrc]]
285 LOGFILE=stack.sh.log
286 LOG_COLOR=False
287 USE_SCREEN=True
288 SCREEN_LOGDIR=/opt/stack/data/log
289 RECLONE=${RECLONE}
290
291 disable_all_services
292 EOF
293
294     add_os_services "${CORE_OS_COMPUTE_SERVICES}" "${ENABLE_OS_COMPUTE_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}"
295
296     cat >> ${local_conf_file_name} << EOF
297
298 HOST_IP=${HOSTIP}
299 SERVICE_HOST=${SERVICEHOST}
300 Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE}
301
302 ODL_MODE=manual
303 ODL_MGR_IP=${MGRIP}
304 ODL_PORT=8080
305 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
306 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
307
308 Q_HOST=\$SERVICE_HOST
309 MYSQL_HOST=\$SERVICE_HOST
310 RABBIT_HOST=\$SERVICE_HOST
311 GLANCE_HOSTPORT=\$SERVICE_HOST:9292
312 KEYSTONE_AUTH_HOST=\$SERVICE_HOST
313 KEYSTONE_SERVICE_HOST=\$SERVICE_HOST
314
315 ADMIN_PASSWORD=${ADMIN_PASSWORD}
316 DATABASE_PASSWORD=${ADMIN_PASSWORD}
317 RABBIT_PASSWORD=${ADMIN_PASSWORD}
318 SERVICE_TOKEN=${ADMIN_PASSWORD}
319 SERVICE_PASSWORD=${ADMIN_PASSWORD}
320 EOF
321
322     if [[ "${ENABLE_OS_PLUGINS}" =~ networking-odl ]]; then
323         cat >> ${local_conf_file_name} << EOF
324
325 enable_plugin networking-odl ${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}
326 EOF
327     fi
328
329     if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
330         cat >> ${local_conf_file_name} << EOF
331
332 PUBLIC_BRIDGE=${PUBLIC_BRIDGE}
333 PUBLIC_PHYSICAL_NETWORK=${PUBLIC_PHYSICAL_NETWORK}
334 ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS}
335 Q_L3_ENABLED=True
336 ODL_L3=${ODL_L3}
337 EOF
338     fi
339
340     cat >> ${local_conf_file_name} << EOF
341
342 [[post-config|/etc/nova/nova.conf]]
343 [api]
344 auth_strategy = keystone
345 [DEFAULT]
346 use_neutron = True
347 EOF
348
349     echo "Compute local.conf created:"
350     cat ${local_conf_file_name}
351 } # create_compute_node_local_conf()
352
353 function configure_haproxy_for_neutron_requests() {
354     MGRIP=$1
355     ODL_IPS=(${2//,/ })
356
357     cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
358 sudo systemctl stop firewalld
359 sudo yum -y install policycoreutils-python haproxy
360 EOF
361
362 cat > ${WORKSPACE}/haproxy.cfg << EOF
363 global
364   daemon
365   group  haproxy
366   log  /dev/log local0
367   maxconn  20480
368   pidfile  /tmp/haproxy.pid
369   user  haproxy
370
371 defaults
372   log  global
373   maxconn  4096
374   mode  tcp
375   retries  3
376   timeout  http-request 10s
377   timeout  queue 1m
378   timeout  connect 10s
379   timeout  client 1m
380   timeout  server 1m
381   timeout  check 10s
382
383 listen opendaylight
384   bind ${MGRIP}:8080
385   balance source
386 EOF
387
388     odlindex=1
389     for odlip in ${ODL_IPS[*]}; do
390         cat >> ${WORKSPACE}/haproxy.cfg << EOF
391   server controller-${odlindex} ${odlip}:8080 check fall 5 inter 2000 rise 2
392 EOF
393         odlindex=$((odlindex+1))
394     done
395
396     cat >> ${WORKSPACE}/haproxy.cfg << EOF
397 listen opendaylight_rest
398   bind ${MGRIP}:8181
399   balance source
400 EOF
401
402     odlindex=1
403     for odlip in ${ODL_IPS[*]}; do
404         cat >> ${WORKSPACE}/haproxy.cfg << EOF
405   server controller-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2
406 EOF
407         odlindex=$((odlindex+1))
408     done
409
410     echo "Dump haproxy.cfg"
411     cat ${WORKSPACE}/haproxy.cfg
412
413     cat > ${WORKSPACE}/deploy_ha_proxy.sh<< EOF
414 sudo chown haproxy:haproxy /tmp/haproxy.cfg
415 sudo sed -i 's/\\/etc\\/haproxy\\/haproxy.cfg/\\/tmp\\/haproxy.cfg/g' /usr/lib/systemd/system/haproxy.service
416 sudo /usr/sbin/semanage permissive -a haproxy_t
417 sudo systemctl restart haproxy
418 sleep 3
419 sudo netstat -tunpl
420 sudo systemctl status haproxy
421 true
422 EOF
423
424     scp ${WORKSPACE}/install_ha_proxy.sh ${MGRIP}:/tmp
425     ${SSH} ${MGRIP} "sudo bash /tmp/install_ha_proxy.sh"
426     scp ${WORKSPACE}/haproxy.cfg ${MGRIP}:/tmp
427     scp ${WORKSPACE}/deploy_ha_proxy.sh ${MGRIP}:/tmp
428     ${SSH} ${MGRIP} "sudo bash /tmp/deploy_ha_proxy.sh"
429 } # configure_haproxy_for_neutron_requests()
430
431 # Collect the list of files on the hosts
432 function list_files () {
433     local ip=$1
434     local folder=$2
435     ${SSH} ${ip} "sudo find /etc > /tmp/find.etc.txt"
436     ${SSH} ${ip} "sudo find /opt/stack > /tmp/find.opt.stack.txt"
437     ${SSH} ${ip} "sudo find /var > /tmp/find2.txt"
438     ${SSH} ${ip} "sudo find /var > /tmp/find.var.txt"
439     rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${folder}/rsync.etc.txt
440     rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${folder}/rsync.opt.stack.txt
441     rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${folder}/rsync.var.txt
442     scp ${ip}:/tmp/find.etc.txt ${folder}
443     scp ${ip}:/tmp/find.opt.stack.txt ${folder}
444     scp ${ip}:/tmp/find2.txt ${folder}
445     scp ${ip}:/tmp/find.var.txt ${folder}
446 }
447
448 function collect_logs () {
449     set +e  # We do not want to create red dot just because something went wrong while fetching logs.
450
451     cat > extra_debug.sh << EOF
452 echo -e "/usr/sbin/lsmod | /usr/bin/grep openvswitch\n"
453 /usr/sbin/lsmod | /usr/bin/grep openvswitch
454 echo -e "\ngrep ct_ /var/log/openvswitch/ovs-vswitchd.log\n"
455 grep ct_ /var/log/openvswitch/ovs-vswitchd.log
456 echo -e "\novsdb-tool -mm show-log\n"
457 ovsdb-tool -mm show-log
458 echo -e "\nsudo netstat -punta\n"
459 sudo netstat -punta
460 echo -e "\nsudo getenforce\n"
461 sudo getenforce
462 echo -e "\njournalctl > /tmp/journalctl.log\n"
463 sudo journalctl > /tmp/journalctl.log
464 echo -e "\nsudo systemctl status httpd\n"
465 sudo systemctl status httpd
466 echo -e "\nenv\n"
467 env
468 source /opt/stack/devstack/openrc admin admin
469 echo -e "\nenv after openrc\n"
470 env
471 echo "\nsudo du -hs /opt/stack"
472 sudo du -hs /opt/stack
473 echo "\nsudo mount"
474 sudo mount
475 EOF
476
477     # Since this log collection work is happening before the archive build macro which also
478     # creates the ${WORKSPACE}/archives dir, we have to do it here first.  The mkdir in the
479     # archives build step will essentially be a noop.
480     mkdir -p ${WORKSPACE}/archives
481
482     sleep 5
483     # FIXME: Do not create .tar and gzip before copying.
484     for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
485         CONTROLLERIP=ODL_SYSTEM_${i}_IP
486         echo "collect_logs: for opendaylight controller ip: ${!CONTROLLERIP}"
487         NODE_FOLDER="odl_${i}"
488         mkdir -p ${NODE_FOLDER}
489         echo "Lets's take the karaf thread dump again..."
490         ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_after.log
491         pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_after.log | grep -v grep | tr -s ' ' | cut -f2 -d' ')
492         echo "karaf main: org.apache.karaf.main.Main, pid:${pid}"
493         ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_after.log || true
494         echo "killing karaf process..."
495         ${SSH} "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
496         ${SSH} ${!CONTROLLERIP} "sudo journalctl > /tmp/journalctl.log"
497         scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER}
498         ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
499         scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
500         ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
501         ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
502         scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER}
503         ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log"
504         scp ${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar ${NODE_FOLDER}
505         tar -xvf ${NODE_FOLDER}/odl${i}_karaf.log.tar -C ${NODE_FOLDER} --strip-components 2 --transform s/karaf/odl${i}_karaf/g
506         grep "ROBOT MESSAGE\| ERROR " ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err.log
507         grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" \
508             ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err_warn_exception.log
509         # Print ROBOT lines and print Exception lines. For exception lines also print the previous line for context
510         sed -n -e '/ROBOT MESSAGE/P' -e '$!N;/Exception/P;D' ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_exception.log
511         rm ${NODE_FOLDER}/odl${i}_karaf.log.tar
512         mv *_threads* ${NODE_FOLDER}
513         mv ps_* ${NODE_FOLDER}
514         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
515     done
516
517     print_job_parameters > ${WORKSPACE}/archives/params.txt
518
519     # Control Node
520     for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
521         OSIP=OPENSTACK_CONTROL_NODE_${i}_IP
522         echo "collect_logs: for openstack control node ip: ${!OSIP}"
523         NODE_FOLDER="control_${i}"
524         mkdir -p ${NODE_FOLDER}
525         scp ${!OSIP}:/etc/dnsmasq.conf ${NODE_FOLDER}
526         scp ${!OSIP}:/etc/keystone/keystone.conf ${NODE_FOLDER}
527         scp ${!OSIP}:/etc/keystone/keystone-uwsgi-admin.ini ${NODE_FOLDER}
528         scp ${!OSIP}:/etc/keystone/keystone-uwsgi-public.ini ${NODE_FOLDER}
529         scp ${!OSIP}:/etc/kuryr/kuryr.conf ${NODE_FOLDER}
530         scp ${!OSIP}:/etc/neutron/dhcp_agent.ini ${NODE_FOLDER}
531         scp ${!OSIP}:/etc/neutron/metadata_agent.ini ${NODE_FOLDER}
532         scp ${!OSIP}:/etc/neutron/neutron.conf ${NODE_FOLDER}
533         scp ${!OSIP}:/etc/neutron/neutron_lbaas.conf ${NODE_FOLDER}
534         scp ${!OSIP}:/etc/neutron/plugins/ml2/ml2_conf.ini ${NODE_FOLDER}
535         scp ${!OSIP}:/etc/neutron/services/loadbalancer/haproxy/lbaas_agent.ini ${NODE_FOLDER}
536         scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER}
537         scp ${!OSIP}:/etc/nova/nova-api-uwsgi.ini ${NODE_FOLDER}
538         scp ${!OSIP}:/etc/nova/nova_cell1.conf ${NODE_FOLDER}
539         scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER}
540         scp ${!OSIP}:/etc/nova/placement-uwsgi.ini ${NODE_FOLDER}
541         scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER}
542         scp ${!OSIP}:/opt/stack/devstack/.stackenv ${NODE_FOLDER}
543         scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log
544         scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER}
545         scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
546         scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER}
547         scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
548         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
549         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
550         list_files "${!OSIP}" "${NODE_FOLDER}"
551         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
552         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER}
553         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
554         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone_access.log ${NODE_FOLDER}
555         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone.log ${NODE_FOLDER}
556         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
557         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/rabbitmq ${NODE_FOLDER}
558         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
559         scp extra_debug.sh ${!OSIP}:/tmp
560         ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
561         scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
562         scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
563         scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}
564         ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
565         scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
566         mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf
567         mv /tmp/qdhcp ${NODE_FOLDER}
568         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
569     done
570
571     # Compute Nodes
572     for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
573         OSIP=OPENSTACK_COMPUTE_NODE_${i}_IP
574         echo "collect_logs: for openstack compute node ip: ${!OSIP}"
575         NODE_FOLDER="compute_${i}"
576         mkdir -p ${NODE_FOLDER}
577         scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER}
578         scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER}
579         scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER}
580         scp ${!OSIP}:/opt/stack/devstack/.stackenv ${NODE_FOLDER}
581         scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log
582         scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER}
583         scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
584         scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
585         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
586         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
587         list_files "${!OSIP}" "${NODE_FOLDER}"
588         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
589         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
590         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/libvirt ${NODE_FOLDER}
591         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
592         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${NODE_FOLDER}
593         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
594         scp extra_debug.sh ${!OSIP}:/tmp
595         ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
596         scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
597         scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
598         scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/
599         ${SSH} ${!OSIP} "dmesg -T > /tmp/dmesg.log"
600         scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER}
601         mv local.conf_compute_${!OSIP} ${NODE_FOLDER}/local.conf
602         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
603     done
604
605     # Tempest
606     DEVSTACK_TEMPEST_DIR="/opt/stack/tempest"
607     TESTREPO=".stestr"
608     TEMPEST_LOGS_DIR=${WORKSPACE}/archives/tempest
609     # Look for tempest test results in the $TESTREPO dir and copy if found
610     if ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "sudo sh -c '[ -f ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0 ]'"; then
611         ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "for I in \$(sudo ls ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/ | grep -E '^[0-9]+$'); do sudo sh -c \"${DEVSTACK_TEMPEST_DIR}/.tox/tempest/bin/subunit-1to2 < ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/\${I} >> ${DEVSTACK_TEMPEST_DIR}/subunit_log.txt\"; done"
612         ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "sudo sh -c '${DEVSTACK_TEMPEST_DIR}/.tox/tempest/bin/python ${DEVSTACK_TEMPEST_DIR}/.tox/tempest/lib/python2.7/site-packages/os_testr/subunit2html.py ${DEVSTACK_TEMPEST_DIR}/subunit_log.txt ${DEVSTACK_TEMPEST_DIR}/tempest_results.html'"
613         mkdir -p ${TEMPEST_LOGS_DIR}
614         scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest_results.html ${TEMPEST_LOGS_DIR}
615         scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest.log ${TEMPEST_LOGS_DIR}
616         mv ${WORKSPACE}/tempest_output* ${TEMPEST_LOGS_DIR}
617     else
618         echo "tempest results not found in ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0"
619     fi
620 } # collect_logs()
621
622 # Following three functions are debugging helpers when debugging devstack changes.
623 # Keeping them for now so we can simply call them when needed.
624 ctrlhn=""
625 comp1hn=""
626 comp2hn=""
627 function get_hostnames () {
628     set +e
629     local ctrlip=${OPENSTACK_CONTROL_NODE_1_IP}
630     local comp1ip=${OPENSTACK_COMPUTE_NODE_1_IP}
631     local comp2ip=${OPENSTACK_COMPUTE_NODE_2_IP}
632     ctrlhn=$(${SSH} ${ctrlip} "hostname")
633     comp1hn=$(${SSH} ${comp1ip} "hostname")
634     comp2hn=$(${SSH} ${comp2ip} "hostname")
635     echo "hostnames: ${ctrlhn}, ${comp1hn}, ${comp2hn}"
636     set -e
637 }
638
639 function check_firewall() {
640     set +e
641     echo $-
642     local ctrlip=${OPENSTACK_CONTROL_NODE_1_IP}
643     local comp1ip=${OPENSTACK_COMPUTE_NODE_1_IP}
644     local comp2ip=${OPENSTACK_COMPUTE_NODE_2_IP}
645
646     echo "check_firewall on control"
647     ${SSH} ${ctrlip} "
648         sudo systemctl status firewalld
649         sudo systemctl -l status iptables
650         sudo iptables --line-numbers -nvL
651     " || true
652     echo "check_firewall on compute 1"
653     ${SSH} ${comp1ip} "
654         sudo systemctl status firewalld
655         sudo systemctl -l status iptables
656         sudo iptables --line-numbers -nvL
657     " || true
658     echo "check_firewall on compute 2"
659     ${SSH} ${comp2ip} "
660         sudo systemctl status firewalld
661         sudo systemctl -l status iptables
662         sudo iptables --line-numbers -nvL
663     " || true
664 }
665
666 function get_service () {
667     set +e
668     local iter=$1
669     #local idx=$2
670     local ctrlip=${OPENSTACK_CONTROL_NODE_1_IP}
671     local comp1ip=${OPENSTACK_COMPUTE_NODE_1_IP}
672
673     #if [ ${idx} -eq 1 ]; then
674         if [ ${iter} -eq 1 ] || [ ${iter} -gt 16 ]; then
675             curl http://${ctrlip}:5000
676             curl http://${ctrlip}:35357
677             curl http://${ctrlip}/identity
678             ${SSH} ${ctrlip} "
679                 source /opt/stack/devstack/openrc admin admin;
680                 env
681                 openstack configuration show --unmask;
682                 openstack service list
683                 openstack --os-cloud devstack-admin --os-region RegionOne compute service list
684                 openstack hypervisor list;
685             " || true
686             check_firewall
687         fi
688     #fi
689     set -e
690 }
691
692 # Check if rabbitmq is ready by looking for a pid in it's status.
693 # The function returns the status of the grep command which callers can check.
694 function is_rabbitmq_ready() {
695     local -r ip=$1
696     rm -f rabbit.txt
697     ${SSH} ${ip} "sudo rabbitmqctl status" > rabbit.txt
698     grep pid rabbit.txt
699 }
700
701 # retry the given command ($3) until success for a number of iterations ($1)
702 # sleeping ($2) between tries.
703 function retry() {
704     set +e
705     local -r -i max_tries=${1}
706     local -r -i sleep_time=${2}
707     local -r cmd=${3}
708     local -i retries=1
709     local -i rc=1
710     while true; do
711         echo "retry ${cmd}: attempt: ${retries}"
712         ${cmd}
713         rc=$?
714         if ((${rc} == 0)); then
715             break;
716         else
717             if ((${retries} == ${max_tries})); then
718                 break
719             else
720                 ((retries++))
721                 sleep ${sleep_time}
722             fi
723         fi
724     done
725     set -e
726     return ${rc}
727 }
728
729 # if we are using the new netvirt impl, as determined by the feature name
730 # odl-netvirt-openstack (note: old impl is odl-ovsdb-openstack) then we
731 # want PROVIDER_MAPPINGS to be used -- this should be fixed if we want to support
732 # external networks in legacy netvirt
733 if [[ ${CONTROLLERFEATURES} == *"odl-netvirt-openstack"* ]]; then
734   ODL_PROVIDER_MAPPINGS="\${PUBLIC_PHYSICAL_NETWORK}:${PUBLIC_BRIDGE}"
735 else
736   ODL_PROVIDER_MAPPINGS=
737 fi
738
739 # if we are using the old netvirt impl, as determined by the feature name
740 # odl-ovsdb-openstack (note: new impl is odl-netvirt-openstack) then we
741 # want ODL_L3 to be True.  New impl wants it False
742 if [[ ${CONTROLLERFEATURES} == *"odl-ovsdb-openstack"* ]]; then
743     ODL_L3=True
744 else
745     ODL_L3=False
746 fi
747
748 RECLONE=False
749
750 # Always compare the lists below against the devstack upstream ENABLED_SERVICES in
751 # https://github.com/openstack-dev/devstack/blob/master/stackrc#L52
752 # ODL CSIT does not use vnc, cinder, q-agt, q-l3 or horizon so they are not included below.
753 # collect performance stats
754 CORE_OS_CONTROL_SERVICES="dstat"
755 # Glance
756 CORE_OS_CONTROL_SERVICES+=",g-api,g-reg"
757 # Keystone
758 CORE_OS_CONTROL_SERVICES+=",key"
759 # Nova - services to support libvirt
760 CORE_OS_CONTROL_SERVICES+=",n-api,n-api-meta,n-cauth,n-cond,n-crt,n-obj,n-sch"
761 # ODL - services to connect to ODL
762 CORE_OS_CONTROL_SERVICES+=",odl-compute,odl-neutron"
763 # Neutron
764 CORE_OS_CONTROL_SERVICES+=",q-dhcp,q-meta,q-svc"
765 # Additional services
766 CORE_OS_CONTROL_SERVICES+=",mysql,rabbit"
767
768 # computes only need nova and odl
769 CORE_OS_COMPUTE_SERVICES="n-cpu,odl-compute"
770
771 cat > ${WORKSPACE}/disable_firewall.sh << EOF
772 sudo systemctl stop firewalld
773 # Open these ports to match the tutorial vms
774 # http/https (80/443), samba (445), netbios (137,138,139)
775 sudo iptables -I INPUT -p tcp -m multiport --dports 80,443,139,445 -j ACCEPT
776 sudo iptables -I INPUT -p udp -m multiport --dports 137,138 -j ACCEPT
777 # OpenStack services as well as vxlan tunnel ports 4789 and 9876
778 # identity public/admin (5000/35357), ampq (5672), vnc (6080), nova (8774), glance (9292), neutron (9696)
779 sudo sudo iptables -I INPUT -p tcp -m multiport --dports 5000,5672,6080,8774,9292,9696,35357 -j ACCEPT
780 sudo sudo iptables -I INPUT -p udp -m multiport --dports 4789,9876 -j ACCEPT
781 sudo iptables-save > /etc/sysconfig/iptables
782 sudo systemctl restart iptables
783 sudo iptables --line-numbers -nvL
784 true
785 EOF
786
787 cat > ${WORKSPACE}/get_devstack.sh << EOF
788 sudo systemctl stop firewalld
789 sudo yum install bridge-utils python-pip -y
790 #sudo systemctl stop  NetworkManager
791 #Disable NetworkManager and kill dhclient and dnsmasq
792 sudo systemctl stop NetworkManager
793 sudo killall dhclient
794 sudo killall dnsmasq
795 #Workaround for mysql failure
796 echo "127.0.0.1   localhost \${HOSTNAME}" >> /tmp/hosts
797 echo "::1         localhost \${HOSTNAME}" >> /tmp/hosts
798 sudo mv /tmp/hosts /etc/hosts
799 sudo mkdir /opt/stack
800 echo "Create RAM disk for /opt/stack"
801 sudo mount -t tmpfs -o size=2G tmpfs /opt/stack
802 sudo chmod 777 /opt/stack
803 cd /opt/stack
804 echo "git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}"
805 git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}
806 cd devstack
807 if [ -n "${DEVSTACK_HASH}" ]; then
808     echo "git checkout ${DEVSTACK_HASH}"
809     git checkout ${DEVSTACK_HASH}
810 fi
811 git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s\n%b' -n20
812 echo "workaround: adjust wait from 60s to 1800s (30m)"
813 sed -i 's/wait_for_compute 60/wait_for_compute 1800/g' /opt/stack/devstack/lib/nova
814 # TODO: modify sleep 1 to sleep 60, search wait_for_compute, then first sleep 1
815 # that would just reduce the number of logs in the compute stack.log
816 EOF
817
818 cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF
819 sudo nova-manage cell_v2 map_cell0
820 sudo nova-manage cell_v2 simple_cell_setup
821 sudo nova-manage db sync
822 sudo nova-manage cell_v2 discover_hosts
823 EOF
824
825 NUM_OPENSTACK_SITES=${NUM_OPENSTACK_SITES:-1}
826 compute_index=1
827 odl_index=1
828 os_node_list=()
829 os_interval=$(( ${NUM_OPENSTACK_SYSTEM} / ${NUM_OPENSTACK_SITES} ))
830 ha_proxy_index=${os_interval}
831
832 for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
833     if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
834         echo "Configure HAProxy"
835         ODL_HAPROXYIP_PARAM=OPENSTACK_HAPROXY_${i}_IP
836         ha_proxy_index=$(( $ha_proxy_index + $os_interval ))
837         odl_index=$(((i - 1) * 3 + 1))
838         ODL_IP_PARAM1=ODL_SYSTEM_$((odl_index++))_IP
839         ODL_IP_PARAM2=ODL_SYSTEM_$((odl_index++))_IP
840         ODL_IP_PARAM3=ODL_SYSTEM_$((odl_index++))_IP
841         ODLMGRIP[$i]=${!ODL_HAPROXYIP_PARAM} # ODL Northbound uses HAProxy VIP
842         ODL_OVS_MGRS[$i]="${!ODL_IP_PARAM1},${!ODL_IP_PARAM2},${!ODL_IP_PARAM3}" # OVSDB connects to all ODL IPs
843         configure_haproxy_for_neutron_requests ${!ODL_HAPROXYIP_PARAM} "${ODL_OVS_MGRS[$i]}"
844     else
845         ODL_IP_PARAM=ODL_SYSTEM_${i}_IP
846         ODL_OVS_MGRS[$i]="${!ODL_IP_PARAM}" # ODL Northbound uses ODL IP
847         ODLMGRIP[$i]=${!ODL_IP_PARAM} # OVSDB connects to ODL IP
848     fi
849 done
850
851 # Begin stacking the nodes, starting with the controller(s) and then the compute(s)
852
853 for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
854     CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP
855     echo "Configure the stack of the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
856     scp ${WORKSPACE}/disable_firewall.sh ${!CONTROLIP}:/tmp
857     ${SSH} ${!CONTROLIP} "sudo bash /tmp/disable_firewall.sh"
858     create_etc_hosts ${!CONTROLIP}
859     scp ${WORKSPACE}/hosts_file ${!CONTROLIP}:/tmp/hosts
860     scp ${WORKSPACE}/get_devstack.sh ${!CONTROLIP}:/tmp
861     ${SSH} ${!CONTROLIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1"
862     create_control_node_local_conf ${!CONTROLIP} ${ODLMGRIP[$i]} "${ODL_OVS_MGRS[$i]}"
863     scp ${WORKSPACE}/local.conf_control_${!CONTROLIP} ${!CONTROLIP}:/opt/stack/devstack/local.conf
864     echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
865     ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
866     ssh ${!CONTROLIP} "ps -ef | grep stack.sh"
867     ssh ${!CONTROLIP} "ls -lrt /opt/stack/devstack/nohup.out"
868     os_node_list+=(${!CONTROLIP})
869     # Workaround for stable/newton jobs
870     # TODO: can this be removed now?
871     if [ "${ODL_ML2_BRANCH}" == "stable/newton" ]; then
872         ssh ${!CONTROLIP} "cd /opt/stack; git clone https://git.openstack.org/openstack/requirements; cd requirements; git checkout stable/newton; sed -i /appdirs/d upper-constraints.txt"
873     fi
874 done
875
876 # This is a backup to the CELLSV2_SETUP=singleconductor workaround. Keeping it here as an easy lookup
877 # if needed.
878 # Let the control node get started to avoid a race condition where the computes start and try to access
879 # the nova_cell1 on the control node before it is created. If that happens, the nova-compute service on the
880 # compute exits and does not attempt to restart.
881 # 180s is chosen because in test runs the control node usually finished in 17-20 minutes and the computes finished
882 # in 17 minutes, so take the max difference of 3 minutes and the jobs should still finish around the same time.
883 # one of the following errors is seen in the compute n-cpu.log:
884 # Unhandled error: NotAllowed: Connection.open: (530) NOT_ALLOWED - access to vhost 'nova_cell1' refused for user 'stackrabbit'
885 # AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
886 # Compare that timestamp to this log in the control stack.log: sudo rabbitmqctl set_permissions -p nova_cell1 stackrabbit
887 # If the n-cpu.log is earlier than the control stack.log timestamp then the failure condition is likely hit.
888 WAIT_FOR_RABBITMQ_MINUTES=60
889 echo "Wait a maximum of ${WAIT_FOR_RABBITMQ_MINUTES}m until rabbitmq is ready to allow the controller to create nova_cell1 before the computes need it"
890 retry ${WAIT_FOR_RABBITMQ_MINUTES} 60 "is_rabbitmq_ready ${OPENSTACK_CONTROL_NODE_1_IP}"
891 rc=$?
892 if ((${rc} == 0)); then
893     echo "rabbitmq is ready, starting ${NUM_OPENSTACK_COMPUTE_NODES} compute(s)"
894 else
895     echo "rabbitmq was not ready in ${WAIT_FOR_RABBITMQ_MINUTES}m"
896     collect_logs
897     exit 1
898 fi
899
900 for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
901     NUM_COMPUTES_PER_SITE=$((NUM_OPENSTACK_COMPUTE_NODES / NUM_OPENSTACK_SITES))
902     SITE_INDEX=$((((i - 1) / NUM_COMPUTES_PER_SITE) + 1)) # We need the site index to infer the control node IP for this compute
903     COMPUTEIP=OPENSTACK_COMPUTE_NODE_${i}_IP
904     CONTROLIP=OPENSTACK_CONTROL_NODE_${SITE_INDEX}_IP
905     echo "Configure the stack of the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
906     scp ${WORKSPACE}/disable_firewall.sh "${!COMPUTEIP}:/tmp"
907     ${SSH} "${!COMPUTEIP}" "sudo bash /tmp/disable_firewall.sh"
908     create_etc_hosts ${!COMPUTEIP} ${!CONTROLIP}
909     scp ${WORKSPACE}/hosts_file ${!COMPUTEIP}:/tmp/hosts
910     scp ${WORKSPACE}/get_devstack.sh  ${!COMPUTEIP}:/tmp
911     ${SSH} ${!COMPUTEIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1"
912     if [ "${ODL_ML2_BRANCH}" == "stable/ocata" ]; then
913         echo "Updating requirements for ${ODL_ML2_BRANCH}"
914         echo "Workaround for https://review.openstack.org/#/c/491032/"
915         echo "Modify upper-constraints to use libvirt-python 3.2.0"
916         ${SSH} ${!COMPUTEIP} "
917             cd /opt/stack;
918             git clone https://git.openstack.org/openstack/requirements;
919             cd requirements;
920             git checkout stable/ocata;
921             sed -i s/libvirt-python===2.5.0/libvirt-python===3.2.0/ upper-constraints.txt
922         "
923     fi
924     create_compute_node_local_conf ${!COMPUTEIP} ${!CONTROLIP} ${ODLMGRIP[$SITE_INDEX]} "${ODL_OVS_MGRS[$SITE_INDEX]}"
925     scp ${WORKSPACE}/local.conf_compute_${!COMPUTEIP} ${!COMPUTEIP}:/opt/stack/devstack/local.conf
926     echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
927     ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
928     ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"
929     os_node_list+=(${!COMPUTEIP})
930 done
931
932 echo "nodelist: ${os_node_list[*]}"
933
934 # This script runs on the openstack nodes. It greps for a string that devstack writes when stacking is complete.
935 # The script then writes a status depending on the grep output that is later scraped by the robot vm to control
936 # the status polling.
937 cat > ${WORKSPACE}/check_stacking.sh << EOF
938 > /tmp/stack_progress
939 ps -ef | grep "stack.sh" | grep -v grep
940 ret=\$?
941 if [ \${ret} -eq 1 ]; then
942     grep "This is your host IP address:" /opt/stack/devstack/nohup.out
943     if [ \$? -eq 0 ]; then
944         echo "Stacking Complete" > /tmp/stack_progress
945     else
946         echo "Stacking Failed" > /tmp/stack_progress
947     fi
948 elif [ \${ret} -eq 0 ]; then
949     echo "Still Stacking" > /tmp/stack_progress
950 fi
951 EOF
952
953 # devstack debugging
954 # get_hostnames
955
956 # Check if the stacking is finished. Poll all nodes every 60s for one hour.
957 iteration=0
958 in_progress=1
959 while [ ${in_progress} -eq 1 ]; do
960     iteration=$(($iteration + 1))
961     for index in "${!os_node_list[@]}"; do
962         echo "node $index ${os_node_list[index]}: checking stacking status attempt ${iteration} of 60"
963         scp ${WORKSPACE}/check_stacking.sh  ${os_node_list[index]}:/tmp
964         ${SSH} ${os_node_list[index]} "bash /tmp/check_stacking.sh"
965         scp ${os_node_list[index]}:/tmp/stack_progress .
966         cat stack_progress
967         stacking_status=`cat stack_progress`
968         # devstack debugging
969         # get_service "${iteration}" "${index}"
970         if [ "$stacking_status" == "Still Stacking" ]; then
971             continue
972         elif [ "$stacking_status" == "Stacking Failed" ]; then
973             echo "node $index ${os_node_list[index]}: stacking has failed"
974             collect_logs
975             exit 1
976         elif [ "$stacking_status" == "Stacking Complete" ]; then
977             echo "node $index ${os_node_list[index]}: stacking complete"
978             unset 'os_node_list[index]'
979             if  [ ${#os_node_list[@]} -eq 0 ]; then
980                 in_progress=0
981             fi
982         fi
983     done
984     echo "sleep for a minute before the next check"
985     sleep 60
986     if [ ${iteration} -eq 60 ]; then
987         echo "stacking has failed - took longer than 60m"
988         collect_logs
989         exit 1
990     fi
991 done
992
993 # Further configuration now that stacking is complete.
994 NUM_COMPUTES_PER_SITE=$((NUM_OPENSTACK_COMPUTE_NODES / NUM_OPENSTACK_SITES))
995 for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
996     echo "Configure the Control Node"
997     CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP
998     # Gather Compute IPs for the site
999     for j in `seq 1 ${NUM_COMPUTES_PER_SITE}`; do
1000         COMPUTE_INDEX=$(((i-1) * NUM_COMPUTES_PER_SITE + j))
1001         IP_VAR=OPENSTACK_COMPUTE_NODE_${COMPUTE_INDEX}_IP
1002         COMPUTE_IPS[$((j-1))]=${!IP_VAR}
1003     done
1004
1005     echo "sleep for 60s and print hypervisor-list"
1006     sleep 60
1007     # In Ocata if we do not enable the n-cpu in control node then
1008     # we need to discover hosts manually and ensure that they are mapped to cells.
1009     # reference: https://ask.openstack.org/en/question/102256/how-to-configure-placement-service-for-compute-node-on-ocata/
1010     if [ "${OPENSTACK_BRANCH}" == "stable/ocata" ]; then
1011         scp ${WORKSPACE}/setup_host_cell_mapping.sh  ${!CONTROLIP}:/tmp
1012         ${SSH} ${!CONTROLIP} "sudo bash /tmp/setup_host_cell_mapping.sh"
1013     fi
1014     ${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; nova hypervisor-list"
1015     # in the case that we are doing openstack (control + compute) all in one node, then the number of hypervisors
1016     # will be the same as the number of openstack systems. However, if we are doing multinode openstack then the
1017     # assumption is we have a single control node and the rest are compute nodes, so the number of expected hypervisors
1018     # is one less than the total number of openstack systems
1019     if [ $((NUM_OPENSTACK_SYSTEM / NUM_OPENSTACK_SITES)) -eq 1 ]; then
1020         expected_num_hypervisors=1
1021     else
1022         expected_num_hypervisors=${NUM_COMPUTES_PER_SITE}
1023     fi
1024     num_hypervisors=$(${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; openstack hypervisor list -f value | wc -l" | tail -1 | tr -d "\r")
1025     if ! [ "${num_hypervisors}" ] || ! [ ${num_hypervisors} -eq ${expected_num_hypervisors} ]; then
1026         echo "Error: Only $num_hypervisors hypervisors detected, expected $expected_num_hypervisors"
1027         collect_logs
1028         exit 1
1029     fi
1030
1031     # upgrading pip, urllib3 and httplib2 so that tempest tests can be run on openstack control node
1032     # this needs to happen after devstack runs because it seems devstack is pulling in specific versions
1033     # of these libs that are not working for tempest.
1034     ${SSH} ${!CONTROLIP} "sudo pip install --upgrade pip"
1035     ${SSH} ${!CONTROLIP} "sudo pip install urllib3 --upgrade"
1036     ${SSH} ${!CONTROLIP} "sudo pip install httplib2 --upgrade"
1037
1038     # Gather Compute IPs for the site
1039     for j in `seq 1 ${NUM_COMPUTES_PER_SITE}`; do
1040         COMPUTE_INDEX=$(((i-1) * NUM_COMPUTES_PER_SITE + j))
1041         IP_VAR=OPENSTACK_COMPUTE_NODE_${COMPUTE_INDEX}_IP
1042         COMPUTE_IPS[$((j-1))]=${!IP_VAR}
1043     done
1044
1045     # External Network
1046     echo "prepare external networks by adding vxlan tunnels between all nodes on a separate bridge..."
1047     # FIXME Should there be a unique gateway IP and devstack index for each site?
1048     devstack_index=1
1049     for ip in ${!CONTROLIP} ${COMPUTE_IPS[*]}; do
1050         # FIXME - Workaround, ODL (new netvirt) currently adds PUBLIC_BRIDGE as a port in br-int since it doesn't see such a bridge existing when we stack
1051         ${SSH} $ip "sudo ovs-vsctl --if-exists del-port br-int $PUBLIC_BRIDGE"
1052         ${SSH} $ip "sudo ovs-vsctl --may-exist add-br $PUBLIC_BRIDGE -- set bridge $PUBLIC_BRIDGE other-config:disable-in-band=true other_config:hwaddr=f6:00:00:ff:01:0$((devstack_index++))"
1053     done
1054
1055     # ipsec support
1056     if [ "${IPSEC_VXLAN_TUNNELS_ENABLED}" == "yes" ]; then
1057         ALL_NODES=(${!CONTROLIP} ${COMPUTE_IPS[*]})
1058         for ((inx_ip1=0; inx_ip1<$((${#ALL_NODES[@]} - 1)); inx_ip1++)); do
1059             for ((inx_ip2=$((inx_ip1 + 1)); inx_ip2<${#ALL_NODES[@]}; inx_ip2++)); do
1060                 KEY1=0x$(dd if=/dev/urandom count=32 bs=1 2> /dev/null| xxd -p -c 64)
1061                 KEY2=0x$(dd if=/dev/urandom count=32 bs=1 2> /dev/null| xxd -p -c 64)
1062                 ID=0x$(dd if=/dev/urandom count=4 bs=1 2> /dev/null| xxd -p -c 8)
1063                 ip1=${ALL_NODES[$inx_ip1]}
1064                 ip2=${ALL_NODES[$inx_ip2]}
1065                 ${SSH} $ip1 "sudo ip xfrm state add src $ip1 dst $ip2 proto esp spi $ID reqid $ID mode transport auth sha256 $KEY1 enc aes $KEY2"
1066                 ${SSH} $ip1 "sudo ip xfrm state add src $ip2 dst $ip1 proto esp spi $ID reqid $ID mode transport auth sha256 $KEY1 enc aes $KEY2"
1067                 ${SSH} $ip1 "sudo ip xfrm policy add src $ip1 dst $ip2 proto udp dir out tmpl src $ip1 dst $ip2 proto esp reqid $ID mode transport"
1068                 ${SSH} $ip1 "sudo ip xfrm policy add src $ip2 dst $ip1 proto udp dir in tmpl src $ip2 dst $ip1 proto esp reqid $ID mode transport"
1069
1070                 ${SSH} $ip2 "sudo ip xfrm state add src $ip2 dst $ip1 proto esp spi $ID reqid $ID mode transport auth sha256 $KEY1 enc aes $KEY2"
1071                 ${SSH} $ip2 "sudo ip xfrm state add src $ip1 dst $ip2 proto esp spi $ID reqid $ID mode transport auth sha256 $KEY1 enc aes $KEY2"
1072                 ${SSH} $ip2 "sudo ip xfrm policy add src $ip2 dst $ip1 proto udp dir out tmpl src $ip2 dst $ip1 proto esp reqid $ID mode transport"
1073                 ${SSH} $ip2 "sudo ip xfrm policy add src $ip1 dst $ip2 proto udp dir in tmpl src $ip1 dst $ip2 proto esp reqid $ID mode transport"
1074             done
1075         done
1076
1077         for ip in ${!CONTROLIP} ${COMPUTE_IPS[*]}; do
1078             echo "ip xfrm configuration for node $ip:"
1079             ${SSH} $ip "sudo ip xfrm policy list"
1080             ${SSH} $ip "sudo ip xfrm state list"
1081         done
1082     fi
1083
1084     # Control Node - PUBLIC_BRIDGE will act as the external router
1085     # Parameter values below are used in integration/test - changing them requires updates in intergration/test as well
1086     EXTNET_GATEWAY_IP="10.10.10.250"
1087     EXTNET_INTERNET_IP="10.9.9.9"
1088     EXTNET_PNF_IP="10.10.10.253"
1089     ${SSH} ${!CONTROLIP} "sudo ifconfig ${PUBLIC_BRIDGE} up ${EXTNET_GATEWAY_IP}/24"
1090
1091     # Control Node - external net PNF simulation
1092     ${SSH} ${!CONTROLIP} "
1093         sudo ip netns add pnf_ns;
1094         sudo ip link add pnf_veth0 type veth peer name pnf_veth1;
1095         sudo ip link set pnf_veth1 netns pnf_ns;
1096         sudo ip link set pnf_veth0 up;
1097         sudo ip netns exec pnf_ns ifconfig pnf_veth1 up ${EXTNET_PNF_IP}/24;
1098         sudo ovs-vsctl add-port ${PUBLIC_BRIDGE} pnf_veth0;
1099     "
1100     # Control Node - set VXLAN TEP IP for Genius Auto TZ
1101     ${SSH} ${!CONTROLIP} "
1102         sudo ovs-vsctl set O . external_ids:tep-ip=${!CONTROLIP};
1103     "
1104
1105     # Control Node - external net internet address simulation
1106     ${SSH} ${!CONTROLIP} "
1107         sudo ip tuntap add dev internet_tap mode tap;
1108         sudo ifconfig internet_tap up ${EXTNET_INTERNET_IP}/24;
1109     "
1110
1111     # Computes
1112     compute_index=1
1113     for compute_ip in ${COMPUTE_IPS[*]}; do
1114         # Tunnel from controller to compute
1115         COMPUTEPORT=compute$(( compute_index++ ))_vxlan
1116         ${SSH} ${!CONTROLIP} "
1117             sudo ovs-vsctl add-port $PUBLIC_BRIDGE $COMPUTEPORT -- set interface $COMPUTEPORT type=vxlan options:local_ip=${!CONTROLIP} options:remote_ip=$compute_ip options:dst_port=9876 options:key=flow
1118         "
1119         # Tunnel from compute to controller
1120         CONTROLPORT="control_vxlan"
1121         ${SSH} $compute_ip "
1122             sudo ovs-vsctl add-port $PUBLIC_BRIDGE $CONTROLPORT -- set interface $CONTROLPORT type=vxlan options:local_ip=$compute_ip options:remote_ip=${!CONTROLIP} options:dst_port=9876 options:key=flow
1123         "
1124          #Compute Node - set VXLAN TEP IP for Genius Auto TZ
1125         ${SSH} $compute_ip "
1126             sudo ovs-vsctl set O . external_ids:tep-ip=${compute_ip};
1127         "
1128     done
1129 done
1130
1131 if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
1132     odlmgrip=OPENSTACK_HAPROXY_1_IP
1133     HA_PROXY_IP=${!odlmgrip}
1134     HA_PROXY_1_IP=${!odlmgrip}
1135     odlmgrip2=OPENSTACK_HAPROXY_2_IP
1136     HA_PROXY_2_IP=${!odlmgrip2}
1137     odlmgrip3=OPENSTACK_HAPROXY_1_IP
1138     HA_PROXY_3_IP=${!odlmgrip3}
1139 else
1140     HA_PROXY_IP=${ODL_SYSTEM_IP}
1141     HA_PROXY_1_IP=${ODL_SYSTEM_1_IP}
1142     HA_PROXY_2_IP=${ODL_SYSTEM_2_IP}
1143     HA_PROXY_3_IP=${ODL_SYSTEM_3_IP}
1144 fi
1145
1146 echo "Locating test plan to use..."
1147 testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
1148 if [ ! -f "${testplan_filepath}" ]; then
1149     testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}"
1150 fi
1151
1152 echo "Changing the testplan path..."
1153 cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt
1154 cat testplan.txt
1155
1156 # Use the testplan if specific SUITES are not defined.
1157 if [ -z "${SUITES}" ]; then
1158     SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
1159 else
1160     newsuites=""
1161     workpath="${WORKSPACE}/test/csit/suites"
1162     for suite in ${SUITES}; do
1163         fullsuite="${workpath}/${suite}"
1164         if [ -z "${newsuites}" ]; then
1165             newsuites+=${fullsuite}
1166         else
1167             newsuites+=" "${fullsuite}
1168         fi
1169     done
1170     SUITES=${newsuites}
1171 fi
1172
1173 # TODO: run openrc on control node and then scrape the vars from it
1174 # Environment Variables Needed to execute Openstack Client for NetVirt Jobs
1175 cat > /tmp/os_netvirt_client_rc << EOF
1176 export OS_USERNAME=admin
1177 export OS_PASSWORD=admin
1178 export OS_PROJECT_NAME=admin
1179 export OS_USER_DOMAIN_NAME=default
1180 export OS_PROJECT_DOMAIN_NAME=default
1181 export OS_AUTH_URL="http://${!CONTROLIP}/identity"
1182 export OS_IDENTITY_API_VERSION=3
1183 export OS_IMAGE_API_VERSION=2
1184 export OS_TENANT_NAME=admin
1185 unset OS_CLOUD
1186 EOF
1187
1188 source /tmp/os_netvirt_client_rc
1189
1190 echo "Starting Robot test suites ${SUITES} ..."
1191 # please add pybot -v arguments on a single line and alphabetized
1192 suite_num=0
1193 for suite in ${SUITES}; do
1194     # prepend a incrmental counter to the suite name so that the full robot log combining all the suites as is done
1195     # in the rebot step below will list all the suites in chronological order as rebot seems to alphabatize them
1196     let "suite_num = suite_num + 1"
1197     suite_index="$(printf %02d ${suite_num})"
1198     suite_name="$(basename ${suite} | cut -d. -f1)"
1199     log_name="${suite_index}_${suite_name}"
1200     pybot -N ${log_name} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} \
1201     --log log_${log_name}.html --report None --output output_${log_name}.xml \
1202     -v BUNDLEFOLDER:${BUNDLEFOLDER} \
1203     -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \
1204     -v CONTROLLERFEATURES:${CONTROLLERFEATURES} \
1205     -v CONTROLLER_USER:${USER} \
1206     -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \
1207     -v HA_PROXY_IP:${HA_PROXY_IP} \
1208     -v HA_PROXY_1_IP:${HA_PROXY_1_IP} \
1209     -v HA_PROXY_2_IP:${HA_PROXY_2_IP} \
1210     -v HA_PROXY_3_IP:${HA_PROXY_3_IP} \
1211     -v JDKVERSION:${JDKVERSION} \
1212     -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \
1213     -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} \
1214     -v NUM_OPENSTACK_SITES:${NUM_OPENSTACK_SITES} \
1215     -v NUM_OS_SYSTEM:${NUM_OPENSTACK_SYSTEM} \
1216     -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} \
1217     -v ODL_SNAT_MODE:${ODL_SNAT_MODE} \
1218     -v ODL_STREAM:${DISTROSTREAM} \
1219     -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \
1220     -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_1_IP} \
1221     -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \
1222     -v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_IP} \
1223     -v ODL_SYSTEM_4_IP:${ODL_SYSTEM_4_IP} \
1224     -v ODL_SYSTEM_5_IP:${ODL_SYSTEM_5_IP} \
1225     -v ODL_SYSTEM_6_IP:${ODL_SYSTEM_6_IP} \
1226     -v ODL_SYSTEM_7_IP:${ODL_SYSTEM_7_IP} \
1227     -v ODL_SYSTEM_8_IP:${ODL_SYSTEM_8_IP} \
1228     -v ODL_SYSTEM_9_IP:${ODL_SYSTEM_9_IP} \
1229     -v OS_CONTROL_NODE_IP:${OPENSTACK_CONTROL_NODE_1_IP} \
1230     -v OS_CONTROL_NODE_1_IP:${OPENSTACK_CONTROL_NODE_1_IP} \
1231     -v OS_CONTROL_NODE_2_IP:${OPENSTACK_CONTROL_NODE_2_IP} \
1232     -v OS_CONTROL_NODE_3_IP:${OPENSTACK_CONTROL_NODE_3_IP} \
1233     -v OPENSTACK_BRANCH:${OPENSTACK_BRANCH} \
1234     -v OS_COMPUTE_1_IP:${OPENSTACK_COMPUTE_NODE_1_IP} \
1235     -v OS_COMPUTE_2_IP:${OPENSTACK_COMPUTE_NODE_2_IP} \
1236     -v OS_COMPUTE_3_IP:${OPENSTACK_COMPUTE_NODE_3_IP} \
1237     -v OS_COMPUTE_4_IP:${OPENSTACK_COMPUTE_NODE_4_IP} \
1238     -v OS_COMPUTE_5_IP:${OPENSTACK_COMPUTE_NODE_5_IP} \
1239     -v OS_COMPUTE_6_IP:${OPENSTACK_COMPUTE_NODE_6_IP} \
1240     -v OS_USER:${USER} \
1241     -v PUBLIC_PHYSICAL_NETWORK:${PUBLIC_PHYSICAL_NETWORK} \
1242     -v SECURITY_GROUP_MODE:${SECURITY_GROUP_MODE} \
1243     -v TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_1_IP} \
1244     -v TOOLS_SYSTEM_1_IP:${TOOLS_SYSTEM_1_IP} \
1245     -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} \
1246     -v USER_HOME:${HOME} \
1247     -v WORKSPACE:/tmp \
1248     ${TESTOPTIONS} ${suite} || true
1249 done
1250 #rebot exit codes seem to be different
1251 rebot --output ${WORKSPACE}/output.xml --log log_full.html --report None -N openstack output_*.xml || true
1252
1253 echo "Examining the files in data/log and checking file size"
1254 ssh ${ODL_SYSTEM_IP} "ls -altr /tmp/${BUNDLEFOLDER}/data/log/"
1255 ssh ${ODL_SYSTEM_IP} "du -hs /tmp/${BUNDLEFOLDER}/data/log/*"
1256
1257 echo "Tests Executed"
1258 collect_logs
1259
1260 true  # perhaps Jenkins is testing last exit code
1261 # vim: ts=4 sw=4 sts=4 et ft=sh :