[asterisk-commits] jrose: testsuite/asterisk/trunk r4952 - in /asterisk/trunk/tests/channels/pjs...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 11 17:12:20 CDT 2014


Author: jrose
Date: Fri Apr 11 17:12:09 2014
New Revision: 4952

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4952
Log:
Testsuite: PJSIP - off-nominal subscription tests

Includes: No accept header, disallowed subscriptions, MinExpiry not met, lack
of an event header, and unknown event package types.

(closes issue ASTERISK-23342)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3357/

Added:
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unallowed/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/unknown_event_package/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml
    asterisk/trunk/tests/channels/pjsip/subscriptions/presence/tests.yaml
    asterisk/trunk/tests/channels/pjsip/subscriptions/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/extensions.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/extensions.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,6 @@
+[general]
+
+[default]
+
+exten => alice,hint,PJSIP/alice,CustomPresence:alice
+exten => alice,1,Noop

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/pjsip.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/configs/ast1/pjsip.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,29 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice
+sub_min_expiry=3600

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:alice@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Expires: 2000
+      Max-Forwards: 70
+      Event: presence
+      Accept: application/pidf+xml
+      User-Agent: Digium D40
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <recv response="423" rtd="true" />
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/test-config.yaml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/below_min_expiry/test-config.yaml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,28 @@
+testinfo:
+    summary: 'Test subscription to an endpoint with less than min expiry'
+    description: |
+        'If a SIP subscription request is made for an endpoint that has a
+         minimum expiration time setting greater than the minimum expiration
+         set in the request, reject that request with a resposne of 423'
+
+properties:
+    minversion: '12.1.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    reactor-timeout: 30
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'subscribe.xml', '-p': '5061'} }

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,11 @@
+[modules]
+autoload=yes
+
+noload => pbx_gtkconsole.so
+noload => chan_alsa.so
+noload => chan_oss.so
+noload => chan_console.so
+
+noload => chan_sip.so
+noload => app_voicemail.so
+

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/modules.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/pjsip.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/configs/ast1/pjsip.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,29 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+mailboxes=alice
+
+[alice](endpoint_t)
+aors=alice

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test Fri Apr 11 17:12:09 2014
@@ -1,0 +1,71 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2014, Digium, Inc.
+Jonathan Rose <jrose at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+
+sys.path.append("lib/python/asterisk")
+
+from twisted.internet import reactor
+from sipp import SIPpScenario
+from test_case import TestCase
+
+
+class DigiumPresence(TestCase):
+    """Test case for presence on a digium phone"""
+
+    def __init__(self):
+        """Create a new instance of the DigiumPresence test case."""
+
+        super(DigiumPresence, self).__init__()
+        self.create_asterisk()
+
+    def run(self):
+        """Test execution method.  Connect to AMI."""
+        super(DigiumPresence, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        """Add a message to a mailbox via external MWI.
+        Once added subscribe to the mailbox.
+        """
+
+        def _mwi_update():
+            """Create an external MWI update action."""
+            return {
+                'Action': 'MWIUpdate',
+                'Mailbox': 'alice',
+                'NewMessages': 1,
+                'OldMessages': 0}
+
+        def _on_scenario_complete(obj):
+            """Handler for when the sipp scenario runs successfully."""
+            # the scenario checks for the appropriate body text
+            # so if we get here the test passed
+            self.set_passed(True)
+            self.stop_reactor()
+            return obj
+
+        def _handle_mwi(ami, event):
+            """MWI has changed so subscribe."""
+            sipp = SIPpScenario(self.test_name,
+                                {'scenario': 'subscribe.xml', '-p': '5061'})
+            sipp.run(self).addCallback(_on_scenario_complete)
+
+        ami.registerEvent('MessageWaiting', _handle_mwi)
+        ami.sendDeferred(_mwi_update())
+
+
+def main():
+    """Main entry point for test."""
+    test = DigiumPresence()
+    reactor.run()
+    return not test.passed
+
+if __name__ == "__main__":
+    sys.exit(main())

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:alice@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Expires: 3600
+      Max-Forwards: 70
+      Event: message-summary
+      User-Agent: Digium D40
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" rtd="true" />
+
+  <recv request="NOTIFY" crlf="true">
+    <action>
+      <ereg regexp=".*\sVoice-Message: 1/0" check_it="true" search_in="body" assign_to="body" />
+    </action>
+  </recv>
+
+  <Reference variables="body" />
+
+  <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/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/test-config.yaml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/no_accept_header/test-config.yaml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,19 @@
+testinfo:
+    summary: 'Test subscription for MWI without an accept header'
+    description: |
+        'If a subscription for MWI is made without an accept header, then
+         the subscription should complete successfully using the default
+         format when sending subscribed messages to the subscriber.'
+
+properties:
+    minversion: '12.1.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'res_pjsip_mwi'
+        - asterisk : 'res_mwi_external'
+        - asterisk : 'res_mwi_external_ami'
+    tags:
+        - pjsip
+        - mwi_external

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

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

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

Modified: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml?view=diff&rev=4952&r1=4951&r2=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml Fri Apr 11 17:12:09 2014
@@ -3,4 +3,5 @@
     - test: 'missing_aor'
     - test: 'unsolicited'
     - test: 'mwi_aggregate'
+    - test: 'no_accept_header'
     - test: 'sub_setup_teardown'

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/extensions.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/extensions.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,6 @@
+[general]
+
+[default]
+
+exten => alice,hint,PJSIP/alice,CustomPresence:alice
+exten => alice,1,Noop

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/pjsip.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/configs/ast1/pjsip.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,28 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:alice@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Expires: 3600
+      Max-Forwards: 70
+      Accept: application/pidf+xml
+      User-Agent: Digium D40
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="489" rtd="true" />
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/test-config.yaml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/no_event_header/test-config.yaml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,27 @@
+testinfo:
+    summary: 'Test subscription without event header.'
+    description: |
+        'If a SIP subscription request is made without an event header
+         then the request should be rejected with a 489 response'
+
+properties:
+    minversion: '12.1.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    reactor-timeout: 30
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'subscribe.xml', '-p': '5061'} }

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/extensions.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/extensions.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,6 @@
+[general]
+
+[default]
+
+exten => alice,hint,PJSIP/alice,CustomPresence:alice
+exten => alice,1,Noop

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/pjsip.conf?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/configs/ast1/pjsip.conf Fri Apr 11 17:12:09 2014
@@ -1,0 +1,28 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test Fri Apr 11 17:12:09 2014
@@ -1,0 +1,65 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2014, Digium, Inc.
+Jonathan Rose <jrose at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+
+sys.path.append("lib/python/asterisk")
+
+from twisted.internet import reactor
+from sipp import SIPpScenario
+from test_case import TestCase
+
+
+class DigiumPresence(TestCase):
+    """Test case for presence on a digium phone"""
+
+    def __init__(self):
+        """Create a new instance of the DigiumPresence test case."""
+
+        super(DigiumPresence, self).__init__()
+        self.create_asterisk()
+
+    def run(self):
+        """Test execution method.  Connect to AMI."""
+        super(DigiumPresence, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        """Wait for the presence state to change then issue a subscribe."""
+
+        def _on_scenario_complete(obj):
+            """Handler for when the sipp scenario runs successfully."""
+            # the scenario checks for the appropriate body text
+            # so if we get here the test passed
+            self.set_passed(True)
+            self.stop_reactor()
+            return obj
+
+        def _subscribe(ami, event):
+            """Presence has changed so subscribe and check for changes
+            in the notify.
+            """
+            sipp = SIPpScenario(self.test_name,
+                                {'scenario': 'subscribe.xml', '-p': '5061'})
+            sipp.run(self).addCallback(_on_scenario_complete)
+
+        ami.registerEvent('PresenceStatus', _subscribe)
+        # make sure alice is available
+        self.ast[0].cli_exec('presencestate change CustomPresence:alice'
+                             ' "away,lunch,banana"')
+
+
+def main():
+    """Main entry point for test."""
+    test = DigiumPresence()
+    reactor.run()
+    return not test.passed
+
+if __name__ == "__main__":
+    sys.exit(main())

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml?view=auto&rev=4952
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml Fri Apr 11 17:12:09 2014
@@ -1,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:alice@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Expires: 3600
+      Max-Forwards: 70
+      Event: presence
+      User-Agent: Digium D40
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" rtd="true" />
+
+  <recv request="NOTIFY" crlf="true">
+    <action>
+      <ereg regexp=".*\s*digium_presence type=\"away\" subtype=\"lunch\">banana" check_it="true" search_in="body" assign_to="body" />
+    </action>
+  </recv>
+
+  <Reference variables="body" />
+
+  <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/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/presence/no_accept_header/sipp/subscribe.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


[... 394 lines stripped ...]



More information about the asterisk-commits mailing list