diff options
author | Martin Schwenke <martin@meltin.net> | 2012-04-19 11:23:07 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-04-27 15:40:43 +1000 |
commit | 769407feabd4e6414da303b78a7b680f615a882b (patch) | |
tree | 6bc68d62a59bf19227a716802e0ff6372e464f00 | |
parent | f30d4c575edc9eddddb9445b5d4235d9abcad73a (diff) | |
download | samba-769407feabd4e6414da303b78a7b680f615a882b.tar.gz samba-769407feabd4e6414da303b78a7b680f615a882b.tar.xz samba-769407feabd4e6414da303b78a7b680f615a882b.zip |
tests: Move relative directory path hack from run_tests to common.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 66a7fece867966528689d2784a284e32d687a0f5)
-rw-r--r-- | ctdb/tests/scripts/common.sh | 6 | ||||
-rwxr-xr-x | ctdb/tests/scripts/run_tests | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index 481ef298c6..2d7b2e292e 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -2,7 +2,11 @@ # Common variables and functions for all CTDB tests. -export TEST_SUBDIR=$(dirname $0) +# This expands the most probable problem cases like "." and "..". +TEST_SUBDIR=$(dirname "$0") +if [ $(dirname "$TEST_SUBDIR") = "." ] ; then + TEST_SUBDIR=$(cd "$TEST_SUBDIR" ; pwd) +fi CTDB_DIR=$(dirname $(dirname "$TEST_SUBDIR")) diff --git a/ctdb/tests/scripts/run_tests b/ctdb/tests/scripts/run_tests index 5efe6e4147..2fc6979961 100755 --- a/ctdb/tests/scripts/run_tests +++ b/ctdb/tests/scripts/run_tests @@ -168,10 +168,6 @@ run_one_test () for f ; do if [ -d "$f" ] ; then - # This expands the most probable problem cases like "." and "..". - if [ $(dirname "$f") = "." ] ; then - f=$(cd "$f" ; pwd) - fi for i in $(ls "${f%/}/"*".sh" 2>/dev/null) ; do run_one_test "$i" done |