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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 19 10:47:28 CDT 2012


Author: mmichelson
Date: Tue Jun 19 10:47:22 2012
New Revision: 3267

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3267
Log:
Add test for request routing when using an outboundproxy and authentication is required.

Review: https://reviewboard.asterisk.org/r/1992


Added:
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml   (with props)
    asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/SIP/tests.yaml

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/extensions.conf?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/extensions.conf Tue Jun 19 10:47:22 2012
@@ -1,0 +1,2 @@
+[default]
+exten => uas,1,Dial(sip/sipp-uas,,tT)

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

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

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

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf Tue Jun 19 10:47:22 2012
@@ -1,0 +1,24 @@
+[general]
+context = default
+;Must set nat=no so that force_rport
+;is not used.
+nat=no
+outboundproxy=127.0.0.1:5062
+
+[authentication]
+auth=who:cares at sipp.test
+
+[sipp-uac]
+type=peer
+host=127.0.0.1
+port=5063
+
+[sipp-uas]
+type=peer
+host=127.0.0.1
+port=5065
+
+[sipp-target]
+type=peer
+host=127.0.0.1
+port=5061

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test Tue Jun 19 10:47:22 2012
@@ -1,0 +1,39 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2011, Digium, Inc.
+Mark Michelson <mmichelson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+
+from twisted.internet import reactor
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "SIP/sip_outbound_proxy"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+    {'scenario' : 'uas-ackonly.xml',},
+    {'scenario' : 'uas.xml',},
+    {'scenario' : 'uac.xml', '-d' : '3000', '-s' : 'uas' },
+]
+
+# generate SIPP scenarios with appropriate port numbers and the config to go with it
+def main():
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    reactor.run()
+    if not test.passed:
+        return 1
+
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(main())

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml Tue Jun 19 10:47:22 2012
@@ -1,0 +1,114 @@
+<?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 'uac' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="Basic Sipstone UAC">
+  <!-- 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:[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]:[remote_port]>
+      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:0 PCMU/8000
+
+    ]]>
+  </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>
+
+  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
+  <!-- are saved and used for following messages sent. Useful to test   -->
+  <!-- against stateful SIP proxies/B2BUAs.                             -->
+  <recv response="200" rtd="true">
+  </recv>
+
+  <!-- Packet lost can be simulated in any send/recv message by         -->
+  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
+  <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]:[remote_port]>[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>
+
+  <!-- This delay can be customized by the -d command-line option       -->
+  <!-- or by adding a 'milliseconds = "value"' option here.             -->
+  <pause/>
+
+  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
+  <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: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>[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>
+

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uac.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml Tue Jun 19 10:47:22 2012
@@ -1,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+  <recv request="ACK" crlf="true">
+  </recv>
+
+  <recv request="BYE">
+  </recv>
+
+  <send>
+    <![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>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas-ackonly.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml Tue Jun 19 10:47:22 2012
@@ -1,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+  <recv request="INVITE" crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 401 Unauthorized
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      WWW-Authenticate: Digest realm="sipp.test", nonce="1234567890", opaque="0987654321", qop="auth", algorithm=MD5
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        optional="true"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- We don't care about the actual auth credentials in this
+       test. We just want to be sure the INVITE is routed to us -->
+  <recv request="INVITE" crlf="true">
+  </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:[local_ip]:5061;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>
+
+  <!-- The ACK will be sent to a different scenario -->
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/sipp/uas.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml?view=auto&rev=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml Tue Jun 19 10:47:22 2012
@@ -1,0 +1,20 @@
+testinfo:
+    summary:     'Test outbound proxy use on outbound INVITE dialog'
+    description: |
+        "Send an INVITE to an outbound proxy, who challenges for authentication.
+        The authentication challenge will have a Contact header set to a different
+        address. Asterisk should send the ACK as well as the followup INVITE to
+        the outbound proxy. The outbound proxy will then respond to the followup
+        INVITE with a 200 OK. The 200 OK will have a Contact header set to a a
+        different address from the outbound proxy. Asterisk should then send the
+        ACK to the 200 OK to this Contact."
+    issues:
+        - jira : 'ASTERISK-20008'
+
+properties:
+    minversion: '1.8'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+    tags:
+        - SIP

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

Propchange: asterisk/trunk/tests/channels/SIP/sip_outbound_proxy/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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

Modified: asterisk/trunk/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/tests.yaml?view=diff&rev=3267&r1=3266&r2=3267
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Tue Jun 19 10:47:22 2012
@@ -47,3 +47,4 @@
     - test: 'sip_cause'
     - test: 'invite_no_totag'
     - test: 'sip2cause'
+    - test: 'sip_outbound_proxy'




More information about the asterisk-commits mailing list