Merge "Don't allow retry to fail stacking"
[releng/builder.git] / jjb / integration / integration-deploy-openstack-run-test.sh
index 125ea2fc8b04078bc37044a116d3b88992b8b03b..d7108c9a5a7cb7641dcb0971f693dd8796387e84 100644 (file)
@@ -6,7 +6,8 @@
 source ${ROBOT_VENV}/bin/activate
 PYTHON="${ROBOT_VENV}/bin/python"
 SSH="ssh -t -t"
-ADMIN_PASSWORD=admin
+ADMIN_PASSWORD="admin"
+OPENSTACK_MASTER_CLIENTS_VERSION="pike"
 
 # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level
 echo "showing recent changes that made it in to the distribution used by this job"
@@ -26,8 +27,8 @@ function trap_handler() {
     local prog="$0"
     local lastline="$1"
     local lasterr="$2"
-    echo "${prog}: line ${lastline}: exit status of last command: ${lasterr}"
-    echo "command: ${BASH_COMMAND}"
+    echo "trap_hanlder: ${prog}: line ${lastline}: exit status of last command: ${lasterr}"
+    echo "trap_handler: command: ${BASH_COMMAND}"
     collect_logs
     exit 1
 } # trap_handler()
@@ -61,6 +62,7 @@ PUBLIC_BRIDGE: ${PUBLIC_BRIDGE}
 ENABLE_HAPROXY_FOR_NEUTRON: ${ENABLE_HAPROXY_FOR_NEUTRON}
 ENABLE_OS_SERVICES: ${ENABLE_OS_SERVICES}
 ENABLE_OS_COMPUTE_SERVICES: ${ENABLE_OS_COMPUTE_SERVICES}
+ENABLE_OS_NETWORK_SERVICES: ${ENABLE_OS_NETWORK_SERVICES}
 ENABLE_OS_PLUGINS: ${ENABLE_OS_PLUGINS}
 DISABLE_OS_SERVICES: ${DISABLE_OS_SERVICES}
 TENANT_NETWORK_TYPE: ${TENANT_NETWORK_TYPE}
@@ -98,6 +100,38 @@ function create_etc_hosts() {
     cat ${WORKSPACE}/hosts_file
 } # create_etc_hosts()
 
