[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [PATCH v2 5/6] regression-tests: don't use user conf by default
From:       olichtne () redhat ! com
Date:       2015-02-20 15:48:29
Message-ID: 1424447310-32626-5-git-send-email-olichtne () redhat ! com
[Download RAW message or body]

From: Ondrej Lichtner <olichtne@redhat.com>

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@redhat.com>
---
 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
+}
-- 
2.1.0

_______________________________________________
LNST-developers mailing list
LNST-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic