From d4e676ec63c542f9d49f10d49076837d322ef156 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Mon, 15 Dec 2014 16:03:04 +0000 Subject: [PATCH] Add a tempestrunrc for configuring run-tempest Add a tempestrunrc file which is sourced by run-tempest to get input settings such as image-name and concurrency. Variables in tempestrunrc can be via the ExtraConfig of the image where the element is deployed. Change-Id: I24b04b22e911732ffb9884a15cc45afabc02100a --- elements/tempest/README.md | 5 ++++- elements/tempest/bin/run-tempest | 12 +++++++++--- .../tempest/os-apply-config/etc/tempestrunrc | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 elements/tempest/os-apply-config/etc/tempestrunrc diff --git a/elements/tempest/README.md b/elements/tempest/README.md index ec7c85cc7..c4fd28aed 100644 --- a/elements/tempest/README.md +++ b/elements/tempest/README.md @@ -10,7 +10,10 @@ To successfully run tempest your overcloud should have To use you should simply run the command run-tempest with the OS_* environment variables for admin defined. +Tempest configuration may be overwritten via pass-through. +tempest-run configuration is defined in etc/tempestrunrc; values in there +may be overwritten using ExtraConfig. + TODO: * Remove as many of the filters in tests2skip.txt as possible -* Investigate setting allow_tenant_isolation to true * Investigate setting run_ssh to true diff --git a/elements/tempest/bin/run-tempest b/elements/tempest/bin/run-tempest index e178e6acd..956bba57a 100755 --- a/elements/tempest/bin/run-tempest +++ b/elements/tempest/bin/run-tempest @@ -18,9 +18,15 @@ set -eux set -o pipefail -# Setup the environment -TEMPEST_RUN_CONCURRENCY=${TEMPEST_RUN_CONCURRENCY:-0} -TEMPEST_IMAGE_NAME=${TEMPEST_IMAGE_NAME:-user} +function check_environment { + # Check the environment to fail nicely if something is missing + TEMPEST_RUN_CONCURRENCY=${TEMPEST_RUN_CONCURRENCY:?"TEMPEST_RUN_CONCURRENCY must be defined"} + TEMPEST_IMAGE_NAME=${TEMPEST_IMAGE_NAME:?"TEMPEST_IMAGE_NAME must be defined"} +} + +# Setup the environment. tempestrunrc file must exist, if not we fail +source /etc/tempestrunrc +check_environment cd /opt/stack/tempest diff --git a/elements/tempest/os-apply-config/etc/tempestrunrc b/elements/tempest/os-apply-config/etc/tempestrunrc new file mode 100644 index 000000000..1731467d8 --- /dev/null +++ b/elements/tempest/os-apply-config/etc/tempestrunrc @@ -0,0 +1,16 @@ +{{#tempestrun.concurrency}} +# Number of test processes spawned by testr +TEMPEST_RUN_CONCURRENCY={{tempestrun.concurrency}} +{{/tempestrun.concurrency}} +{{^tempestrun.concurrency}} +# Number of test processes spawned by testr +TEMPEST_RUN_CONCURRENCY=0 +{{/tempestrun.concurrency}} +{{#tempestrun.image}} +# Name of the test image to be used +TEMPEST_IMAGE_NAME={{tempestrun.image}} +{{/tempestrun.image}} +{{^tempestrun.image}} +# Name of the test image to be used +TEMPEST_IMAGE_NAME=user +{{/tempestrun.image}}