Module: sip-router
Branch: master
Commit: d1fe91745ef9517629e01c2ae38a8742d8a8899f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d1fe917…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu May 14 13:04:26 2009 +0200
test: further adaptions for sr, test 12 still not work, missing return support
---
test/unit/12.cfg | 52 ++++++++++++++++++++++++----------------------------
test/unit/12.sh | 20 ++++++++------------
test/unit/7.sh | 2 +-
3 files changed, 33 insertions(+), 41 deletions(-)
diff --git a/test/unit/12.cfg b/test/unit/12.cfg
index a8517a8..d1e11c7 100644
--- a/test/unit/12.cfg
+++ b/test/unit/12.cfg
@@ -1,23 +1,19 @@
log_stderror=yes
listen=127.0.0.1
-mpath="../modules/"
-loadmodule "db_mysql/db_mysql.so"
-loadmodule "sl/sl.so"
-loadmodule "tm/tm.so"
-loadmodule "rr/rr.so"
-loadmodule "maxfwd/maxfwd.so"
-loadmodule "textops/textops.so"
-loadmodule "xlog/xlog.so"
-loadmodule "usrloc/usrloc.so"
-loadmodule "registrar/registrar.so"
-loadmodule "pv/pv.so"
-loadmodule "mi_fifo/mi_fifo.so"
+loadpath "../../modules_k/"
+loadmodule "../../modules/db_mysql/db_mysql.so"
+loadmodule "sl"
+loadmodule "../../modules/tm/tm.so"
+loadmodule "rr"
+loadmodule "maxfwd"
+loadmodule "textops"
+loadmodule "xlog"
+loadmodule "usrloc"
+loadmodule "registrar"
+loadmodule "pv"
+loadmodule "mi_fifo"
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
-avp_aliases="identity_user=i:81"
-avp_aliases="identity_domain=i:82"
-avp_aliases="identity_uri=i:83"
-
route{
xlog("received by kamailio[$pp] at '$Tf' from $si:$sp, method:
$(rm{s.tolower}), transport: $rP:$Ri:$rp, user agent: $ua\n");
@@ -25,7 +21,7 @@ route{
xlog("L_ERR", "Error getting identity\n");
exit;
}
- xlog("L_ERR", "My identity: $avp(identity_uri)\n");
+ xlog("L_ERR", "My identity: $avp(i:83)\n");
$var(x) = "sip:" + $fU +"@" + $td;
xlog("var(x): $var(x), MD5 var(x): $(var(x){s.md5})\n");
@@ -89,24 +85,24 @@ route[1] {
route[39] {
if ($ai) {
- $avp(identity_user)=$(ai{uri.user});
- $avp(identity_domain)=$(ai{uri.domain});
- $avp(identity_uri)=$ai;
+ $avp(i:81)=$(ai{uri.user});
+ $avp(i:82)=$(ai{uri.domain});
+ $avp(i:83)=$ai;
xlog("L_ERR", "Getting identity from P-Asserted-Identity
header\n");
} else if ($pu) {
- $avp(identity_user)=$(pu{uri.user});
- $avp(identity_domain)=$(pu{uri.domain});
- $avp(identity_uri)=$pu;
+ $avp(i:81)=$(pu{uri.user});
+ $avp(i:82)=$(pu{uri.domain});
+ $avp(i:83)=$pu;
xlog("L_ERR", "Getting identity from P-Preferred-Identity
header\n");
} else if ($fu) {
- $avp(identity_user)=$(fu{uri.user});
- $avp(identity_domain)=$(fu{uri.domain});
- $avp(identity_uri)=$fu;
+ $avp(i:81)=$(fu{uri.user});
+ $avp(i:82)=$(fu{uri.domain});
+ $avp(i:83)=$fu;
xlog("L_ERR", "Getting identity from FROM URI\n");
} else {
xlog("L_ERR", "No identity for $rm: $fu -> $ru\n");
- return(-1);
+ return;# -1;
}
- return (1);
+ return; #1;
}
diff --git a/test/unit/12.sh b/test/unit/12.sh
index bd4b0a1..b3438b8 100755
--- a/test/unit/12.sh
+++ b/test/unit/12.sh
@@ -29,26 +29,24 @@ if ! (check_netcat && check_kamailio); then
exit 0
fi ;
-../$BIN -w . -f $CFG &> $TMPFILE
+$BIN -w . -f $CFG &> $TMPFILE
ret=$?
sleep 1
-# register a user
-cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
-
-cd ../scripts
if [ "$ret" -eq 0 ] ; then
- ./$CTL ul show | grep "AOR:: 1000" > /dev/null
+ # register a user
+ cat register.sip | nc -q 1 -u localhost 5060 > /dev/null
+ $CTL ul show | grep "AOR:: 1000" > /dev/null
ret=$?
+ # unregister the user
+ cat unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
fi ;
-# unregister the user
-cat ../test/unregister.sip | nc -q 1 -u localhost 5060 > /dev/null
if [ "$ret" -eq 0 ] ; then
- ./$CTL ul show | grep "AOR:: 1000" > /dev/null
+ $CTL ul show | grep "AOR:: 1000" > /dev/null
ret=$?
if [ "$ret" -eq 0 ] ; then
ret=1
@@ -85,9 +83,7 @@ if [ "$ret" -eq 0 ] ; then
fi ;
fi ;
fi ;
-
-cd ../test
-
+cat $TMPFILE
$KILL
rm $TMPFILE
diff --git a/test/unit/7.sh b/test/unit/7.sh
index 0c631d0..b2851a4 100755
--- a/test/unit/7.sh
+++ b/test/unit/7.sh
@@ -33,7 +33,7 @@ if ! (check_kamailio); then
fi ;
# start
-../$BIN -w . -f $CFG > /dev/null
+$BIN -w . -f $CFG > /dev/null
ret=$?
sleep 1