Merge "Switch the csit-verify-3node to use job prefix"
[releng/builder.git] / jjb / integration / integration-deploy-openstack-run-test.sh
index 8fa57c7f36df81cf6b1525c048b653441e988b5b..d413310a92be2adef584261d91668d2d73b2aca2 100644 (file)
@@ -7,6 +7,7 @@ source ${ROBOT_VENV}/bin/activate
 PYTHON="${ROBOT_VENV}/bin/python"
 SSH="ssh -t -t"
 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"
@@ -98,6 +99,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
+    fi
+}
+
+
+
 # convert commas in csv strings to spaces (ssv)
 function csv2ssv() {
     local csv=$1
@@ -158,7 +191,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}
 
@@ -252,10 +285,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
@@ -302,7 +331,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}
 
@@ -484,6 +513,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
@@ -752,6 +783,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
@@ -862,7 +894,7 @@ 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}
@@ -912,7 +944,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}
@@ -1181,6 +1213,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
@@ -1198,6 +1233,17 @@ 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