tempest-plugin-sanity: respect upper-constraints

tempest-tox-plugin-sanity-check zuul gates are currently failing for
plugins that use psycopg2, since the release of psycopg2 2.8.4. Global
upper constraints have the version pinned to 2.8.3.

This change updates the sanity check to use the global constraints.

Change-Id: I8bacf2d23a005e43c79d93086559b6f8462fc1bf
diff --git a/tools/tempest-plugin-sanity.sh b/tools/tempest-plugin-sanity.sh
index a087a4c..b484a41 100644
--- a/tools/tempest-plugin-sanity.sh
+++ b/tools/tempest-plugin-sanity.sh
@@ -60,6 +60,9 @@
     fi
 }
 
+: ${UPPER_CONSTRAINTS_FILE:="https://releases.openstack.org/constraints/upper/master"}
+DEPS="-c${UPPER_CONSTRAINTS_FILE}"
+
 # function to create virtualenv to perform sanity operation
 function prepare_workspace {
     SANITY_DIR=$(pwd)
@@ -73,10 +76,10 @@
 
 # Function to install project
 function install_project {
-    "$TVENV" pip install "$SANITY_DIR"/"$1"
+    "$TVENV" pip install $DEPS "$SANITY_DIR"/"$1"
     # Check for test-requirements.txt file in a project then install it.
     if [ -e "$SANITY_DIR"/"$1"/test-requirements.txt ]; then
-        "$TVENV" pip install -r "$SANITY_DIR"/"$1"/test-requirements.txt
+        "$TVENV" pip install $DEPS -r "$SANITY_DIR"/"$1"/test-requirements.txt
     fi
 }