[lnst] regression-tests: update test 3
by Jiří Pírko
commit 54b3b65292bae52cacc79b4e84743d1a84a41649
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:06:01 2015 +0100
regression-tests: update test 3
This test contained a mistake - lnst-ctl execution always failed because
no match could be found in a pool - the recipe required a machine with a
parameter and we always created pools with machines that didn't have any
parameters. However the test only checked that lnst-ctl failed and
reported success. This is now fixed.
Additionaly the functionality we tested is the same as with the removed
test 01 and is now supported as a feature. So now the test checks that
lnst-ctl succeeds.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/tests/3/desc | 4 ++++
regression-tests/tests/3/recipe.xml | 5 +----
regression-tests/tests/3/run.sh | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/regression-tests/tests/3/desc b/regression-tests/tests/3/desc
index 7eeaf6e..8669094 100644
--- a/regression-tests/tests/3/desc
+++ b/regression-tests/tests/3/desc
@@ -2,3 +2,7 @@ Check corner case in matching algorithm
This test checks that controller fails if it runs a recipe with just one
machine specified. The controller should fail.
+
+UPDATE:
+This is now supported in new lnst versions, the controller therefore shoudln't
+fail. Changing the recipe.xml and run.sh to reflect this.
diff --git a/regression-tests/tests/3/recipe.xml b/regression-tests/tests/3/recipe.xml
index c261555..1e7845d 100644
--- a/regression-tests/tests/3/recipe.xml
+++ b/regression-tests/tests/3/recipe.xml
@@ -1,9 +1,6 @@
<lnstrecipe>
<network>
<host id="client">
- <params>
- <param name="os" value="rhel7"/>
- </params>
<interfaces>
<eth id="nic1" label="inet">
<addresses>
@@ -16,7 +13,7 @@
<task>
<run module="IcmpPing" host="client">
<options>
- <option name="addr" value="{ip(lb,nic1)}"/>
+ <option name="addr" value="{ip(client,nic1)}"/>
<option name="count" value="40"/>
</options>
</run>
diff --git a/regression-tests/tests/3/run.sh b/regression-tests/tests/3/run.sh
index e6e9a99..50ab9ce 100755
--- a/regression-tests/tests/3/run.sh
+++ b/regression-tests/tests/3/run.sh
@@ -7,6 +7,6 @@ init_test
lnst-ctl -d run recipe.xml
rv=$?
-assert_status "error" "$rv"
+assert_status "pass" "$rv"
end_test
9 years, 3 months
[lnst] removing regression test 01
by Jiří Pírko
commit f313f727d6c36dda4c15ce6edce1a3e975bf9522
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:06:00 2015 +0100
removing regression test 01
This test was deprecated since it tested a corner case that was
previously viewed as a bug, but is now supported as a feature.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/tests/01/desc | 6 ----
regression-tests/tests/01/ipvs-ping-check.xml | 35 -------------------------
regression-tests/tests/01/run.sh | 12 --------
3 files changed, 0 insertions(+), 53 deletions(-)
9 years, 3 months
[lnst] rename run-git-test, add rsync option, change -g option
by Jiří Pírko
commit 86339ea57a51d075416946e5a42187b39a16ab26
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:05:59 2015 +0100
rename run-git-test, add rsync option, change -g option
This commit renames the bash script that runs lnst regression tests to
run-test.sh. The reason behind this is that the tests don't really have
anything in common with git.
This commit also adds the argument -s which makes the script use rsync
to download lnst from a specified URL instead of using git clone on that
url.
When using the script to run all tests, before execution they will be
numerically sorted so that we keep the ordering in which they were
added.
Finally I changed the -g option (for git url) to -u (for url) since it
makes more sense like this.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/{run-git-test.sh => run-test.sh} | 62 +++++++++++++--------
1 files changed, 38 insertions(+), 24 deletions(-)
---
diff --git a/regression-tests/run-git-test.sh b/regression-tests/run-test.sh
similarity index 81%
rename from regression-tests/run-git-test.sh
rename to regression-tests/run-test.sh
index ef84a2e..1c9c657 100755
--- a/regression-tests/run-git-test.sh
+++ b/regression-tests/run-test.sh
@@ -41,23 +41,27 @@ function print_separator
function usage
{
- echo "Usage: $0 [-r revision] [-l logdir] [-t list_of_tests] [-g url] [-n]"
+ echo "Usage: $0 [-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"
echo " -t list_of_tests Run only these tests"
echo " Example: -t 0,1,2 will run tests 0, 1, and 2"
echo " -n Disable use of NetworkManager on slavemachines"
echo " Note: enabled by default"
- echo " -g url URL pointing to LNST git repository that should be cloned"
+ 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"
exit 0
}
# ---
#default repository url
-git_url="../"
+url="../"
+use_git=true
-while getopts "hlr:t:g:n" OPTION
+while getopts "hlr:t:g:ns" OPTION
do
case $OPTION in
h) usage ;;
@@ -67,7 +71,8 @@ do
r) rev="$OPTARG";;
t) tests="`tr "," " " <<<"$OPTARG"`" ;;
n) nm_off="yes";;
- g) git_url="$OPTARG";;
+ g) url="$OPTARG";;
+ s) use_git=false;;
\?) exit 1;;
esac
done
@@ -89,17 +94,23 @@ echo "$$" >.lock
# Clone the repo
repo=`mktemp -d`
-git clone $git_url $repo
-
-# Checkout the appropriate revision/tag
-if [ ! -z "$rev" ]; then
- pushd . >/dev/null
- cd $repo
- git checkout "$rev"
- popd >/dev/null
+if $use_git ; then
+ git clone $url $repo
else
- log "Revision not specified, using HEAD."
- rev="HEAD"
+ rsync -r $url $repo
+fi
+
+if $use_git ; then
+ # Checkout the appropriate revision/tag
+ if [ ! -z "$rev" ]; then
+ pushd . >/dev/null
+ cd $repo
+ git checkout "$rev"
+ popd >/dev/null
+ else
+ log "Revision not specified, using HEAD."
+ rev="HEAD"
+ fi
fi
# Load the proper config
@@ -150,7 +161,7 @@ print_separator
# In case the list of test names to run was omitted, run all of them
if [ -z "$tests" ]; then
- tests="`ls -1 tests/ | grep -v '\.sh$'`"
+ tests="`command ls -1 tests/ | grep -v '\.sh$' | sort -n`"
fi
for test_name in $tests; do
@@ -208,14 +219,17 @@ print_separator
sleep 1
# Cleanup
-while read line; do
- hostname=`awk '{print $1}' <<<"$line"`
- pid=`awk '{print $2}' <<<"$line"`
- remote_repo=`awk '{print $3}' <<<"$line"`
-
- kill $pid
- ssh -n "root@$hostname" "rm -r $remote_repo"
-done <<< "$slave_status"
+if [ $slave_status ]; then
+ while read line; do
+ hostname=`awk '{print $1}' <<<"$line"`
+ pid=`awk '{print $2}' <<<"$line"`
+ remote_repo=`awk '{print $3}' <<<"$line"`
+
+ echo "kill $pid"
+ kill $pid
+ ssh -n "root@$hostname" "rm -r $remote_repo"
+ done <<< "$slave_status"
+fi
rm -rf $repo
9 years, 3 months