commit 1300e4d718f2d286e3611f9403260438b24025c5
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Feb 20 16:48:29 2015 +0100
regression-tests: don't use user conf by default
This commit changes the default behaviour of running regression tests to
use the configuration present in the regression-tests/env/ directory -
this means that you need to properly create a pool in the env/pool/
directory before running these regression tests.
The option -c was added for situation when you want to use your own
local LNST configuration.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/run-test.sh | 9 ++++++---
regression-tests/tests/lib.sh | 9 +++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/regression-tests/run-test.sh b/regression-tests/run-test.sh
index 0ccb4db..400802e 100755
--- a/regression-tests/run-test.sh
+++ b/regression-tests/run-test.sh
@@ -41,7 +41,7 @@ function print_separator
function usage
{
- echo "Usage: $0 [-r revision] [-l logdir] [-t list_of_tests] [-u url]
[-n]"
+ echo "Usage: $0 [-c] [-r revision] [-l logdir] [-t list_of_tests] [-u url]
[-n]"
echo " -r revision Test a specific git branch/rev/tag"
echo " Note: ignored when -s is used"
echo " -l logdir Save test results to a directory"
@@ -52,6 +52,7 @@ function usage
echo " -u url URL pointing to LNST repository that should be
used"
echo " Note: git clone and checkout by default"
echo " -s use rsync instead of git"
+ echo " -c use user configuration"
exit 0
}
@@ -60,10 +61,12 @@ function usage
#default repository url
url="../"
use_git=true
+export use_user_conf="false"
-while getopts "hlr:t:g:ns" OPTION
+while getopts "chlr:t:g:ns" OPTION
do
case $OPTION in
+ c) use_user_conf="true" ;;
h) usage ;;
l) log_dir_name="results-`date "+%Y-%m-%d-%I-%M-%S"`"
mkdir -p $log_dir_name
@@ -93,7 +96,7 @@ fi
echo "$$" >.lock
# Clone the repo
-repo=`mktemp -d`
+export repo=`mktemp -d`
if $use_git ; then
git clone $url $repo
else
diff --git a/regression-tests/tests/lib.sh b/regression-tests/tests/lib.sh
index df83ab1..5286534 100644
--- a/regression-tests/tests/lib.sh
+++ b/regression-tests/tests/lib.sh
@@ -56,3 +56,12 @@ function print_separator
{
echo
"--------------------------------------------------------------------------------"
}
+
+function lnst-ctl
+{
+ if [ "$use_user_conf" = "true" ]; then
+ command lnst-ctl $@
+ else
+ command lnst-ctl -c $repo/lnst-ctl.conf $@
+ fi
+}
Show replies by date