[asterisk-commits] kmoore: testsuite/asterisk/trunk r4690 - in /asterisk/trunk/tests/channels/pj...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 12 07:43:29 CST 2014


Author: kmoore
Date: Wed Feb 12 07:43:22 2014
New Revision: 4690

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4690
Log:
Testsuite: Add basic NAT test

This adds a basic NAT test to ensure that ACK responses are sent to the
appropriate address even when the incoming Contact header contains a
private address.

(issue ASTERISK-23106)
Review: https://reviewboard.asterisk.org/r/3169/
Reported by: Matt Jordan

Added:
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf?view=auto&rev=4690
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf Wed Feb 12 07:43:22 2014
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+same => n,Answer()
+same => n,Dial(PJSIP/ua1)
+same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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

Added: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf?view=auto&rev=4690
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf Wed Feb 12 07:43:22 2014
@@ -1,0 +1,18 @@
+[local-transport-udp]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[ua1]
+type=endpoint
+aors=ua1
+context=default
+allow=!all,ulaw
+rewrite_contact=yes
+
+[ua1]
+type=aor
+max_contacts=1
+minimum_expiration=5
+default_expiration=30
+contact=sip:ua1 at 127.0.0.1:5062

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml?view=auto&rev=4690
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml Wed Feb 12 07:43:22 2014
@@ -1,0 +1,89 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- This program is free software; you can redistribute it and/or      -->
+<!-- modify it under the terms of the GNU General Public License as     -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version.                    -->
+<!--                                                                    -->
+<!-- This program is distributed in the hope that it will be useful,    -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
+<!-- GNU General Public License for more details.                       -->
+<!--                                                                    -->
+<!-- You should have received a copy of the GNU General Public License  -->
+<!-- along with this program; if not, write to the                      -->
+<!-- Free Software Foundation, Inc.,                                    -->
+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="UAS for NAT/contact rewrite testing">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <action>
+          <!-- Save the from tag. We'll need it when we send our BYE -->
+          <ereg regexp=".*(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote_tag"/>
+      </action>
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:10.4.0.148:[local_port];transport=[transport]>
+      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:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: ua1 <sip:ua1@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]
+      To: [$remote_tag]
+      [last_Call-ID:]
+      CSeq: [cseq] BYE
+      Contact: sip:ua1@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Path Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200">
+  </recv>
+
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml?view=auto&rev=4690
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml Wed Feb 12 07:43:22 2014
@@ -1,0 +1,33 @@
+testinfo:
+    summary:     'Verify contact rewriting functions properly for chan_pjsip'
+    description: |
+        'This test verifies contact rewriting for chan_pjsip on outbound calls.'
+properties:
+    minversion: '12.1.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'res_pjsip_nat'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: originator-ua1_invite_recv
+            typename: 'pluggable_modules.Originator'
+
+originator-ua1_invite_recv:
+    trigger: 'ami_connect'
+
+sipp-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'ua1_invite_recv.xml', '-p': '5062', '-send_timeout': '20000', '-recv_timeout': '20000', '-timeout': '25000'},}

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/nat/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml?view=diff&rev=4690&r1=4689&r2=4690
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml Wed Feb 12 07:43:22 2014
@@ -2,3 +2,4 @@
     - test: 'playback'
     - test: 'echo'
     - test: 'auth'
+    - test: 'nat'




More information about the asterisk-commits mailing list