From: Ondrej Lichtner <olichtne(a)redhat.com>
Recent removal of the --dump-pools argument in favor of the list_pools
action broke the regression-tests run-tests.sh script.
In addition to that I moved the lnst-ctl function call from the lib.sh
file into the main run-test.sh file and fixed it's handling of the -C vs
-c argument which I previously only fixed in the get_pool_dirs function.
And a final minor change is the addition of the -L argument to rsync
calls so that we also copy linked directories and files such as pools or
slave machine description xmls.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
regression-tests/run-test.sh | 20 ++++++++++++--------
regression-tests/tests/lib.sh | 9 ---------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/regression-tests/run-test.sh b/regression-tests/run-test.sh
index 02fa126..2ffd505 100755
--- a/regression-tests/run-test.sh
+++ b/regression-tests/run-test.sh
@@ -56,22 +56,27 @@ function usage
exit 0
}
-function get_pool_dirs
+function lnst-ctl
{
- if [ "$use_user_conf" = "true" ]; then
- command lnst-ctl --dump-pools 2>/dev/null | cut -d = -f2
+ if [ "$use_user_conf" = "false" ]; then
+ command lnst-ctl -C $repo/lnst-ctl.conf $@
else
- command lnst-ctl -C $repo/lnst-ctl.conf --dump-pools 2>/dev/null |
- cut -d = -f2
+ command lnst-ctl $@
fi
}
+function get_pool_dirs
+{
+ lnst-ctl list_pools 2>/dev/null | sed -n 's/Pool: .*(\(.*\))$/\1/p'
+}
+
# ---
#default repository url
url="../"
use_git=true
export use_user_conf="false"
+export -f lnst-ctl
while getopts "chlr:t:g:ns" OPTION
do
@@ -110,7 +115,7 @@ export repo=`mktemp -d`
if $use_git ; then
git clone $url $repo
else
- rsync -r $url $repo
+ rsync -r -L $url $repo
fi
if $use_git ; then
@@ -146,8 +151,7 @@ for pool_dir in $pool_dirs; do
remote_repo=`ssh "root@$hostname" "mktemp -d"`
# Transfer the repo to the machine
- rsync -r --exclude "Logs" --exclude ".git" "$repo/"
\
- "root@$hostname:$remote_repo"
+ rsync -r -L --exclude "Logs" "$repo/"
"root@$hostname:$remote_repo"
if [ ! -z $nm_off ]; then
ssh "root@$hostname" "cd $remote_repo && echo
\"use_nm = false\" >> lnst-slave.conf"
diff --git a/regression-tests/tests/lib.sh b/regression-tests/tests/lib.sh
index 5286534..df83ab1 100644
--- a/regression-tests/tests/lib.sh
+++ b/regression-tests/tests/lib.sh
@@ -56,12 +56,3 @@ 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.9.3