Module: sip-router Branch: master Commit: 061f868088365ab9348ad1797ba5efd979fd6ad7 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=061f8680...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Sun Oct 5 21:56:13 2014 +0200
test/unit: updated unit 20.sh
---
test/unit/20.cfg | 11 ++++++----- test/unit/20.sh | 8 +++++--- 2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/test/unit/20.cfg b/test/unit/20.cfg index e68b6ee..8ef225f 100644 --- a/test/unit/20.cfg +++ b/test/unit/20.cfg @@ -10,7 +10,7 @@ dns=yes rev_dns=no
#-----------------------Loading Modiules------------------------------------- -loadpath "../../modules_k/:../../modules/" +loadpath "../../modules/" loadmodule "tm" loadmodule "db_mysql" loadmodule "usrloc/usrloc.so" @@ -33,17 +33,18 @@ modparam("db_mysql", "timeout_interval", 2)
#-----------------------Routing configuration---------------------------------#
-route{ +request_route { if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); - exit(); + exit; }
- if(!lookup ("location")){ + if(!lookup ("location")) { sl_send_reply("404", "Not Found"); + exit; }
- if(method=="INVITE"){ + if(method=="INVITE") { setflag(1); }
diff --git a/test/unit/20.sh b/test/unit/20.sh index d0f14d3..ad48b9d 100755 --- a/test/unit/20.sh +++ b/test/unit/20.sh @@ -31,22 +31,24 @@ CFG="20.cfg" TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
# add an registrar entry to the db; -$MYSQL "INSERT INTO location (username,contact,socket,user_agent,cseq,q) VALUES ("foo","sip:foo@127.0.0.1","udp:127.0.0.1:5060","ser_test",1,-1);" +$MYSQL "INSERT INTO location (ruid, username,contact,socket,user_agent,cseq,q) VALUES ("kamailio-test-uid","foo","sip:foo@127.0.0.1","udp:127.0.0.1:5060","kamailio_test",1,-1);"
sipp -sn uas -bg -i 127.0.0.1 -m 1 -f 10 -p 5060 &> /dev/null
-$BIN -w . -f $CFG &> $TMPFILE +$BIN -w . -f $CFG > $TMPFILE 2>&1
sipp -sn uac -s foo 127.0.0.1:5059 -i 127.0.0.1 -m 1 -f 10 -p 5061 &> /dev/null
egrep 'ACC:[[:space:]]+transaction[[:space:]]+answered:[[:print:]]*code=200;reason=OK$' $TMPFILE > /dev/null ret=$?
+sleep 1 + # cleanup killall -9 sipp &> /dev/null $KILL &> /dev/null rm $TMPFILE
-$MYSQL "DELETE FROM location WHERE ((contact = "sip:foo@127.0.0.1") and (user_agent = "ser_test"));" +$MYSQL "DELETE FROM location WHERE ((contact = "sip:foo@127.0.0.1") and (user_agent = "kamailio_test"));"
exit $ret;