Commit 9a54d149 authored by Guillaume Beraudo's avatar Guillaume Beraudo

More flexisibility in tests

Allow setting of domain and user agent in launch script.
parent 7a59beb6
......@@ -707,8 +707,7 @@ void Registrar::onRequest(shared_ptr<RequestSipEvent> &ev) {
}
}
if (sip->sip_request->rq_method == sip_method_ack) {
const shared_ptr<MsgSip> &ms = ev->getMsgSip();
sip_route_t *route = ms->getSip()->sip_route;
sip_route_t *route = sip->sip_route;
bool routeAck=false;
while (route) {
if (!mAgent->isUs(route->r_url, true)) {
......
......@@ -5,11 +5,11 @@
debug=1
#Tell the proxy its list of aliases separated by commas, that is domain names or IP address it can be reached with
aliases=sip.example.org sip-auth.example.org
#aliases=
[module::Registrar]
#enabled=false
reg-domains=sip.example.org sip-auth.example.org
reg-domains=localhost
[module::MediaRelay]
enabled=false
......@@ -24,10 +24,9 @@ enabled=false
[module::Authentication]
enabled=true
auth-domains=sip-auth.example.org
from-domains=sip-auth.example.org
datasource=DSN=myodbc3-test;
request=select password from accounts_plain where id = :id
filter=(fromdomain in 'localhost') && (ua != 'noauth')
auth-domains=localhost
db-implementation=file
hashed-passwords=false
[dos-protection]
......
......@@ -3,7 +3,7 @@
<scenario>
<Global variables="userId,luserAdd,luserIpPort">
<Global variables="userId,luserAdd,domain,ua,luserIpPort">
<action>
<assign assign_to="userId" value="0" />
</action>
......@@ -13,8 +13,8 @@
<action>
<add assign_to="userId" value="1" />
<assignstr assign_to="luserIpPort" value="[local_ip]:[local_port]" />
<assignstr assign_to="luserAdd" value="sip:user0.000000@sip-auth.example.org" />
<assignstr assign_to="ruserAdd" value="sip:user[$userId]@sip.example.org" />
<assignstr assign_to="luserAdd" value="sip:user0.000000@[$domain]" />
<assignstr assign_to="ruserAdd" value="sip:user[$userId]@[$domain]" />
</action>
</nop>
......@@ -27,6 +27,7 @@
From: <[$luserAdd]>;tag=[pid]SIPpTag00[call_number]
To: <[$ruserAdd]>
Call-ID: [call_id]
User-Agent: [$ua]
CSeq: 1 INVITE
Contact: [$luserAdd]
Max-Forwards: 70
......@@ -56,6 +57,7 @@
From: <[$luserAdd]>;tag=[pid]SIPpTag00[call_number]
To: <[$ruserAdd]>
Call-ID: [call_id]
User-Agent: [$ua]
CSeq: 2 INVITE
Contact: [$luserAdd]
[authentication username=user0.000000 password=user0.000000]
......
......@@ -3,7 +3,7 @@
<scenario>
<Global variables="userId,luserAdd,luserIpPort">
<Global variables="userId,luserAdd,domain,ua,luserIpPort">
<action>
<assign assign_to="userId" value="0" />
</action>
......@@ -13,8 +13,8 @@
<action>
<add assign_to="userId" value="1" />
<assignstr assign_to="luserIpPort" value="[local_ip]:[local_port]" />
<assignstr assign_to="luserAdd" value="sip:user0.000000@sip.example.org" />
<assignstr assign_to="ruserAdd" value="sip:user[$userId]@sip.example.org" />
<assignstr assign_to="luserAdd" value="sip:user0.000000@[$domain]" />
<assignstr assign_to="ruserAdd" value="sip:user[$userId]@[$domain]" />
</action>
</nop>
......@@ -27,6 +27,7 @@
From: <[$luserAdd]>;tag=[pid]SIPpTag00[call_number]
To: <[$ruserAdd]>
Call-ID: [call_id]
User-Agent: [$ua]
CSeq: 1 INVITE
Contact: [$luserAdd]
Max-Forwards: 70
......@@ -59,6 +60,7 @@
From: <[$luserAdd]>;tag=[pid]SIPpTag00[call_number]
To: <[$ruserAdd]>[peer_tag_param]
Call-ID: [call_id]
User-Agent: [$ua]
CSeq: 1 ACK
Contact: [$luserAdd]
Max-Forwards: 70
......@@ -79,6 +81,7 @@
From: <[$luserAdd]>;tag=[pid]SIPpTag00[call_number]
To: <[$ruserAdd]>[peer_tag_param]
Call-ID: [call_id]
User-Agent: [$ua]
CSeq: 2 BYE
Contact: [$luserAdd]
[authentication username=user0.000000 password=user0.000000]
......
......@@ -6,12 +6,13 @@ FLEXISIP=flexisip
SIPP=sipp
NB_USERS=1000
EXPIRE=3600
IP=`cat /etc/hosts | grep "sip.example.org" | grep "sip-auth.example.org" | grep "relayed-auth.example.org" | grep "relayed.example.org" | grep -v "#" | awk -F'\t' '{print $1}'`
[ -z $IP ] && echo "ERROR: sip.example.org not found in /etc/hosts" && exit
PROXY=sip.example.org
IP=127.0.0.1
DOMAIN=localhost
PROXY=localhost
REGISTER_PORT=5070
USERS_PORT=5063
INVITER_PORT=5064
UA="Linphone/Linphone-3.3.x_(sipp/unknown)"
# Import configuration
FOLDER=$1
......@@ -23,9 +24,12 @@ else
echo -e "\033[1mNOT using authentication\033[0m"
fi
DOMAIN="sip.example.org$USE_AUTH"
SDOMAIN="-set domain sip.example.org"
DOMAIN="localhost"
SDOMAIN="-set domain $DOMAIN"
SEXPIRE="-set expire $EXPIRE"
SUA="-set ua $UA"
PWD="`pwd`"
if [ -z $FOLDER ]
then
echo "Usage ./launch folder, where folder is "
......@@ -33,14 +37,15 @@ then
exit
fi
[ ! -f $FOLDER/launch.config ] && echo "config file not found : "$FOLDER/launch.config"" && exit
FLEX_OPTIONS="$FLEX_OPTIONS --configfile $FOLDER/flexisip.conf --port 5060"
FLEX_OPTIONS="$FLEX_OPTIONS --configfile $FOLDER/flexisip.conf --port 5060 --set module::Authentication/datasource=$PWD/passwords"
[ -z "$2" ] && FLEX_OPTIONS="$FLEX_OPTIONS --set module::Authentication/enabled=false"
. $FOLDER/launch.config
SIPP_COMMONS="$SIPP_COMMONS -i $IP -trace_err"
REG_OPTIONS="$REG_OPTIONS -p 5070 -m `echo "1+$NB_USERS"|bc` $SIPP_COMMONS -inf authentication.csv $SDOMAIN $SEXPIRE"
REG_INVITER_OPTIONS="$REG_INVITER_OPTIONS -p 5064 -m 1 $SIPP_COMMONS -nd"
INV_OPTIONS="$INV_OPTIONS -m $NB_USERS -p 5064 $SIPP_COMMONS"
UAS_OPTIONS="$UAS_OPTIONS -p 5063 -bg $SIPP_COMMONS -mi $IP -mp 15000 -rtp_echo"
REG_INVITER_OPTIONS="$REG_INVITER_OPTIONS -p 5064 -m 1 $SIPP_COMMONS -nd $SDOMAIN $SEXPIRE $SUA"
INV_OPTIONS="$INV_OPTIONS -m $NB_USERS -p 5064 $SIPP_COMMONS $SDOMAIN $SUA"
UAS_OPTIONS="$UAS_OPTIONS -p 5063 $SIPP_COMMONS -mi $IP -mp 15000 -rtp_echo -bg"
echo "NB_USERS=$NB_USERS"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
......@@ -60,7 +65,7 @@ $CMD_UAS 2>&1 > /dev/null
CMD_FLEXISIP="$FLEXISIP $FLEX_OPTIONS"
echo -e "\n\033[1mStart flexisip: \033[0m"
echo $CMD_FLEXISIP
$CMD_FLEXISIP 2>&1 > flexisip.log &
$CMD_FLEXISIP &> flexisip.log &
sleep 2s
ps aux | grep flexisip | grep -v grep
if [ $? -ne 0 ]; then
......@@ -70,8 +75,8 @@ if [ $? -ne 0 ]; then
fi
CMD_REG_USERS="$SIPP $PROXY -sf register_users.xml $REG_OPTIONS"
echo -e "\n\033[1mRegister users (never authenticated): \033[0m"
CMD_REG_USERS="$SIPP $PROXY -sf register_users.xml $REG_OPTIONS -set ua noauth"
echo -e "\n\033[1mRegister users: \033[0m"
echo $CMD_REG_USERS
$CMD_REG_USERS
......
......@@ -3,58 +3,59 @@
<scenario>
<Global variables="luserAdd,luserIpPort">
<Global variables="luserAdd,domain,ua,expire,auth,luserIpPort">
</Global>
<nop hide="true">
<action>
<assignstr assign_to="luserIpPort" value="[local_ip]:[local_port]" />
<assignstr assign_to="luserAdd" value="sip:[$luserIpPort]" />
<assignstr assign_to="ruserAdd" value="sip:user0.000000@sip-auth.example.org" />
<assignstr assign_to="ruserAdd" value="sip:user0.000000@[$domain]" />
</action>
</nop>
<send>
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [$luserIpPort];branch=[branch]
From: [$ruserAdd];tag=[pid]SIPpTag00[call_number]
To: [$ruserAdd]
Call-ID: [call_id]
CSeq: 1 REGISTER
Contact: [$luserAdd]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
Expires: 3600
Content-Length: 0
]]>
</send>
<recv response="100" optional="true"></recv>
<recv response="401" auth="true"></recv>
<send>
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [$luserIpPort];branch=[branch]
From: [$ruserAdd];tag=[pid]SIPpTag00[call_number]
To: [$ruserAdd]
Call-ID: [call_id]
CSeq: 2 REGISTER
Contact: [$luserAdd]
[authentication username=user0.000000 password=user0.000000]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
Expires: 3600
Content-Length: 0
]]>
</send>
<recv response="100" optional="true"></recv>
<recv response="200"></recv>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
<send>
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [$luserIpPort];branch=[branch]
From: [$ruserAdd];tag=[pid]SIPpTag00[call_number]
To: [$ruserAdd]
Call-ID: [call_id]
CSeq: 1 REGISTER
Contact: [$luserAdd]
Max-Forwards: 70
User-Agent: [$ua]
Expires: [$expire]
Content-Length: 0
]]>
</send>
<recv response="100" optional="true"></recv>
<recv response="401" auth="true"></recv>
<send>
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [$luserIpPort];branch=[branch]
From: [$ruserAdd];tag=[pid]SIPpTag00[call_number]
To: [$ruserAdd]
Call-ID: [call_id]
CSeq: 2 REGISTER
Contact: [$luserAdd]
[authentication username=user0.000000 password=user0.000000]
Max-Forwards: 70
User-Agent: [$ua]
Expires: 3600
Content-Length: 0
]]>
</send>
<recv response="100" optional="true"></recv>
<recv response="200"></recv>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
......@@ -3,14 +3,14 @@
<scenario>
<Global variables="luserAdd,luserIpPort">
<Global variables="luserAdd,domain,ua,expire,luserIpPort">
</Global>
<nop hide="true">
<action>
<assignstr assign_to="luserIpPort" value="[local_ip]:[local_port]" />
<assignstr assign_to="luserAdd" value="sip:[$luserIpPort]" />
<assignstr assign_to="ruserAdd" value="sip:user0.000000@sip.example.org" />
<assignstr assign_to="ruserAdd" value="sip:user0.000000@[$domain]" />
</action>
</nop>
......@@ -25,8 +25,8 @@
CSeq: 1 REGISTER
Contact: [$luserAdd]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
Expires: 3600
User-Agent: [$ua]
Expires: [$expire]
Content-Length: 0
]]>
</send>
......
......@@ -3,7 +3,7 @@
<scenario name="Register one user with authentication">
<Global variables="userId,luserIpPort,domain,expire">
<Global variables="userId,luserIpPort,domain,ua,expire">
<action>
<assign assign_to="userId" value="0" />
</action>
......@@ -29,7 +29,7 @@
CSeq: 1 REGISTER
Contact: [$luserAddContact]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
User-Agent: [$ua]
Expires: [$expire]
Content-Length: 0
]]>
......@@ -50,7 +50,7 @@
Contact: [$luserAddContact]
[field0]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
User-Agent: [$ua]
Expires: [$expire]
Content-Length: 0
]]>
......
......@@ -3,7 +3,7 @@
<scenario name="Register one user without authentication">
<Global variables="userId,domain,expire">
<Global variables="userId,domain,ua,expire">
<action>
<assign assign_to="userId" value="0" />
</action>
......@@ -29,7 +29,7 @@
CSeq: 1 REGISTER
Contact: [$luserAddContact]
Max-Forwards: 70
User-Agent: Linphone/Linphone-3.3.x (sipp/unknown)
User-Agent: [$ua]
Expires: [$expire]
Content-Length: 0
]]>
......
......@@ -5,16 +5,16 @@
debug=1
#Tell the proxy its list of aliases separated by commas, that is domain names or IP address it can be reached with
aliases=sip.linphone.org
#aliases=sip.linphone.org
[module::Registrar]
#enabled=false
reg-domains=sip.example.org sip-auth.example.org
reg-domains=localhost
[module::MediaRelay]
#enabled=false
#from-domains=
to-domains=sip.example.org
to-domains=localhost
[module::Transcoder]
enabled=false
......@@ -23,11 +23,8 @@ enabled=false
[module::Authentication]
enabled=true
auth-domains=sip-auth.example.org
from-domains=sip-auth.example.org
#datasource=DSN=PostgreSQL test;
datasource=DSN=myodbc3;
#datasource=DSN=MySqlite;
request=select password from accounts where id = :id
filter=(fromdomain in 'localhost') && (ua != 'noauth')
auth-domains=localhost
db-implementation=file
hashed-passwords=false
SIPP=/home/guillaume/dev/sipp/sipp/trunk/sipp
FLEXISIP=/home/guillaume/dev/inst/bin/flexisip
. launch.config.perso
NB_USERS=250
#NB_USERS=1
export LD_LIBRARY_PATH=/home/guillaume/dev/inst/lib/
REG_OPTIONS="-r 10 -rp 1s -default_behaviors all,-bye --users 100"
CALL_LENGTH=200
INV_RATE=`echo $NB_USERS / $CALL_LENGTH | bc`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment