Add an update option to run_tests.sh
This commit adds an update option to run_tests.sh. This option
is used to rerun install_venv.py on an already installed venv.
This will then just update out of date packages with pip.
Change-Id: I7da0226a6621ed7120b00eafd8d0ce75c1c2a67b
diff --git a/run_tests.sh b/run_tests.sh
index 3a2bd94..968f9a3 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -8,6 +8,7 @@
echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local environment"
echo " -n, --no-site-packages Isolate the virtualenv from the global Python environment"
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
+ echo " -u, --update Update the virtual environment with any newer package versions"
echo " -s, --smoke Only run smoke tests"
echo " -w, --whitebox Only run whitebox tests"
echo " -c, --nova-coverage Enable Nova coverage collection"
@@ -30,6 +31,7 @@
wrapper=""
nova_coverage=0
config_file=""
+update=0
if ! options=$(getopt -o VNnfswcphdsC: -l virtual-env,no-virtual-env,no-site-packages,force,smoke,whitebox,nova-coverage,pep8,help,debug,stdout,config: -- "$@")
then
@@ -47,6 +49,7 @@
-N|--no-virtual-env) always_venv=0; never_venv=1;;
-n|--no-site-packages) no_site_packages=1;;
-f|--force) force=1;;
+ -u|--update) update=1;;
-d|--debug) set -o xtrace;;
-c|--nova-coverage) let nova_coverage=1;;
-C|--config) config_file=$2; shift;;
@@ -121,6 +124,10 @@
echo "Cleaning virtualenv..."
rm -rf ${venv}
fi
+ if [ $update -eq 1 ]; then
+ echo "Updating virtualenv..."
+ python tools/install_venv.py $installvenvopts
+ fi
if [ -e ${venv} ]; then
wrapper="${with_venv}"
else