1 #@IgnoreInspection BashAddShebang
2 # Activate robotframework virtualenv
3 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
5 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
6 source ${ROBOT_VENV}/bin/activate
7 PYTHON="${ROBOT_VENV}/bin/python"
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
18 #################################################
19 ## Deploy Openstack 3-node ##
20 #################################################
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() {
29 echo "${prog}: line ${lastline}: exit status of last command: ${lasterr}"
30 echo "command: ${BASH_COMMAND}"
35 trap 'trap_handler ${LINENO} ${$?}' ERR
37 function print_job_parameters() {
41 DISTROBRANCH: ${DISTROBRANCH}
42 DISTROSTREAM: ${DISTROSTREAM}
43 BUNDLE_URL: ${BUNDLE_URL}
44 CONTROLLERFEATURES: ${CONTROLLERFEATURES}
45 CONTROLLERDEBUGMAP: ${CONTROLLERDEBUGMAP}
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}
81 function create_etc_hosts() {
84 : > ${WORKSPACE}/hosts_file
85 for iter in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`
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
92 COMPUTE_HNAME=$(${SSH} ${!COMPUTE_IP} "hostname")
93 echo "${!COMPUTE_IP} ${COMPUTE_HNAME}" >> ${WORKSPACE}/hosts_file
97 echo "Created the hosts file for ${NODE_IP}:"
98 cat ${WORKSPACE}/hosts_file
99 } # create_etc_hosts()
101 # convert commas in csv strings to spaces (ssv)
104 if [ -n "${csv}" ]; then
105 ssv=$(echo ${csv} | sed 's/,/ /g' | sed 's/\ \ */\ /g')
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
118 cat >> ${local_conf_file_name} << EOF
119 enable_service $(csv2ssv "${core_services}")
121 if [ -n "${enable_services}" ]; then
122 cat >> ${local_conf_file_name} << EOF
123 enable_service $(csv2ssv "${enable_services}")
126 if [ -n "${disable_services}" ]; then
127 cat >> ${local_conf_file_name} << EOF
128 disable_service $(csv2ssv "${disable_services}")
133 function create_control_node_local_conf() {
136 ODL_OVS_MANAGERS="$3"
138 local_conf_file_name=${WORKSPACE}/local.conf_control_${HOSTIP}
139 cat > ${local_conf_file_name} << EOF
143 SCREEN_LOGDIR=/opt/stack/data/log
150 add_os_services "${CORE_OS_CONTROL_SERVICES}" "${ENABLE_OS_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}"
152 cat >> ${local_conf_file_name} << EOF
155 SERVICE_HOST=\$HOST_IP
156 Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE}
157 NEUTRON_CREATE_INITIAL_NETWORKS=${CREATE_INITIAL_NETWORKS}
162 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
163 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
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
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}
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
183 if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then
184 echo "ODL_V2DRIVER=True" >> ${local_conf_file_name}
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}"
199 echo "Error: Invalid plugin $plugin_name, unsupported"
202 cat >> ${local_conf_file_name} << EOF
204 enable_plugin ${plugin_name} ${ENABLE_PLUGIN_ARGS}
209 if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then
210 cat >> ${local_conf_file_name} << EOF
212 enable_plugin networking-l2gw ${NETWORKING_L2GW_DRIVER} ${ODL_ML2_BRANCH}
213 NETWORKING_L2GW_SERVICE_DRIVER=L2GW:OpenDaylight:networking_odl.l2gateway.driver.OpenDaylightL2gwDriver:default
217 if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
218 cat >> ${local_conf_file_name} << EOF
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}
226 if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then
227 SERVICE_PLUGINS="odl-router_v2"
229 SERVICE_PLUGINS="odl-router"
231 if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then
232 SERVICE_PLUGINS+=", networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin"
234 if [ "${IS_LBAAS_PLUGIN_ENABLED}" == "yes" ]; then
235 SERVICE_PLUGINS+=", lbaasv2"
237 fi #check for ODL_ENABLE_L3_FWD
239 cat >> ${local_conf_file_name} << EOF
241 [[post-config|\$NEUTRON_CONF]]
243 service_plugins = ${SERVICE_PLUGINS}
245 [[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
247 minimize_polling=True
250 # Needed for VLAN provider tests - because our provider networks are always encapsulated in VXLAN (br-physnet1)
251 # MTU(1440) + VXLAN(50) + VLAN(4) = 1494 < MTU eth0/br-physnet1(1500)
252 physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1440
255 # workaround for port-status not working due to https://bugs.opendaylight.org/show_bug.cgi?id=9092
259 [[post-config|/etc/neutron/dhcp_agent.ini]]
261 force_metadata = True
262 enable_isolated_metadata = True
264 [[post-config|/etc/nova/nova.conf]]
266 force_config_drive = False
269 discover_hosts_in_cells_interval = 30
272 echo "Control local.conf created:"
273 cat ${local_conf_file_name}
274 } # create_control_node_local_conf()
276 function create_compute_node_local_conf() {
280 ODL_OVS_MANAGERS="$4"
282 local_conf_file_name=${WORKSPACE}/local.conf_compute_${HOSTIP}
283 cat > ${local_conf_file_name} << EOF
288 SCREEN_LOGDIR=/opt/stack/data/log
294 add_os_services "${CORE_OS_COMPUTE_SERVICES}" "${ENABLE_OS_COMPUTE_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}"
296 cat >> ${local_conf_file_name} << EOF
299 SERVICE_HOST=${SERVICEHOST}
300 Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE}
305 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
306 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
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
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}
322 if [[ "${ENABLE_OS_PLUGINS}" =~ networking-odl ]]; then
323 cat >> ${local_conf_file_name} << EOF
325 enable_plugin networking-odl ${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}
329 if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
330 cat >> ${local_conf_file_name} << EOF
332 PUBLIC_BRIDGE=${PUBLIC_BRIDGE}
333 PUBLIC_PHYSICAL_NETWORK=${PUBLIC_PHYSICAL_NETWORK}
334 ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS}
340 cat >> ${local_conf_file_name} << EOF
342 [[post-config|/etc/nova/nova.conf]]
344 auth_strategy = keystone
349 echo "Compute local.conf created:"
350 cat ${local_conf_file_name}
351 } # create_compute_node_local_conf()
353 function configure_haproxy_for_neutron_requests() {
357 cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
358 sudo systemctl stop firewalld
359 sudo yum -y install policycoreutils-python haproxy
362 cat > ${WORKSPACE}/haproxy.cfg << EOF
368 pidfile /tmp/haproxy.pid
376 timeout http-request 10s
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
393 odlindex=$((odlindex+1))
396 cat >> ${WORKSPACE}/haproxy.cfg << EOF
397 listen opendaylight_rest
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
407 odlindex=$((odlindex+1))
410 echo "Dump haproxy.cfg"
411 cat ${WORKSPACE}/haproxy.cfg
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
420 sudo systemctl status haproxy
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()
431 # Collect the list of files on the hosts
432 function list_files () {
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 rsync --rsync-path="sudo rsync" -arv --list-only ssh ${ip}:/var/ > ${folder}/rsync.var.txt
439 scp ${ip}:/tmp/find.etc.txt ${folder}
440 scp ${ip}:/tmp/find.opt.stack.txt ${folder}
441 scp ${ip}:/tmp/find2.txt ${folder}
444 function collect_logs () {
445 set +e # We do not want to create red dot just because something went wrong while fetching logs.
447 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
448 CONTROLLERIP=ODL_SYSTEM_${i}_IP
449 echo "Lets's take the karaf thread dump again..."
450 KARAF_PID=$(ssh ${!CONTROLLERIP} "ps aux | grep ${KARAF_ARTIFACT} | grep -v grep | tr -s ' ' | cut -f2 -d' '")
451 ssh ${!CONTROLLERIP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_${i}_threads_after.log || true
452 echo "killing karaf process..."
453 ${SSH} "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
456 cat > extra_debug.sh << EOF
457 echo -e "/usr/sbin/lsmod | /usr/bin/grep openvswitch\n"
458 /usr/sbin/lsmod | /usr/bin/grep openvswitch
459 echo -e "\ngrep ct_ /var/log/openvswitch/ovs-vswitchd.log\n"
460 grep ct_ /var/log/openvswitch/ovs-vswitchd.log
461 echo -e "\novsdb-tool -mm show-log\n"
462 ovsdb-tool -mm show-log
463 echo -e "\nsudo netstat -punta\n"
465 echo -e "\nsudo getenforce\n"
467 echo -e "\njournalctl > /tmp/journalctl.log\n"
468 sudo journalctl > /tmp/journalctl.log
472 # FIXME: Do not create .tar and gzip before copying.
473 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
474 CONTROLLERIP=ODL_SYSTEM_${i}_IP
475 ${SSH} "${!CONTROLLERIP}" "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
476 ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
477 scp "${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar" "${WORKSPACE}/odl${i}_karaf.log.tar"
478 ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log"
479 scp "${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar" "${WORKSPACE}/odl${i}_zrpcd.log.tar"
480 tar -xvf ${WORKSPACE}/odl${i}_karaf.log.tar -C . --strip-components 2 --transform s/karaf/odl${i}_karaf/g
481 grep "ROBOT MESSAGE\| ERROR " odl${i}_karaf.log > odl${i}_err.log
482 # Print ROBOT lines, Print Caused by...Exception: lines,
483 # Print Exception{ lines as well as the previous line that has the timestamp for context
484 sed -n -e '/ROBOT MESSAGE/P' -e '/Caused by.*Exception:/P' -e '$!N;/Exception{/P;D' odl${i}_karaf.log > odl${i}_exception.log
485 grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" odl${i}_karaf.log > odl${i}_err_warn_exception.log
486 rm ${WORKSPACE}/odl${i}_karaf.log.tar
489 # Since this log collection work is happening before the archive build macro which also
490 # creates the ${WORKSPACE}/archives dir, we have to do it here first. The mkdir in the
491 # archives build step will essentially be a noop.
492 mkdir -p ${WORKSPACE}/archives
494 print_job_parameters > ${WORKSPACE}/archives/params.txt
497 for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
498 OSIP=OPENSTACK_CONTROL_NODE_${i}_IP
499 NODE_FOLDER="control_${i}"
500 mkdir -p ${NODE_FOLDER}
501 scp ${!OSIP}:/etc/kuryr/kuryr.conf ${NODE_FOLDER}
502 scp ${!OSIP}:/etc/neutron/dhcp_agent.ini ${NODE_FOLDER}
503 scp ${!OSIP}:/etc/neutron/metadata_agent.ini ${NODE_FOLDER}
504 scp ${!OSIP}:/etc/neutron/neutron.conf ${NODE_FOLDER}
505 scp ${!OSIP}:/etc/neutron/neutron_lbaas.conf ${NODE_FOLDER}
506 scp ${!OSIP}:/etc/neutron/plugins/ml2/ml2_conf.ini ${NODE_FOLDER}
507 scp ${!OSIP}:/etc/neutron/services/loadbalancer/haproxy/lbaas_agent.ini ${NODE_FOLDER}
508 scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER}
509 scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log
510 scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
511 scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER}
512 scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
513 scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
514 scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
515 list_files "${!OSIP}" "${NODE_FOLDER}"
516 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
517 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER}
518 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
519 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
520 rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
521 scp extra_debug.sh ${!OSIP}:/tmp
522 ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
523 scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
524 scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
525 scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}
526 mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf
527 mv ${NODE_FOLDER} ${WORKSPACE}/archives/
531 for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
532 OSIP=OPENSTACK_COMPUTE_NODE_${i}_IP
533 NODE_FOLDER="compute_${i}"
534 mkdir -p ${NODE_FOLDER}
535 scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER}
536 scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log
537 scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
538 scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
539 scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
540 scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
541 list_files "${!OSIP}" "${NODE_FOLDER}"
542 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
543 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
544 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/dmesg.log ${NODE_FOLDER}
545 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/libvirt ${NODE_FOLDER}
546 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
547 rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${NODE_FOLDER}
548 rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
549 scp extra_debug.sh ${!OSIP}:/tmp
550 ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
551 scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
552 scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
553 scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/
554 mv local.conf_compute_${!OSIP} ${NODE_FOLDER}/local.conf
555 mv ${NODE_FOLDER} ${WORKSPACE}/archives/
559 DEVSTACK_TEMPEST_DIR="/opt/stack/tempest"
561 TEMPEST_LOGS_DIR=${WORKSPACE}/archives/tempest
562 # Look for tempest test results in the $TESTREPO dir and copy if found
563 if ${SSH} ${OPENSTACK_CONTROL_NODE_1_IP} "sudo sh -c '[ -f ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0 ]'"; then
564 ${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"
565 ${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'"
566 mkdir -p ${TEMPEST_LOGS_DIR}
567 scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest_results.html ${TEMPEST_LOGS_DIR}
568 scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest.log ${TEMPEST_LOGS_DIR}
569 mv ${WORKSPACE}/tempest_output* ${TEMPEST_LOGS_DIR}
571 echo "tempest results not found in ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0"
575 # if we are using the new netvirt impl, as determined by the feature name
576 # odl-netvirt-openstack (note: old impl is odl-ovsdb-openstack) then we
577 # want PROVIDER_MAPPINGS to be used -- this should be fixed if we want to support
578 # external networks in legacy netvirt
579 if [[ ${CONTROLLERFEATURES} == *"odl-netvirt-openstack"* ]]; then
580 ODL_PROVIDER_MAPPINGS="\${PUBLIC_PHYSICAL_NETWORK}:${PUBLIC_BRIDGE}"
582 ODL_PROVIDER_MAPPINGS=
585 # if we are using the old netvirt impl, as determined by the feature name
586 # odl-ovsdb-openstack (note: new impl is odl-netvirt-openstack) then we
587 # want ODL_L3 to be True. New impl wants it False
588 if [[ ${CONTROLLERFEATURES} == *"odl-ovsdb-openstack"* ]]; then
596 # Always compare the lists below against the devstack upstream ENABLED_SERVICES in
597 # https://github.com/openstack-dev/devstack/blob/master/stackrc#L52
598 # ODL CSIT does not use vnc, cinder, q-agt, q-l3 or horizon so they are not included below.
599 # collect performance stats
600 CORE_OS_CONTROL_SERVICES="dstat"
602 CORE_OS_CONTROL_SERVICES+=",g-api,g-reg"
604 CORE_OS_CONTROL_SERVICES+=",key"
605 # Nova - services to support libvirt
606 CORE_OS_CONTROL_SERVICES+=",n-api,n-api-meta,n-cauth,n-cond,n-crt,n-obj,n-sch"
607 # ODL - services to connect to ODL
608 CORE_OS_CONTROL_SERVICES+=",odl-compute,odl-neutron"
610 CORE_OS_CONTROL_SERVICES+=",q-dhcp,q-meta,q-svc"
611 # Additional services
612 CORE_OS_CONTROL_SERVICES+=",mysql,rabbit"
614 # computes only need nova and odl
615 CORE_OS_COMPUTE_SERVICES="n-cpu,odl-compute"
617 cat > ${WORKSPACE}/disable_firewall.sh << EOF
618 sudo systemctl stop firewalld
619 sudo systemctl stop iptables
623 cat > ${WORKSPACE}/get_devstack.sh << EOF
624 sudo systemctl stop firewalld
625 sudo yum install bridge-utils python-pip -y
626 #sudo systemctl stop NetworkManager
627 #Disable NetworkManager and kill dhclient and dnsmasq
628 sudo systemctl stop NetworkManager
629 sudo killall dhclient
631 #Workaround for mysql failure
632 echo "127.0.0.1 localhost \${HOSTNAME}" >> /tmp/hosts
633 echo "::1 localhost \${HOSTNAME}" >> /tmp/hosts
634 sudo mv /tmp/hosts /etc/hosts
635 sudo mkdir /opt/stack
636 sudo chmod 777 /opt/stack
638 echo "git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}"
639 git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}
641 if [ -n "${DEVSTACK_HASH}" ]; then
642 echo "git checkout ${DEVSTACK_HASH}"
643 git checkout ${DEVSTACK_HASH}
645 git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s\n%b' -n20
648 cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF
649 sudo nova-manage cell_v2 map_cell0
650 sudo nova-manage cell_v2 simple_cell_setup
651 sudo nova-manage db sync
652 sudo nova-manage cell_v2 discover_hosts
655 NUM_OPENSTACK_SITES=${NUM_OPENSTACK_SITES:-1}
659 os_interval=$(( ${NUM_OPENSTACK_SYSTEM} / ${NUM_OPENSTACK_SITES} ))
660 ha_proxy_index=${os_interval}
662 for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
663 if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
664 echo "Configure HAProxy"
665 ODL_HAPROXYIP_PARAM=OPENSTACK_HAPROXY_${i}_IP
666 ha_proxy_index=$(( $ha_proxy_index + $os_interval ))
667 odl_index=$(((i - 1) * 3 + 1))
668 ODL_IP_PARAM1=ODL_SYSTEM_$((odl_index++))_IP
669 ODL_IP_PARAM2=ODL_SYSTEM_$((odl_index++))_IP
670 ODL_IP_PARAM3=ODL_SYSTEM_$((odl_index++))_IP
671 ODLMGRIP[$i]=${!ODL_HAPROXYIP_PARAM} # ODL Northbound uses HAProxy VIP
672 ODL_OVS_MGRS[$i]="${!ODL_IP_PARAM1},${!ODL_IP_PARAM2},${!ODL_IP_PARAM3}" # OVSDB connects to all ODL IPs
673 configure_haproxy_for_neutron_requests ${!ODL_HAPROXYIP_PARAM} "${ODL_OVS_MGRS[$i]}"
675 ODL_IP_PARAM=ODL_SYSTEM_${i}_IP
676 ODL_OVS_MGRS[$i]="${!ODL_IP_PARAM}" # ODL Northbound uses ODL IP
677 ODLMGRIP[$i]=${!ODL_IP_PARAM} # OVSDB connects to ODL IP
681 # Begin stacking the nodes, starting with the controller(s) and then the compute(s)
683 for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
684 CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP
685 echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
686 create_etc_hosts ${!CONTROLIP}
687 scp ${WORKSPACE}/hosts_file ${!CONTROLIP}:/tmp/hosts
688 scp ${WORKSPACE}/get_devstack.sh ${!CONTROLIP}:/tmp
689 ${SSH} ${!CONTROLIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1"
690 create_control_node_local_conf ${!CONTROLIP} ${ODLMGRIP[$i]} "${ODL_OVS_MGRS[$i]}"
691 scp ${WORKSPACE}/local.conf_control_${!CONTROLIP} ${!CONTROLIP}:/opt/stack/devstack/local.conf
692 ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
693 ssh ${!CONTROLIP} "ps -ef | grep stack.sh"
694 ssh ${!CONTROLIP} "ls -lrt /opt/stack/devstack/nohup.out"
695 os_node_list+=(${!CONTROLIP})
696 # Workaround for stable/newton jobs
697 # TODO: can this be removed now?
698 if [ "${ODL_ML2_BRANCH}" == "stable/newton" ]; then
699 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"
703 for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
704 NUM_COMPUTES_PER_SITE=$((NUM_OPENSTACK_COMPUTE_NODES / NUM_OPENSTACK_SITES))
705 SITE_INDEX=$((((i - 1) / NUM_COMPUTES_PER_SITE) + 1)) # We need the site index to infer the control node IP for this compute
706 COMPUTEIP=OPENSTACK_COMPUTE_NODE_${i}_IP
707 CONTROLIP=OPENSTACK_CONTROL_NODE_${SITE_INDEX}_IP
708 echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
709 create_etc_hosts ${!COMPUTEIP} ${!CONTROLIP}
710 scp ${WORKSPACE}/hosts_file ${!COMPUTEIP}:/tmp/hosts
711 scp ${WORKSPACE}/get_devstack.sh ${!COMPUTEIP}:/tmp
712 ${SSH} ${!COMPUTEIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1"
713 create_compute_node_local_conf ${!COMPUTEIP} ${!CONTROLIP} ${ODLMGRIP[$SITE_INDEX]} "${ODL_OVS_MGRS[$SITE_INDEX]}"
714 scp ${WORKSPACE}/local.conf_compute_${!COMPUTEIP} ${!COMPUTEIP}:/opt/stack/devstack/local.conf
715 ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
716 ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"
717 os_node_list+=(${!COMPUTEIP})
718 # Workaround for https://review.openstack.org/#/c/491032/
719 # Modify upper-constraints to use libvirt-python 3.2.0
720 if [ "${ODL_ML2_BRANCH}" == "stable/ocata" ]; then
721 ${SSH} ${!COMPUTEIP} "
723 git clone https://git.openstack.org/openstack/requirements;
725 git checkout stable/ocata;
726 sed -i s/libvirt-python===2.5.0/libvirt-python===3.2.0/ upper-constraints.txt
731 echo "nodelist: ${os_node_list[*]}"
733 # This script runs on the openstack nodes. It greps for a string that devstack writes when stacking is complete.
734 # The script then writes a status depending on the grep output that is later scraped by the robot vm to control
735 # the status polling.
736 cat > ${WORKSPACE}/check_stacking.sh << EOF
737 > /tmp/stack_progress
738 ps -ef | grep "stack.sh" | grep -v grep
740 if [ \${ret} -eq 1 ]; then
741 grep "This is your host IP address:" /opt/stack/devstack/nohup.out
742 if [ \$? -eq 0 ]; then
743 echo "Stacking Complete" > /tmp/stack_progress
745 echo "Stacking Failed" > /tmp/stack_progress
747 elif [ \${ret} -eq 0 ]; then
748 echo "Still Stacking" > /tmp/stack_progress
752 # Check if the stacking is finished. Poll all nodes every 60s for one hour.
755 while [ ${in_progress} -eq 1 ]; do
756 iteration=$(($iteration + 1))
757 for index in "${!os_node_list[@]}"; do
758 echo "node $index ${os_node_list[index]}: checking stacking status attempt ${iteration} of 60"
759 scp ${WORKSPACE}/check_stacking.sh ${os_node_list[index]}:/tmp
760 ${SSH} ${os_node_list[index]} "bash /tmp/check_stacking.sh"
761 scp ${os_node_list[index]}:/tmp/stack_progress .
763 stacking_status=`cat stack_progress`
764 if [ "$stacking_status" == "Still Stacking" ]; then
766 elif [ "$stacking_status" == "Stacking Failed" ]; then
767 echo "node $index ${os_node_list[index]}: stacking has failed"
770 elif [ "$stacking_status" == "Stacking Complete" ]; then
771 echo "node $index ${os_node_list[index]}: stacking complete"
772 unset 'os_node_list[index]'
773 if [ ${#os_node_list[@]} -eq 0 ]; then
778 echo "sleep for a minute before the next check"
780 if [ ${iteration} -eq 60 ]; then
781 echo "stacking has failed - took longer than 60m"
787 # Further configuration now that stacking is complete.
788 NUM_COMPUTES_PER_SITE=$((NUM_OPENSTACK_COMPUTE_NODES / NUM_OPENSTACK_SITES))
789 for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
790 echo "Configure the Control Node"
791 CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP
792 # Gather Compute IPs for the site
793 for j in `seq 1 ${NUM_COMPUTES_PER_SITE}`; do
794 COMPUTE_INDEX=$(((i-1) * NUM_COMPUTES_PER_SITE + j))
795 IP_VAR=OPENSTACK_COMPUTE_NODE_${COMPUTE_INDEX}_IP
796 COMPUTE_IPS[$((j-1))]=${!IP_VAR}
799 # Need to disable firewalld and iptables in compute nodes as well
800 for ip in ${COMPUTE_IPS[*]}; do
801 scp ${WORKSPACE}/disable_firewall.sh "${ip}:/tmp"
802 ${SSH} "${ip}" "sudo bash /tmp/disable_firewall.sh"
805 #Need to disable firewalld and iptables in control node
806 echo "Stop Firewall in Control Node for compute nodes to be able to reach the ports and add to hypervisor-list"
807 scp ${WORKSPACE}/disable_firewall.sh ${!CONTROLIP}:/tmp
808 ${SSH} ${!CONTROLIP} "sudo bash /tmp/disable_firewall.sh"
810 echo "sleep for 60s and print hypervisor-list"
812 # In Ocata if we do not enable the n-cpu in control node then
813 # we need to discover hosts manually and ensure that they are mapped to cells.
814 # reference: https://ask.openstack.org/en/question/102256/how-to-configure-placement-service-for-compute-node-on-ocata/
815 if [ "${OPENSTACK_BRANCH}" == "stable/ocata" ]; then
816 scp ${WORKSPACE}/setup_host_cell_mapping.sh ${!CONTROLIP}:/tmp
817 ${SSH} ${!CONTROLIP} "sudo bash /tmp/setup_host_cell_mapping.sh"
819 ${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; nova hypervisor-list"
820 # in the case that we are doing openstack (control + compute) all in one node, then the number of hypervisors
821 # will be the same as the number of openstack systems. However, if we are doing multinode openstack then the
822 # assumption is we have a single control node and the rest are compute nodes, so the number of expected hypervisors
823 # is one less than the total number of openstack systems
824 if [ $((NUM_OPENSTACK_SYSTEM / NUM_OPENSTACK_SITES)) -eq 1 ]; then
825 expected_num_hypervisors=1
827 expected_num_hypervisors=${NUM_COMPUTES_PER_SITE}
829 num_hypervisors=$(${SSH} ${!CONTROLIP} "cd /opt/stack/devstack; source openrc admin admin; openstack hypervisor list -f value | wc -l" | tail -1 | tr -d "\r")
830 if ! [ "${num_hypervisors}" ] || ! [ ${num_hypervisors} -eq ${expected_num_hypervisors} ]; then
831 echo "Error: Only $num_hypervisors hypervisors detected, expected $expected_num_hypervisors"
836 # upgrading pip, urllib3 and httplib2 so that tempest tests can be run on openstack control node
837 # this needs to happen after devstack runs because it seems devstack is pulling in specific versions
838 # of these libs that are not working for tempest.
839 ${SSH} ${!CONTROLIP} "sudo pip install --upgrade pip"
840 ${SSH} ${!CONTROLIP} "sudo pip install urllib3 --upgrade"
841 ${SSH} ${!CONTROLIP} "sudo pip install httplib2 --upgrade"
843 # Gather Compute IPs for the site
844 for j in `seq 1 ${NUM_COMPUTES_PER_SITE}`; do
845 COMPUTE_INDEX=$(((i-1) * NUM_COMPUTES_PER_SITE + j))
846 IP_VAR=OPENSTACK_COMPUTE_NODE_${COMPUTE_INDEX}_IP
847 COMPUTE_IPS[$((j-1))]=${!IP_VAR}
850 # Need to disable firewalld and iptables in compute nodes as well
851 for ip in ${COMPUTE_IPS[*]}; do
852 scp ${WORKSPACE}/disable_firewall.sh "${ip}:/tmp"
853 ${SSH} "${ip}" "sudo bash /tmp/disable_firewall.sh"
857 echo "prepare external networks by adding vxlan tunnels between all nodes on a separate bridge..."
858 # FIXME Should there be a unique gateway IP and devstack index for each site?
860 for ip in ${!CONTROLIP} ${COMPUTE_IPS[*]}; do
861 # 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
862 ${SSH} $ip "sudo ovs-vsctl --if-exists del-port br-int $PUBLIC_BRIDGE"
863 ${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++))"
867 if [ "${IPSEC_VXLAN_TUNNELS_ENABLED}" == "yes" ]; then
868 ALL_NODES=(${!CONTROLIP} ${COMPUTE_IPS[*]})
869 for ((inx_ip1=0; inx_ip1<$((${#ALL_NODES[@]} - 1)); inx_ip1++)); do
870 for ((inx_ip2=$((inx_ip1 + 1)); inx_ip2<${#ALL_NODES[@]}; inx_ip2++)); do
871 KEY1=0x$(dd if=/dev/urandom count=32 bs=1 2> /dev/null| xxd -p -c 64)
872 KEY2=0x$(dd if=/dev/urandom count=32 bs=1 2> /dev/null| xxd -p -c 64)
873 ID=0x$(dd if=/dev/urandom count=4 bs=1 2> /dev/null| xxd -p -c 8)
874 ip1=${ALL_NODES[$inx_ip1]}
875 ip2=${ALL_NODES[$inx_ip2]}
876 ${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"
877 ${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"
878 ${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"
879 ${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"
881 ${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"
882 ${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"
883 ${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"
884 ${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"
888 for ip in ${!CONTROLIP} ${COMPUTE_IPS[*]}; do
889 echo "ip xfrm configuration for node $ip:"
890 ${SSH} $ip "sudo ip xfrm policy list"
891 ${SSH} $ip "sudo ip xfrm state list"
895 # Control Node - PUBLIC_BRIDGE will act as the external router
896 # Parameter values below are used in integration/test - changing them requires updates in intergration/test as well
897 EXTNET_GATEWAY_IP="10.10.10.250"
898 EXTNET_INTERNET_IP="10.9.9.9"
899 EXTNET_PNF_IP="10.10.10.253"
900 ${SSH} ${!CONTROLIP} "sudo ifconfig ${PUBLIC_BRIDGE} up ${EXTNET_GATEWAY_IP}/24"
902 # Control Node - external net PNF simulation
903 ${SSH} ${!CONTROLIP} "
904 sudo ip netns add pnf_ns;
905 sudo ip link add pnf_veth0 type veth peer name pnf_veth1;
906 sudo ip link set pnf_veth1 netns pnf_ns;
907 sudo ip link set pnf_veth0 up;
908 sudo ip netns exec pnf_ns ifconfig pnf_veth1 up ${EXTNET_PNF_IP}/24;
909 sudo ovs-vsctl add-port ${PUBLIC_BRIDGE} pnf_veth0;
912 # Control Node - external net internet address simulation
913 ${SSH} ${!CONTROLIP} "
914 sudo ip tuntap add dev internet_tap mode tap;
915 sudo ifconfig internet_tap up ${EXTNET_INTERNET_IP}/24;
920 for compute_ip in ${COMPUTE_IPS[*]}; do
921 # Tunnel from controller to compute
922 COMPUTEPORT=compute$(( compute_index++ ))_vxlan
923 ${SSH} ${!CONTROLIP} "
924 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
926 # Tunnel from compute to controller
927 CONTROLPORT="control_vxlan"
929 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
934 if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
935 odlmgrip=OPENSTACK_HAPROXY_1_IP
936 HA_PROXY_IP=${!odlmgrip}
937 HA_PROXY_1_IP=${!odlmgrip}
938 odlmgrip2=OPENSTACK_HAPROXY_2_IP
939 HA_PROXY_2_IP=${!odlmgrip2}
940 odlmgrip3=OPENSTACK_HAPROXY_1_IP
941 HA_PROXY_3_IP=${!odlmgrip3}
943 HA_PROXY_IP=${ODL_SYSTEM_IP}
944 HA_PROXY_1_IP=${ODL_SYSTEM_1_IP}
945 HA_PROXY_2_IP=${ODL_SYSTEM_2_IP}
946 HA_PROXY_3_IP=${ODL_SYSTEM_3_IP}
949 echo "Locating test plan to use..."
950 testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
951 if [ ! -f "${testplan_filepath}" ]; then
952 testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}"
955 echo "Changing the testplan path..."
956 cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt
959 # Use the testplan if specific SUITES are not defined.
960 if [ -z "${SUITES}" ]; then
961 SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
964 if [ "${OPENSTACK_BRANCH}" == "stable/pike" ] || [ "${OPENSTACK_BRANCH}" == "master" ]; then
965 AUTH="http://${!CONTROLIP}/identity"
967 AUTH="http://${!CONTROLIP}:35357/v3"
970 # Environment Variables Needed to execute Openstack Client for NetVirt Jobs
971 cat > /tmp/os_netvirt_client_rc << EOF
972 export OS_USERNAME=admin
973 export OS_PASSWORD=admin
974 export OS_PROJECT_NAME=admin
975 export OS_USER_DOMAIN_NAME=default
976 export OS_PROJECT_DOMAIN_NAME=default
977 export OS_AUTH_URL=${AUTH}
978 export OS_IDENTITY_API_VERSION=3
979 export OS_IMAGE_API_VERSION=2
980 export OS_TENANT_NAME=admin
984 source /tmp/os_netvirt_client_rc
986 echo "Starting Robot test suites ${SUITES} ..."
987 # please add pybot -v arguments on a single line and alphabetized
988 pybot -N ${TESTPLAN} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} \
989 -v BUNDLEFOLDER:${BUNDLEFOLDER} \
990 -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \
991 -v CONTROLLER_USER:${USER} \
992 -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \
993 -v HA_PROXY_IP:${HA_PROXY_IP} \
994 -v HA_PROXY_1_IP:${HA_PROXY_1_IP} \
995 -v HA_PROXY_2_IP:${HA_PROXY_2_IP} \
996 -v HA_PROXY_3_IP:${HA_PROXY_3_IP} \
997 -v JDKVERSION:${JDKVERSION} \
998 -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \
999 -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} \
1000 -v NUM_OPENSTACK_SITES:${NUM_OPENSTACK_SITES} \
1001 -v NUM_OS_SYSTEM:${NUM_OPENSTACK_SYSTEM} \
1002 -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} \
1003 -v ODL_SNAT_MODE:${ODL_SNAT_MODE} \
1004 -v ODL_STREAM:${DISTROSTREAM} \
1005 -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \
1006 -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_1_IP} \
1007 -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \
1008 -v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_IP} \
1009 -v ODL_SYSTEM_4_IP:${ODL_SYSTEM_4_IP} \
1010 -v ODL_SYSTEM_5_IP:${ODL_SYSTEM_5_IP} \
1011 -v ODL_SYSTEM_6_IP:${ODL_SYSTEM_6_IP} \
1012 -v ODL_SYSTEM_7_IP:${ODL_SYSTEM_7_IP} \
1013 -v ODL_SYSTEM_8_IP:${ODL_SYSTEM_8_IP} \
1014 -v ODL_SYSTEM_9_IP:${ODL_SYSTEM_9_IP} \
1015 -v OS_CONTROL_NODE_IP:${OPENSTACK_CONTROL_NODE_1_IP} \
1016 -v OS_CONTROL_NODE_1_IP:${OPENSTACK_CONTROL_NODE_1_IP} \
1017 -v OS_CONTROL_NODE_2_IP:${OPENSTACK_CONTROL_NODE_2_IP} \
1018 -v OS_CONTROL_NODE_3_IP:${OPENSTACK_CONTROL_NODE_3_IP} \
1019 -v OPENSTACK_BRANCH:${OPENSTACK_BRANCH} \
1020 -v OS_COMPUTE_1_IP:${OPENSTACK_COMPUTE_NODE_1_IP} \
1021 -v OS_COMPUTE_2_IP:${OPENSTACK_COMPUTE_NODE_2_IP} \
1022 -v OS_COMPUTE_3_IP:${OPENSTACK_COMPUTE_NODE_3_IP} \
1023 -v OS_COMPUTE_4_IP:${OPENSTACK_COMPUTE_NODE_4_IP} \
1024 -v OS_COMPUTE_5_IP:${OPENSTACK_COMPUTE_NODE_5_IP} \
1025 -v OS_COMPUTE_6_IP:${OPENSTACK_COMPUTE_NODE_6_IP} \
1026 -v OS_USER:${USER} \
1027 -v PUBLIC_PHYSICAL_NETWORK:${PUBLIC_PHYSICAL_NETWORK} \
1028 -v SECURITY_GROUP_MODE:${SECURITY_GROUP_MODE} \
1029 -v TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_1_IP} \
1030 -v TOOLS_SYSTEM_1_IP:${TOOLS_SYSTEM_1_IP} \
1031 -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} \
1032 -v USER_HOME:${HOME} \
1034 ${TESTOPTIONS} ${SUITES} || true
1036 echo "Examining the files in data/log and checking file size"
1037 ssh ${ODL_SYSTEM_IP} "ls -altr /tmp/${BUNDLEFOLDER}/data/log/"
1038 ssh ${ODL_SYSTEM_IP} "du -hs /tmp/${BUNDLEFOLDER}/data/log/*"
1040 echo "Tests Executed"
1043 true # perhaps Jenkins is testing last exit code
1044 # vim: ts=4 sw=4 sts=4 et ft=sh :