Module: sip-router
Branch: master
Commit: 21ac862fd73687d469f3e0ef9e535c521cfc3e75
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=21ac862…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed May 6 17:12:17 2009 +0200
test: adaption of kamailio specific scripts to sr, more generalization
---
test/unit/include/common | 15 ++++++++++-----
test/unit/include/require | 11 ++++++++---
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/test/unit/include/common b/test/unit/include/common
index 48f48b2..feda07e 100644
--- a/test/unit/include/common
+++ b/test/unit/include/common
@@ -1,6 +1,11 @@
+# all database modules
DB_ALL_MOD="acc|alias_db|auth_db|avpops|dialog|dialplan|dispatcher|domain|domainpolicy|group|imc|lcr|msilo|siptrace|speeddial|uri_db|usrloc|permissions|pdt|userblacklist"
-CTLRC="kamctlrc"
-CTL="kamctl"
-DBCTL="kamdbctl"
-BIN="kamailio"
-KILL="killall -15 kamailio"
\ No newline at end of file
+# root directory relative to tests
+SR_DIR="../.."
+CTLRC="$SR_DIR/scripts/kamctlrc"
+CTL="$SR_DIR/scripts/kamctl"
+DBCTL="$SR_DIR/scripts/kamdbctl"
+BIN="$SR_DIR/ser"
+KILL="killall -15 $BIN"
+# test directory relative to root
+TEST_DIR="test/unit"
\ No newline at end of file
diff --git a/test/unit/include/require b/test/unit/include/require
index fef0bcb..80a1058 100644
--- a/test/unit/include/require
+++ b/test/unit/include/require
@@ -16,8 +16,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+source include/common
+
function check_kamailio() {
- if ! (test -e ../kamailio) ; then
+ if ! (test -e $BIN) ; then
echo "kamailio not found, not run"
return -1
fi;
@@ -30,8 +32,11 @@ function check_module() {
return -1
fi
- if ! (test -e ../modules/$1/$1.so) ; then
- echo "modules/$1/$1.so not found, not run"
+ if ! (test -e $SR_DIR/modules_k/$1/$1.so) ; then
+ echo "$SR_DIR/modules_k/$1/$1.so not found, try $SR_DIR/modules"
+ fi;
+ if ! (test -e $SR_DIR/modules/$1/$1.so) ; then
+ echo "$SR_DIR/modules/$1/$1.so not found, not run"
return -1
fi;
return 0