[asterisk-commits] kmoore: testsuite/asterisk/trunk r3557 - in /asterisk/trunk/tests/channels/SI...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 10 09:01:50 CST 2012


Author: kmoore
Date: Mon Dec 10 09:01:48 2012
New Revision: 3557

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3557
Log:
Add test and remove unnecessary dependencies

This commit adds a test to cover the bug described in ASTERISK-20653
where Asterisk could be made to accept a call with a Session-Expires
value less than the configured Min-SE. This also removes the 'ipv6'
dependency for the four basic_* session timer tests since none of them
use IPv6.

(issue ASTERISK-20653)

Added:
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_refresh/test-config.yaml
    asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_teardown/test-config.yaml
    asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_refresh/test-config.yaml
    asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_teardown/test-config.yaml
    asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml

Modified: asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_refresh/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_refresh/test-config.yaml?view=diff&rev=3557&r1=3556&r2=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_refresh/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_refresh/test-config.yaml Mon Dec 10 09:01:48 2012
@@ -8,7 +8,6 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'ipv6'
         - app : 'sipp'
     tags:
         - SIP

Modified: asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_teardown/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_teardown/test-config.yaml?view=diff&rev=3557&r1=3556&r2=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_teardown/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/basic_uac_teardown/test-config.yaml Mon Dec 10 09:01:48 2012
@@ -8,7 +8,6 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'ipv6'
         - app : 'sipp'
     tags:
         - SIP

Modified: asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_refresh/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_refresh/test-config.yaml?view=diff&rev=3557&r1=3556&r2=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_refresh/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_refresh/test-config.yaml Mon Dec 10 09:01:48 2012
@@ -8,7 +8,6 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'ipv6'
         - app : 'sipp'
     tags:
         - SIP

Modified: asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_teardown/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_teardown/test-config.yaml?view=diff&rev=3557&r1=3556&r2=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_teardown/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/basic_uas_teardown/test-config.yaml Mon Dec 10 09:01:48 2012
@@ -8,7 +8,6 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'ipv6'
         - app : 'sipp'
     tags:
         - SIP

Modified: asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml?view=diff&rev=3557&r1=3556&r2=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml Mon Dec 10 09:01:48 2012
@@ -5,3 +5,4 @@
     - test: 'basic_uas_refresh'
     - test: 'basic_uas_teardown'
     - test: 'uas_minimum_se'
+    - test: 'uac_se_below_minse'

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/extensions.conf?view=auto&rev=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/extensions.conf Mon Dec 10 09:01:48 2012
@@ -1,0 +1,2 @@
+[default]
+exten => s,1,Dial(sip/endpoint)

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

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

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

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/sip.conf?view=auto&rev=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/configs/ast1/sip.conf Mon Dec 10 09:01:48 2012
@@ -1,0 +1,14 @@
+[general]
+canreinvite=no
+
+[endpoint]
+context=default
+type=friend
+host=127.0.0.1
+port=5066
+insecure=invite
+disallow=all
+allow=ulaw
+session-timers=accept
+session-refresher=uas
+session-minse=100

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

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

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

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py?view=auto&rev=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py Mon Dec 10 09:01:48 2012
@@ -1,0 +1,48 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2012, 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 logging
+
+sys.path.append("lib/python")
+
+LOGGER = logging.getLogger(__name__)
+
+class Originator(object):
+    def __init__(self, module_config, test_object):
+        self.ami = None
+        test_object.register_ami_observer(self.ami_connect)
+        test_object.register_scenario_started_observer(self.scenario_started)
+        self.test_object = test_object
+        self.current_destination = 0
+        return
+
+    def ami_connect(self, ami):
+        LOGGER.info("AMI connected")
+        self.ami = ami
+        return
+
+    def success(self, result):
+        LOGGER.info("Originate Successful")
+        return result
+
+    def originate_call(self):
+
+        LOGGER.info("Originating call")
+
+        self.ami.originate(channel = 'Local/s at default',
+                application = 'Echo').addCallback(self.success)
+
+    def scenario_started(self, result):
+        def failure(result):
+            self.test_object.set_passed(False)
+            return result
+
+        self.originate_call()
+        return result

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/originator.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml?view=auto&rev=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml Mon Dec 10 09:01:48 2012
@@ -1,0 +1,113 @@
+<?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 timer testing">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <!-- Save the from tag. We'll need it when we send our BYE -->
+      <action>
+          <ereg regexp=".*timer.*"
+              header="Supported:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="1"/>
+          <ereg regexp=".*(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote_tag"/>
+      </action>
+  </recv>
+  <Reference variables="1" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [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-Length: 0
+
+    ]]>
+  </send>
+
+  <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:]
+      Require: timer
+      Session-Expires: 95;refresher=uac
+      Contact: <sip:[local_ip]:[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>
+
+  <recv request="BYE"
+        rtd="true"
+        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]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <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/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/sipp/uas-no-hangup.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/test-config.yaml?view=auto&rev=3557
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_se_below_minse/test-config.yaml Mon Dec 10 09:01:48 2012
@@ -1,0 +1,31 @@
+testinfo:
+    summary:     'Min-SE enforcement (outbound UAC refresh)'
+    description: |
+        "This test verifies that outbound calls with a Session-Expires value less than the local Min-SE is torn down immediately."
+
+properties:
+    minversion: '1.8.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+    tags:
+        - SIP
+        - timers
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            typename: 'originator.Originator'
+
+sipp-config:
+    reactor-timeout: 20
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uas-no-hangup.xml', '-p': '5066'} }

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

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

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




More information about the asterisk-commits mailing list