+#function to install Openstack Clients for Testing
+#This will pull the latest versions compatiable with the
+# openstack release
+function install_openstack_clients_in_robot_vm() {
+    packages=("python-novaclient" "python-neutronclient" "python-openstackclient")
+    for plugin_name in ${ENABLE_OS_PLUGINS}; do
+        if [ "$plugin_name" == "networking-sfc" ]; then
+            packages+=("networking-sfc")
+        fi
+    done
+    openstack_version=$(echo ${OPENSTACK_BRANCH} | cut -d/ -f2)
+    #If the job tests "master", we will use the clients from previous released stable version to avoid failures
+    if [ "${openstack_version}" == "master" ]; then
+       openstack_version=${OPENSTACK_MASTER_CLIENTS_VERSION}
+    fi
+    for package in ${packages[*]}; do
+       echo "Get the current support version of the package ${package}"
+       wget https://raw.githubusercontent.com/openstack/requirements/stable/${openstack_version}/upper-constraints.txt -O /tmp/constraints.txt 2>/dev/null
+       echo "$PYTHON -m pip install --upgrade --no-deps ${package} --no-cache-dir -c /tmp/constraints.txt"
+       $PYTHON -m pip install --upgrade --no-deps ${package} --no-cache-dir -c /tmp/constraints.txt
+       echo "$PYTHON -m pip install ${package} --no-cache-dir -c /tmp/constraints.txt"
+       $PYTHON -m pip install ${package} --no-cache-dir -c /tmp/constraints.txt
+    done
+
+    if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then
+        #networking-l2gw is not officially available in any release yet. Gettting the latest stable version.
+        $PYTHON -m pip install networking-l2gw==11.0.0
+    fi
+}
+
+
+
 # convert commas in csv strings to spaces (ssv)
 function csv2ssv() {
     local csv=$1
@@ -108,12 +142,36 @@ function csv2ssv() {
     echo "${ssv}"
 } # csv2ssv
 
+function is_openstack_feature_enabled() {
+    local feature=$1
+    for enabled_feature in $(csv2ssv ${ENABLE_OS_SERVICES})
+    do
+        if [ "${enabled_feature}" == "${feature}" ]; then
+           echo 1
+           return
+        fi
+    done
+    echo 0
+}
+
+function fix_libvirt_version_n_cpu_ocata() {
+    local ip=$1
+    ${SSH} ${ip} "
+        cd /opt/stack;
+        git clone https://git.openstack.org/openstack/requirements;
+        cd requirements;
+        git checkout stable/ocata;
+        sed -i s/libvirt-python===2.5.0/libvirt-python===3.2.0/ upper-constraints.txt
+   "
+}
+
 # Add enable_services and disable_services to the local.conf
 function add_os_services() {
     local core_services=$1
     local enable_services=$2
     local disable_services=$3
     local local_conf_file_name=$4
+    local enable_network_services=$5
 
     cat >> ${local_conf_file_name} << EOF
 enable_service $(csv2ssv "${core_services}")
@@ -126,6 +184,11 @@ EOF
     if [ -n "${disable_services}" ]; then
         cat >> ${local_conf_file_name} << EOF
 disable_service $(csv2ssv "${disable_services}")
+EOF
+    fi
+    if [ -n "${enable_network_services}" ]; then
+        cat >> ${local_conf_file_name} << EOF
+enable_service $(csv2ssv "${enable_network_services}")
 EOF
     fi
 }
@@ -147,7 +210,7 @@ RECLONE=${RECLONE}
 disable_all_services
 EOF
 
-    add_os_services "${CORE_OS_CONTROL_SERVICES}" "${ENABLE_OS_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}"
+    add_os_services "${CORE_OS_CONTROL_SERVICES}" "${ENABLE_OS_SERVICES}" "${DISABLE_OS_SERVICES}" "${local_conf_file_name}" "${ENABLE_OS_NETWORK_SERVICES}"
 
     cat >> ${local_conf_file_name} << EOF
 
@@ -158,7 +221,7 @@ NEUTRON_CREATE_INITIAL_NETWORKS=${CREATE_INITIAL_NETWORKS}
 
 ODL_MODE=manual
 ODL_MGR_IP=${MGRIP}
-ODL_PORT=8080
+ODL_PORT=${ODL_PORT}
 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
 
@@ -179,6 +242,11 @@ NEUTRON_SFC_DRIVERS=${ODL_SFC_DRIVER} # Only relevant if networking-sfc plugin i
 NEUTRON_FLOWCLASSIFIER_DRIVERS=${ODL_SFC_DRIVER} # Only relevant if networking-sfc plugin is enabled
 ETCD_PORT=2379
 EOF
+    if [ "${TENANT_NETWORK_TYPE}" == "local" ]; then
+        cat >> ${local_conf_file_name} << EOF
+ENABLE_TENANT_TUNNELS=false
+EOF
+    fi
 
     if [ "${ODL_ML2_DRIVER_VERSION}" == "v2" ]; then
         echo "ODL_V2DRIVER=True" >> ${local_conf_file_name}
@@ -252,10 +320,6 @@ minimize_polling=True
 physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1400
 path_mtu = 1458
 
-# workaround for port-status not working due to https://bugs.opendaylight.org/show_bug.cgi?id=9092
-[ml2_odl]
-odl_features=nothing
-
 [[post-config|/etc/neutron/dhcp_agent.ini]]
 [DEFAULT]
 force_metadata = True
@@ -264,6 +328,7 @@ enable_isolated_metadata = True
 [[post-config|/etc/nova/nova.conf]]
 [DEFAULT]
 force_config_drive = False
+force_raw_images = False
 
 [scheduler]
 discover_hosts_in_cells_interval = 30
@@ -301,7 +366,7 @@ Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE}
 
 ODL_MODE=manual
 ODL_MGR_IP=${MGRIP}
