Commit bcd318b7 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3104] Implement multiple simultaneous call for test suite

Implemented test suite to place simultanesously 3 calls, then hangup.
Implemented test suite to receive simultaneously 3 calls, then wait for peer hangup.
parent 218aa58f
......@@ -49,6 +49,9 @@
<recv request="ACK" optional="true" rtd="true" crlf="true">
</recv>
<recv request="INVITE" optional="true">
</recv>
<recv request="BYE">
</recv>
......@@ -67,8 +70,6 @@
]]>
</send>
<pause milliseconds="4000"/>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
......
......@@ -251,6 +251,52 @@ function test_ip2ip_send_refused {
}
# SCENARIO 6 Test 1
function test_mult_ip2ip_send_hangup {
# start sflphoned
# /usr/lib/sflphone/sflphoned&
# start sipp server to receive calls from sflphone
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5062 -l 1 -m 10
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5064 -l 1 -m 10
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5066 -l 1 -m 10
# sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10
# wait some time to make sure sflphoned is started
# sleep 1;
# run python client and script to make calls
# python ../tools/pysflphone/pysflphone_testdbus.py &
# kill every one
# bashtrap
}
# SCENARIO 6 Test 2
function test_mult_ip2ip_recv_peer_hangup {
# start sflphoned
# /usr/lib/sflphone/sflphoned&
# start sipp server to receive calls from sflphone
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5062
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5064
sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5066
# sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT}
# wait some time to make sure sflphoned is started
# sleep 1;
# run python client and script to make calls
# python ../tools/pysflphone/pysflphone_testdbus.py &
# kill every one
# bashtrap
}
# function called if CTRL-C detected
bashtrap()
{
......@@ -267,7 +313,7 @@ bashtrap()
# Test 1: - Send an IP2IP call
# - Hangup
# test_ip2ip_send_hangup
test_ip2ip_send_hangup
# Test 2: - Send an IP2IP call
# - Peer Hangup
......@@ -299,7 +345,7 @@ bashtrap()
# Test 4: - Receive an ACCOUNT call
# - Peer Hangup
test_account_recv_peer_hungup
# test_account_recv_peer_hungup
......@@ -313,7 +359,7 @@ test_account_recv_peer_hungup
# SCENARIO 4: Transfer calls (Account)
# SCENARIO 4: Transfer calls (Account)
# Test 1: - Send an IP2IP call
# - Transfer this call to another sipp instance
......@@ -325,4 +371,13 @@ test_account_recv_peer_hungup
# Test 1: - Receive a call
# - Refuse (hangup without answer)
# test_ip2ip_send_refused
\ No newline at end of file
# test_ip2ip_send_refused
#SCENARIO 6: Multiple simultaneous Call
# Test 1: -
# test_mult_ip2ip_send_hangup
# Test 2: -
# test_mult_ip2ip_recv_peer_hangup
\ No newline at end of file
......@@ -15,6 +15,8 @@ from sflphonectrlsimple import SflPhoneCtrlSimple
# Define remote IP address constant
REMOTEADDR_lo="127.0.0.1:5062"
REMOTEADDR_lo2="127.0.0.1:5064"
REMOTEADDR_lo3="127.0.0.1:5066"
# Defines phone numbers
PHONE1="27182"
......@@ -249,6 +251,48 @@ class SflPhoneTests():
self.sflphone.start()
# SCENARIO 6 Test 1
def test_mult_ip2ip_send_hangup(self):
"""Make a first call to a sipp server (5062) and a second to sipp server (5064)"""
i = 0
while(i < 500):
callid1 = self.sflphone.Call("sip:test@" + REMOTEADDR_lo)
time.sleep(0.1)
callid2 = self.sflphone.Call("sip:test@" + REMOTEADDR_lo2)
time.sleep(0.1)
callid3 = self.sflphone.Call("sip:test@" + REMOTEADDR_lo3)
time.sleep(0.1)
self.sflphone.HangUp(callid1)
time.sleep(0.1)
self.sflphone.HangUp(callid2)
time.sleep(0.1)
self.sflphone.HangUp(callid3)
time.sleep(0.1)
i = i+1
del self.sflphone
# SCENARIO 6 Test 2
def test_mult_ip2ip_send_hangup(self):
"""Receive multiple calls peer hangup"""
# Add callback for this test
self.sflphone.onIncomingCall_cb = acceptOnIncomingCall
# Start Glib mainloop
self.sflphone.start()
del self.sflphone
# Open sflphone and connect to sflphoned through dbus
sflphone = SflPhoneCtrlSimple(True)
......@@ -268,7 +312,7 @@ sflphone.setFirstRegisteredAccount();
# Test 1: - Send an IP2IP call
# - Hangup
# testsuite.test_ip2ip_send_hangup()
testsuite.test_ip2ip_send_hangup()
# Test 2: - Send an IP2IP call
# - Peer Hangup
......@@ -300,7 +344,7 @@ sflphone.setFirstRegisteredAccount();
# Test 4: - Receive an ACCOUNT call
# - Peer Hangup
testsuite.test_account_recv_peer_hungup()
# testsuite.test_account_recv_peer_hungup()
......@@ -328,3 +372,15 @@ testsuite.test_account_recv_peer_hungup()
# Test 1: - Receive an incoming call
# - Hangup without answer
# testsuite.test_ip2ip_recv_refuse()
# SCENARIO 6: Multiple simultaneous calls
# Test 1: - Send multiple simultaneous IP2IP call
# - Hangup
# testsuite.test_mult_ip2ip_send_hangup()
# Test 2: - Receive simultaneous IP2IP call
# - Hangup
# testsuite.test_mult_ip2ip_send_hangup()
Supports Markdown
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