Module: sip-router
Branch: master
Commit: a093e8ec5f454af62ff1c72356748af69153d0d4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a093e8e…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu May 14 16:24:57 2009 +0200
test: port carrierroute DB load test to sr
---
test/unit/13.cfg | 38 +++++++++++++++++---------------------
test/unit/13.sh | 10 +++-------
2 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/test/unit/13.cfg b/test/unit/13.cfg
index f426d11..509d3f6 100644
--- a/test/unit/13.cfg
+++ b/test/unit/13.cfg
@@ -1,32 +1,28 @@
-debug=3
-mpath="../modules"
-loadmodule "sl/sl.so"
-loadmodule "tm/tm.so"
-loadmodule "xlog/xlog.so"
-loadmodule "maxfwd/maxfwd.so"
-loadmodule "carrierroute/carrierroute.so"
-loadmodule "pv/pv.so"
-loadmodule "mi_fifo/mi_fifo.so"
+debug=2
+loadpath "../../modules_k"
+loadmodule "sl"
+loadmodule "../../modules/tm/tm.so"
+loadmodule "xlog"
+loadmodule "maxfwd"
+loadmodule "../../modules/carrierroute/carrierroute.so"
+loadmodule "pv"
+loadmodule "mi_fifo"
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
-avp_aliases="domain=s:10"
-avp_aliases="carrier=s:11"
-avp_aliases="host=s:12"
-
route{
# initial sanity checks
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
return;
};
- if (msg:len > max_len) {
- sl_send_reply("513", "Message too big");
- return;
- };
- cr_user_carrier("$fU", "$fd", "$avp(carrier)");
+# if (msg:len > max_len) {
+# sl_send_reply("513", "Message too big");
+# return;
+# };
+ cr_user_carrier("$fU", "$fd", "$avp(s:11)");
$avp(domain)="start";
- if (!cr_route("$avp(carrier)", "$avp(domain)", "$rU",
"$rU", "call_id", "$avp(host)")) {
+ if (!cr_route("$avp(carrier)", "$avp(s:10)", "$rU",
"$rU", "call_id", "$avp(s:12)")) {
xlog("L_ERR", "cr_route failed\n");
exit;
}
@@ -38,11 +34,11 @@ route{
failure_route[1] {
revert_uri();
- if (!cr_next_domain("$avp(carrier)", "$avp(domain)",
"$rU", "$avp(host)", "$T_reply_code",
"$avp(domain)")) {
+ if (!cr_next_domain("$avp(s:11)", "$avp(s:10)", "$rU",
"$avp(s:12)", "$T_reply_code", "$avp(s:10)")) {
xlog("L_ERR", "cr_next_domain failed\n");
exit;
}
- if (!cr_route("$avp(carrier)", "$avp(domain)", "$rU",
"$rU", "call_id", "$avp(host)")) {
+ if (!cr_route("$avp(s:11)", "$avp(s:10)", "$rU",
"$rU", "call_id", "$avp(s:12)")) {
xlog("L_ERR", "cr_route failed\n");
exit;
}
diff --git a/test/unit/13.sh b/test/unit/13.sh
index 16a7f71..23ac6df 100755
--- a/test/unit/13.sh
+++ b/test/unit/13.sh
@@ -32,7 +32,7 @@ fi ;
cp $CFG $CFG.bak
# setup config
-echo "loadmodule \"db_mysql/db_mysql.so\"" >> $CFG
+echo "loadmodule \"../../modules/db_mysql/db_mysql.so\"" >>
$CFG
echo "modparam(\"carrierroute\", \"config_source\",
\"db\")" >> $CFG
# setup database
@@ -65,18 +65,16 @@ mask, next_domain) values ('3', '2', '1',
'49', 'host1.local', '503', '0', '0',
$MYSQL "insert into carrierfailureroute(id, carrier, domain, scan_prefix, host_name,
reply_code, flags,
mask, next_domain) values ('4', '2', '2', '49',
'host1.local', '5..', '0', '0', '3');"
-../$BIN -w . -f $CFG > /dev/null
+$BIN -w . -f $CFG > /dev/null
ret=$?
sleep 1
-cd ../scripts
-
TMPFILE=`mktemp -t kamailio-test.XXXXXXXXXX`
if [ "$ret" -eq 0 ] ; then
- ./$CTL fifo cr_dump_routes > $TMPFILE
+ $CTL fifo cr_dump_routes > $TMPFILE
ret=$?
fi ;
@@ -124,8 +122,6 @@ $MYSQL "delete from carrierfailureroute where carrier=1;"
$MYSQL "delete from carrierfailureroute where carrier=2;"
$MYSQL "delete from carrierfailureroute where carrier=3;"
-cd ../test
-
mv $CFG.bak $CFG
rm $TMPFILE