-ODL_PORT=8080
+ODL_PORT=${ODL_PORT}
 ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING}
 ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS}
 
@@ -344,6 +409,7 @@ EOF
 auth_strategy = keystone
 [DEFAULT]
 use_neutron = True
+force_raw_images = False
 EOF
 
     echo "Compute local.conf created:"
@@ -352,6 +418,7 @@ EOF
 
 function configure_haproxy_for_neutron_requests() {
     MGRIP=$1
+    # shellcheck disable=SC2206
     ODL_IPS=(${2//,/ })
 
     cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
@@ -429,20 +496,23 @@ EOF
 } # configure_haproxy_for_neutron_requests()
 
 # Collect the list of files on the hosts
-function list_files () {
-    local ip=$1
-    local folder=$2
-    ${SSH} ${ip} "sudo find /etc > /tmp/find.etc.txt"
-    ${SSH} ${ip} "sudo find /opt/stack > /tmp/find.opt.stack.txt"
-    ${SSH} ${ip} "sudo find /var > /tmp/find2.txt"
-    ${SSH} ${ip} "sudo find /var > /tmp/find.var.txt"
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${folder}/rsync.etc.txt
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${folder}/rsync.opt.stack.txt
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${folder}/rsync.var.txt
-    scp ${ip}:/tmp/find.etc.txt ${folder}
-    scp ${ip}:/tmp/find.opt.stack.txt ${folder}
-    scp ${ip}:/tmp/find2.txt ${folder}
-    scp ${ip}:/tmp/find.var.txt ${folder}
+function collect_files () {
+    local -r ip=$1
+    local -r folder=$2
+    finddir=/tmp/finder
+    ${SSH} ${ip} "mkdir -p ${finddir}"
+    ${SSH} ${ip} "sudo find /etc > ${finddir}/find.etc.txt"
+    ${SSH} ${ip} "sudo find /opt/stack > ${finddir}/find.opt.stack.txt"
+    ${SSH} ${ip} "sudo find /var > ${finddir}/find2.txt"
+    ${SSH} ${ip} "sudo find /var > ${finddir}/find.var.txt"
+    ${SSH} ${ip} "sudo tar -cf - -C /tmp finder | xz -T 0 > /tmp/find.tar.xz"
+    scp ${ip}:/tmp/find.tar.xz ${folder}
+    mkdir -p ${finddir}
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${finddir}/rsync.etc.txt
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${finddir}/rsync.opt.stack.txt
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${finddir}/rsync.var.txt
+    tar -cf - -C /tmp finder | xz -T 0 > /tmp/rsync.tar.xz
+    cp /tmp/rsync.tar.xz ${folder}
 }
 
 function collect_logs () {
@@ -452,15 +522,11 @@ function collect_logs () {
 echo -e "/usr/sbin/lsmod | /usr/bin/grep openvswitch\n"
 /usr/sbin/lsmod | /usr/bin/grep openvswitch
 echo -e "\ngrep ct_ /var/log/openvswitch/ovs-vswitchd.log\n"
-grep ct_ /var/log/openvswitch/ovs-vswitchd.log
-echo -e "\novsdb-tool -mm show-log\n"
-ovsdb-tool -mm show-log
+grep "Datapath supports" /var/log/openvswitch/ovs-vswitchd.log
 echo -e "\nsudo netstat -punta\n"
 sudo netstat -punta
 echo -e "\nsudo getenforce\n"
 sudo getenforce
-echo -e "\njournalctl > /tmp/journalctl.log\n"
-sudo journalctl > /tmp/journalctl.log
 echo -e "\nsudo systemctl status httpd\n"
 sudo systemctl status httpd
 echo -e "\nenv\n"
@@ -468,6 +534,16 @@ env
 source /opt/stack/devstack/openrc admin admin
 echo -e "\nenv after openrc\n"
 env
+echo -e "\nsudo du -hs /opt/stack"
+sudo du -hs /opt/stack
+echo -e "\nsudo mount"
+sudo mount
+echo -e "\ndmesg -T > /tmp/dmesg.log"
+dmesg -T > /tmp/dmesg.log
+echo -e "\njournalctl > /tmp/journalctl.log\n"
+sudo journalctl > /tmp/journalctl.log
+echo -e "\novsdb-tool -mm show-log > /tmp/ovsdb-tool.log"
+ovsdb-tool -mm show-log > /tmp/ovsdb-tool.log
 EOF
 
     # Since this log collection work is happening before the archive build macro which also
@@ -475,6 +551,8 @@ EOF
     # archives build step will essentially be a noop.
     mkdir -p ${WORKSPACE}/archives
 
+    mv /tmp/changes.txt ${WORKSPACE}/archives
+
     sleep 5
     # FIXME: Do not create .tar and gzip before copying.
     for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
@@ -493,6 +571,8 @@ EOF
         scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER}
         ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
         scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
+        ${SSH} ${!CONTROLLERIP} "tar -cf - -C /tmp/${BUNDLEFOLDER} etc | xz -T 0 > /tmp/etc.tar.xz"
+        scp ${!CONTROLLERIP}:/tmp/etc.tar.xz ${NODE_FOLDER}
         ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
         ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
         scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER}
@@ -518,6 +598,8 @@ EOF
         echo "collect_logs: for openstack control node ip: ${!OSIP}"
         NODE_FOLDER="control_${i}"
         mkdir -p ${NODE_FOLDER}
+        scp extra_debug.sh ${!OSIP}:/tmp
+        ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
         scp ${!OSIP}:/etc/dnsmasq.conf ${NODE_FOLDER}
         scp ${!OSIP}:/etc/keystone/keystone.conf ${NODE_FOLDER}
         scp ${!OSIP}:/etc/keystone/keystone-uwsgi-admin.ini ${NODE_FOLDER}
@@ -540,27 +622,28 @@ EOF
         scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER}
         scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
         scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
         scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
-        list_files "${!OSIP}" "${NODE_FOLDER}"
+        collect_files "${!OSIP}" "${NODE_FOLDER}"
+        ${SSH} ${!OSIP} "sudo tar -cf - -C /var/log rabbitmq | xz -T 0 > /tmp/rabbitmq.tar.xz "
+        scp ${!OSIP}:/tmp/rabbitmq.tar.xz ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone_access.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
-        rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/rabbitmq ${NODE_FOLDER}
         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
-        scp extra_debug.sh ${!OSIP}:/tmp
-        ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
-        scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
-        scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
-        scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}
-        ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
-        scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
         mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf
-        mv /tmp/qdhcp ${NODE_FOLDER}
+        # qdhcp files are created by robot tests and copied into /tmp/qdhcp during the test
+        tar -cf - -C /tmp qdhcp | xz -T 0 > /tmp/qdhcp.tar.xz
+        mv /tmp/qdhcp.tar.xz ${NODE_FOLDER}
         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
     done
 
@@ -570,6 +653,8 @@ EOF
         echo "collect_logs: for openstack compute node ip: ${!OSIP}"
         NODE_FOLDER="compute_${i}"
         mkdir -p ${NODE_FOLDER}
+        scp extra_debug.sh ${!OSIP}:/tmp
+        ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
         scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER}
         scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER}
         scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER}
