Merge "Install Openstack Clients Before Test"
authorSam Hague <shague@redhat.com>
Sun, 21 Jan 2018 13:32:35 +0000 (13:32 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sun, 21 Jan 2018 13:32:35 +0000 (13:32 +0000)
jjb/integration/integration-deploy-openstack-run-test.sh
jjb/integration/integration-install-robotframework.sh

index 8fa57c7f36df81cf6b1525c048b653441e988b5b..3bb511247e0abdb540fb1d80494be4a7ba45e5b7 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
@@ -1181,6 +1214,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 +1234,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
index d43f2d32b0e0c7dc81f2a15c64e7e9a178b6bc3d..48d5f84f317847e950771dd7de1e9838ad75cf24 100644 (file)
@@ -55,19 +55,6 @@ pip install --upgrade jmespath
 # Module for backup-restore support library
 pip install --upgrade jsonpatch
 
-# Module OpenstackClient is needed for Netvirt CSIT jobs
-# Module networking-l2gw is required for using l2gw commands with neutron client
-# Module python-neutronclient is needed for certain tests run with Openstack Newton
-#  that does not work with Openstack Client
-# Module pyhon-novaclient is installed as a dependency of openstackclient, but the
-#  latest version (v10.0.0) has some problem with "server add floating ip" that is
-#  not there with v9.0.0, so pinning it to that for now
-pip install python-openstackclient
-pip install networking-l2gw==11.0.0
-pip install python-neutronclient==6.1.0
-pip install networking-sfc
-pip install --upgrade python-novaclient==9.0.0
-
 # Print installed versions.
 pip install --upgrade pipdeptree
 pipdeptree