[Asterisk-code-review] Attended transfer tests timing out, but still passing (testsuite[master])
Kevin Harwell
asteriskteam at digium.com
Fri Oct 2 18:11:33 CDT 2015
Kevin Harwell has uploaded a new change for review.
https://gerrit.asterisk.org/1368
Change subject: Attended transfer tests timing out, but still passing
......................................................................
Attended transfer tests timing out, but still passing
The nominal caller and callee local attended transfer tests were timing out due
the referer waiting on a BYE from Asterisk when it should have actually been
sending one instead. Changed the scenarios to send a BYE.
Also fixed a problem in the CoordinatedScenario class where a deferred callback
was not being called with the right amount of parameters.
Change-Id: I2bd79cf9af911fc1b8fb4f454a4dd06cac55a2bf
---
M lib/python/asterisk/sipp.py
M tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
M tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml
3 files changed, 35 insertions(+), 37 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/68/1368/1
diff --git a/lib/python/asterisk/sipp.py b/lib/python/asterisk/sipp.py
index 4e157b6..e959b13 100644
--- a/lib/python/asterisk/sipp.py
+++ b/lib/python/asterisk/sipp.py
@@ -703,7 +703,6 @@
self.exited = False
self.passed = False
- self.results = []
self.name = "Coordinated Scenario %d" % self.coordination_port
def kill(self):
@@ -730,7 +729,6 @@
def __scenario_callback(result, exit_deferred):
"""Callback called when a scenario completes"""
- self.results.append(result)
if self.sender.exited and self.receiver.exited:
self.exited = True
if self.sender.passed and self.receiver.passed:
@@ -748,7 +746,7 @@
def __receiver_start_callback(result):
"""Callback for receiver start"""
sender_deferred = self.sender.run(test_case)
- sender_deferred.addCallback(__scenario_callback)
+ sender_deferred.addCallback(__scenario_callback, exit_deferred)
return result
LOGGER.info("Executing coordinated SIPp scenario %d" %
diff --git a/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml b/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
index 2705b65..aedcef7 100644
--- a/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
+++ b/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
@@ -157,6 +157,8 @@
</send>
<recv response="202" rtd="true" crlf="true" />
+ <!-- In a nominal attended transfer Asterisk should always
+ be sending two notifies (SIP frags of 100 and 200) -->
<recv request="NOTIFY" />
<send>
<![CDATA[
@@ -173,12 +175,8 @@
]]>
</send>
- <recv request="NOTIFY" optional="true" next="do_notify"/>
-
- <label id="after_notify" />
-
- <recv request="BYE" />
- <send next="after_notify_response">
+ <recv request="NOTIFY" />
+ <send>
<![CDATA[
SIP/2.0 200 OK
@@ -193,22 +191,24 @@
]]>
</send>
- <label id="do_notify" />
- <send next="after_notify">
+ <send retrans="500">
<![CDATA[
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To]
- [last_Call-ID:]
- [last_CSeq:]
- Contact: <sip:bob@[local_ip]:[local_port]>
- Content-Length:0
+ BYE sip:call_c@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+ To: <sip:transfer@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: [cseq] BYE
+ Contact: sip:bob@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
]]>
</send>
- <label id="after_notify_response"/>
+
+ <recv response="200"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml b/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml
index 8fb8f99..6af3fd9 100644
--- a/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml
+++ b/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml
@@ -168,6 +168,8 @@
</send>
<recv response="202" rtd="true" crlf="true" />
+ <!-- In a nominal attended transfer Asterisk should always
+ be sending two notifies (SIP frags of 100 and 200) -->
<recv request="NOTIFY" />
<send>
<![CDATA[
@@ -184,12 +186,8 @@
]]>
</send>
- <recv request="NOTIFY" optional="true" next="do_notify"/>
-
- <label id="after_notify" />
-
- <recv request="BYE" />
- <send next="after_notify_response">
+ <recv request="NOTIFY" />
+ <send>
<![CDATA[
SIP/2.0 200 OK
@@ -204,22 +202,24 @@
]]>
</send>
- <label id="do_notify" />
- <send next="after_notify">
+ <send retrans="500">
<![CDATA[
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To]
- [last_Call-ID:]
- [last_CSeq:]
- Contact: <sip:bob@[local_ip]:[local_port]>
- Content-Length:0
+ BYE sip:call_c@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+ To: <sip:transfer@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: [cseq] BYE
+ Contact: sip:bob@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
]]>
</send>
- <label id="after_notify_response"/>
+
+ <recv response="200"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
--
To view, visit https://gerrit.asterisk.org/1368
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bd79cf9af911fc1b8fb4f454a4dd06cac55a2bf
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
More information about the asterisk-code-review
mailing list