@@ -577,23 +662,22 @@ EOF
         scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log
         scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER}
         scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/
+        scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
         scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
+        scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
-        list_files "${!OSIP}" "${NODE_FOLDER}"
+        collect_files "${!OSIP}" "${NODE_FOLDER}"
+        ${SSH} ${!OSIP} "sudo tar -cf - -C /var/log libvirt | xz -T 0 > /tmp/libvirt.tar.xz "
+        scp ${!OSIP}:/tmp/libvirt.tar.xz ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
-        rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/libvirt ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${NODE_FOLDER}
         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
-        scp extra_debug.sh ${!OSIP}:/tmp
-        ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log"
-        scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER}
-        scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER}
-        scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/
-        ${SSH} ${!OSIP} "dmesg -T > /tmp/dmesg.log"
-        scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER}
         mv local.conf_compute_${!OSIP} ${NODE_FOLDER}/local.conf
         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
     done
@@ -609,7 +693,9 @@ EOF
         mkdir -p ${TEMPEST_LOGS_DIR}
         scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest_results.html ${TEMPEST_LOGS_DIR}
         scp ${OPENSTACK_CONTROL_NODE_1_IP}:${DEVSTACK_TEMPEST_DIR}/tempest.log ${TEMPEST_LOGS_DIR}
