[asterisk-commits] mmichelson: testsuite/asterisk/trunk r6054 - in /asterisk/trunk/tests/channel...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 8 10:46:08 CST 2014


Author: mmichelson
Date: Mon Dec  8 10:46:05 2014
New Revision: 6054

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6054
Log:
Add test to ensure that receiving a 491 in response to a reinvite does not cause a crash.


Added:
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml   (with props)

Added: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf?view=auto&rev=6054
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf Mon Dec  8 10:46:05 2014
@@ -1,0 +1,5 @@
+[default]
+exten => test,1,Answer()
+same => n,Set(CONNECTEDLINE(all)=TEST <1234>)
+same => n,Echo()
+same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf?view=auto&rev=6054
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf Mon Dec  8 10:46:05 2014
@@ -1,0 +1,9 @@
+[main-transport]
+type=transport
+protocol=udp
+bind=127.0.0.1
+
+[sipp]
+type=endpoint
+send_pai=yes
+allow=ulaw

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml?view=auto&rev=6054
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml Mon Dec  8 10:46:05 2014
@@ -1,0 +1,134 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="491 Test">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+      a=ptime:20
+
+    ]]>
+  </send>
+
+  <recv response="100"
+        optional="true">
+  </recv>
+
+  <recv response="181"
+        optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+
+  <recv response="183" optional="true">
+  </recv>
+
+  <recv response="200" rtd="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="INVITE" crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 491 Request Pending
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+
+  </send>
+
+  <recv request="ACK" crlf = "true" />
+
+  <recv request="INVITE" crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+
+  </send>
+
+  <recv request="ACK" crlf = "true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 2 BYE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/sipp/uac-491.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml?view=auto&rev=6054
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml Mon Dec  8 10:46:05 2014
@@ -1,0 +1,35 @@
+testinfo:
+    summary: 'Ensure graceful operation when receiving a 491 response on a reinvite.'
+    description: |
+        'A SIPp scenario places a call into Asterisk. Once the call has been answered, we
+        trigger a reinvite by calling the CONNECTEDLINE() dialplan function. The SIPp
+        scenario responds to the reinvite with a 491 response. Asterisk then waits a small
+        amount of time (approximately 2 seconds) and then sends a new reinvite. The SIPp
+        scenario responds this time with a 200 OK, and then hangs up the call.
+
+        The reason this test exists is because there was an issue in Asterisk 12+ for a time
+        where reception of a 491 response in Asterisk would result in a crash due to improper
+        reference counting of a PJSIP structure. This test ensures that the code changes have
+        fixed the issue as expected.'
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uac-491.xml'}}
+
+properties:
+    minversion: '12.8.0'
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - app: 'sipp'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_session'
+    tags:
+        - pjsip

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/pending_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list