-        mv ${WORKSPACE}/tempest_output* ${TEMPEST_LOGS_DIR}
+        if [ "$(echo ${OPENSTACK_BRANCH} | cut -d/ -f2)" != "master" ]; then
+           mv ${WORKSPACE}/tempest_output* ${TEMPEST_LOGS_DIR}
+        fi
     else
         echo "tempest results not found in ${DEVSTACK_TEMPEST_DIR}/${TESTREPO}/0"
     fi
@@ -697,7 +783,6 @@ function is_rabbitmq_ready() {
 # retry the given command ($3) until success for a number of iterations ($1)
 # sleeping ($2) between tries.
 function retry() {
-    set +e
     local -r -i max_tries=${1}
     local -r -i sleep_time=${2}
     local -r cmd=${3}
@@ -718,7 +803,6 @@ function retry() {
             fi
         fi
     done
-    set -e
     return ${rc}
 }
 
@@ -742,6 +826,7 @@ else
 fi
 
 RECLONE=False
+ODL_PORT=8181
 
 # Always compare the lists below against the devstack upstream ENABLED_SERVICES in
 # https://github.com/openstack-dev/devstack/blob/master/stackrc#L52
@@ -756,13 +841,13 @@ CORE_OS_CONTROL_SERVICES+=",key"
 CORE_OS_CONTROL_SERVICES+=",n-api,n-api-meta,n-cauth,n-cond,n-crt,n-obj,n-sch"
 # ODL - services to connect to ODL
 CORE_OS_CONTROL_SERVICES+=",odl-compute,odl-neutron"
-# Neutron
-CORE_OS_CONTROL_SERVICES+=",q-dhcp,q-meta,q-svc"
 # Additional services
 CORE_OS_CONTROL_SERVICES+=",mysql,rabbit"
 
+# collect performance stats
+CORE_OS_COMPUTE_SERVICES="dstat"
 # computes only need nova and odl
-CORE_OS_COMPUTE_SERVICES="n-cpu,odl-compute"
+CORE_OS_COMPUTE_SERVICES+=",n-cpu,odl-compute"
 
 cat > ${WORKSPACE}/disable_firewall.sh << EOF
 sudo systemctl stop firewalld
@@ -793,6 +878,8 @@ echo "127.0.0.1   localhost \${HOSTNAME}" >> /tmp/hosts
 echo "::1         localhost \${HOSTNAME}" >> /tmp/hosts
 sudo mv /tmp/hosts /etc/hosts
 sudo mkdir /opt/stack
+echo "Create RAM disk for /opt/stack"
+sudo mount -t tmpfs -o size=2G tmpfs /opt/stack
 sudo chmod 777 /opt/stack
 cd /opt/stack
 echo "git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}"
@@ -807,6 +894,10 @@ echo "workaround: adjust wait from 60s to 1800s (30m)"
 sed -i 's/wait_for_compute 60/wait_for_compute 1800/g' /opt/stack/devstack/lib/nova
 # TODO: modify sleep 1 to sleep 60, search wait_for_compute, then first sleep 1
 # that would just reduce the number of logs in the compute stack.log
+
+#Install qemu-img command in Control Node for Pike
+echo "Install qemu-img application"
+sudo yum install -y qemu-img
 EOF
 
 cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF
@@ -846,25 +937,34 @@ done
 
 for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
     CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP
-    echo "Configure the stack of the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
+    echo "Configure the stack of the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${!CONTROLIP}"
     scp ${WORKSPACE}/disable_firewall.sh ${!CONTROLIP}:/tmp
     ${SSH} ${!CONTROLIP} "sudo bash /tmp/disable_firewall.sh"
     create_etc_hosts ${!CONTROLIP}
     scp ${WORKSPACE}/hosts_file ${!CONTROLIP}:/tmp/hosts
     scp ${WORKSPACE}/get_devstack.sh ${!CONTROLIP}:/tmp
+    # devstack Master is yet to migrate fully to lib/neutron, there are some ugly hacks that is
+    # affecting the stacking.
+    #Workaround For Queens, Make the physical Network as physnet1 in lib/neutron
+    #Workaround Comment out creating initial Networks in lib/neutron
     ${SSH} ${!CONTROLIP} "bash /tmp/get_devstack.sh > /tmp/get_devstack.sh.txt 2>&1"
+    if [ "${ODL_ML2_BRANCH}" == "master" ]; then
+       ssh ${!CONTROLIP} "sed -i 's/flat_networks public/flat_networks public,physnet1/' /opt/stack/devstack/lib/neutron"
+       ssh ${!CONTROLIP} "sed -i '186i iniset \$NEUTRON_CORE_PLUGIN_CONF ml2_type_vlan network_vlan_ranges public:1:4094,physnet1:1:4094' /opt/stack/devstack/lib/neutron"
+    fi
+    if [[ "${ODL_ML2_BRANCH}" == "stable/ocata" && "$(is_openstack_feature_enabled n-cpu)" == "1" ]]; then
+        echo "Updating requirements for ${ODL_ML2_BRANCH}"
+        echo "Workaround for https://review.openstack.org/#/c/491032/"
+        echo "Modify upper-constraints to use libvirt-python 3.2.0"
+        fix_libvirt_version_n_cpu_ocata ${!CONTROLIP}
+    fi
     create_control_node_local_conf ${!CONTROLIP} ${ODLMGRIP[$i]} "${ODL_OVS_MGRS[$i]}"
     scp ${WORKSPACE}/local.conf_control_${!CONTROLIP} ${!CONTROLIP}:/opt/stack/devstack/local.conf
     echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
     ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!CONTROLIP} "ps -ef | grep stack.sh"
     ssh ${!CONTROLIP} "ls -lrt /opt/stack/devstack/nohup.out"
-    os_node_list+=(${!CONTROLIP})
-    # Workaround for stable/newton jobs
-    # TODO: can this be removed now?
-    if [ "${ODL_ML2_BRANCH}" == "stable/newton" ]; then
-        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"
-    fi
+    os_node_list+=("${!CONTROLIP}")
 done
 
 # This is a backup to the CELLSV2_SETUP=singleconductor workaround. Keeping it here as an easy lookup
@@ -879,16 +979,20 @@ done
 # AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
 # Compare that timestamp to this log in the control stack.log: sudo rabbitmqctl set_permissions -p nova_cell1 stackrabbit
 # If the n-cpu.log is earlier than the control stack.log timestamp then the failure condition is likely hit.
-WAIT_FOR_RABBITMQ_MINUTES=60
-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"
-retry ${WAIT_FOR_RABBITMQ_MINUTES} 60 "is_rabbitmq_ready ${OPENSTACK_CONTROL_NODE_1_IP}"
-rc=$?
-if ((${rc} == 0)); then
-    echo "rabbitmq is ready, starting ${NUM_OPENSTACK_COMPUTE_NODES} compute(s)"
-else
-    echo "rabbitmq was not ready in ${WAIT_FOR_RABBITMQ_MINUTES}m"
-    collect_logs
-    exit 1
+if [ ${NUM_OPENSTACK_COMPUTE_NODES} -gt 0 ]; then
+    WAIT_FOR_RABBITMQ_MINUTES=60
+    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"
+    set +e
+    retry ${WAIT_FOR_RABBITMQ_MINUTES} 60 "is_rabbitmq_ready ${OPENSTACK_CONTROL_NODE_1_IP}"
+    rc=$?
+    set -e
+    if ((${rc} == 0)); then
+      echo "rabbitmq is ready, starting ${NUM_OPENSTACK_COMPUTE_NODES} compute(s)"
+    else
+      echo "rabbitmq was not ready in ${WAIT_FOR_RABBITMQ_MINUTES}m"
+      collect_logs
+      exit 1
+    fi
 fi
 
 for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
@@ -896,7 +1000,7 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
     SITE_INDEX=$((((i - 1) / NUM_COMPUTES_PER_SITE) + 1)) # We need the site index to infer the control node IP for this compute
     COMPUTEIP=OPENSTACK_COMPUTE_NODE_${i}_IP
     CONTROLIP=OPENSTACK_CONTROL_NODE_${SITE_INDEX}_IP
-    echo "Configure the stack of the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
+    echo "Configure the stack of the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${!COMPUTEIP}"
     scp ${WORKSPACE}/disable_firewall.sh "${!COMPUTEIP}:/tmp"
     ${SSH} "${!COMPUTEIP}" "sudo bash /tmp/disable_firewall.sh"
     create_etc_hosts ${!COMPUTEIP} ${!CONTROLIP}
@@ -907,20 +1011,14 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
         echo "Updating requirements for ${ODL_ML2_BRANCH}"
         echo "Workaround for https://review.openstack.org/#/c/491032/"
         echo "Modify upper-constraints to use libvirt-python 3.2.0"
-        ${SSH} ${!COMPUTEIP} "
-            cd /opt/stack;
-            git clone https://git.openstack.org/openstack/requirements;
-            cd requirements;
-            git checkout stable/ocata;
-            sed -i s/libvirt-python===2.5.0/libvirt-python===3.2.0/ upper-constraints.txt
-        "
+        fix_libvirt_version_n_cpu_ocata ${!COMPUTEIP}
     fi
     create_compute_node_local_conf ${!COMPUTEIP} ${!CONTROLIP} ${ODLMGRIP[$SITE_INDEX]} "${ODL_OVS_MGRS[$SITE_INDEX]}"
     scp ${WORKSPACE}/local.conf_compute_${!COMPUTEIP} ${!COMPUTEIP}:/opt/stack/devstack/local.conf
     echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}"
     ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"
-    os_node_list+=(${!COMPUTEIP})
+    os_node_list+=("${!COMPUTEIP}")
 done
 
 echo "nodelist: ${os_node_list[*]}"
@@ -1048,6 +1146,7 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
 
     # ipsec support
     if [ "${IPSEC_VXLAN_TUNNELS_ENABLED}" == "yes" ]; then
+        # shellcheck disable=SC2206
         ALL_NODES=(${!CONTROLIP} ${COMPUTE_IPS[*]})
         for ((inx_ip1=0; inx_ip1<$((${#ALL_NODES[@]} - 1)); inx_ip1++)); do
             for ((inx_ip2=$((inx_ip1 + 1)); inx_ip2<${#ALL_NODES[@]}; inx_ip2++)); do
@@ -1091,10 +1190,6 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do
         sudo ip netns exec pnf_ns ifconfig pnf_veth1 up ${EXTNET_PNF_IP}/24;
         sudo ovs-vsctl add-port ${PUBLIC_BRIDGE} pnf_veth0;
     "
-    # Control Node - set VXLAN TEP IP for Genius Auto TZ
-    ${SSH} ${!CONTROLIP} "
-        sudo ovs-vsctl set O . external_ids:tep-ip=${!CONTROLIP};
-    "
 
     # Control Node - external net internet address simulation
     ${SSH} ${!CONTROLIP} "
@@ -1155,7 +1250,7 @@ else
     workpath="${WORKSPACE}/test/csit/suites"
     for suite in ${SUITES}; do
         fullsuite="${workpath}/${suite}"
-        if [ -z ${newsuites} ]; then
+        if [ -z "${newsuites}" ]; then
             newsuites+=${fullsuite}
         else
             newsuites+=" "${fullsuite}
@@ -1164,6 +1259,9 @@ else
     SUITES=${newsuites}
 fi
 
+#install all client versions required for this job testing
+install_openstack_clients_in_robot_vm
+
 # TODO: run openrc on control node and then scrape the vars from it
 # Environment Variables Needed to execute Openstack Client for NetVirt Jobs
 cat > /tmp/os_netvirt_client_rc << EOF
@@ -1181,21 +1279,37 @@ EOF
 
 source /tmp/os_netvirt_client_rc
 
+echo "Get all versions before executing pybot"
+echo "openstack --version"
+which openstack
+openstack --version
+echo "nova --version"
+which nova
+nova --version
+echo "neutron --version"
+which neutron
+neutron --version
+
 echo "Starting Robot test suites ${SUITES} ..."
 # please add pybot -v arguments on a single line and alphabetized
 suite_num=0
 for suite in ${SUITES}; do
-    # prepend a incrmental counter to the suite name so that the full robot log combining all the suites as is done
-    # in the rebot step below will list all the suites in chronological order as rebot seems to alphabatize them
+    # prepend an incremental counter to the suite name so that the full robot log combining all the suites as is done
+    # in the rebot step below will list all the suites in chronological order as rebot seems to alphabetize them
     let "suite_num = suite_num + 1"
     suite_index="$(printf %02d ${suite_num})"
     suite_name="$(basename ${suite} | cut -d. -f1)"
     log_name="${suite_index}_${suite_name}"
-    pybot -N ${log_name} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} \
+    pybot -N ${log_name} \
+    -c critical -e exclude -e skip_if_${DISTROSTREAM} \
     --log log_${log_name}.html --report None --output output_${log_name}.xml \
+    --removekeywords wuks \
+    --removekeywords name:SetupUtils.Setup_Utils_For_Setup_And_Teardown \
+    --removekeywords name:SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing \
+    --removekeywords name:OpenStackOperations.Add_OVS_Logging_On_All_OpenStack_Nodes \
     -v BUNDLEFOLDER:${BUNDLEFOLDER} \
     -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \
-    -v CONTROLLERFEATURES:${CONTROLLERFEATURES} \
+    -v CONTROLLERFEATURES:"${CONTROLLERFEATURES}" \
     -v CONTROLLER_USER:${USER} \
     -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \
     -v HA_PROXY_IP:${HA_PROXY_IP} \
@@ -1209,6 +1323,7 @@ for suite in ${SUITES}; do
     -v NUM_OS_SYSTEM:${NUM_OPENSTACK_SYSTEM} \
     -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} \
     -v ODL_SNAT_MODE:${ODL_SNAT_MODE} \
+    -v ODL_ENABLE_L3_FWD:${ODL_ENABLE_L3_FWD} \
     -v ODL_STREAM:${DISTROSTREAM} \
     -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \
     -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_1_IP} \