[svn-commits] jbigelow: testsuite/asterisk/trunk r4886 - in /asterisk/trunk/tests/channels/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 24 09:14:46 CDT 2014


Author: jbigelow
Date: Mon Mar 24 09:14:36 2014
New Revision: 4886

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4886
Log:
Add test for MWI to subscribe, un-subscribe, and re-subscribe using PJSIP.

This ensures that a mailbox on an AOR for an endpoint can be subscribed to,
re-subscribed to, and un-subscribed from using PJSIP.

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

(closes issue ASTERISK-23343)


Added:
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/modules.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/modules.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/modules.conf?view=auto&rev=4886
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/modules.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/modules.conf Mon Mar 24 09:14:36 2014
@@ -1,0 +1,8 @@
+[modules]
+autoload=yes
+
+noload => chan_alsa.so
+noload => chan_oss.so
+noload => chan_console.so
+noload => chan_sip.so
+

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/pjsip.conf?view=auto&rev=4886
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/configs/ast1/pjsip.conf Mon Mar 24 09:14:36 2014
@@ -1,0 +1,21 @@
+[global]
+type=global
+debug=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+transport=local-transport
+allow=g722,ulaw,alaw
+context=default
+aors=alice
+
+[alice]
+type=aor
+contact=sip:alice at 127.0.0.1:5061
+max_contacts=1
+mailboxes=alice

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml?view=auto&rev=4886
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml Mon Mar 24 09:14:36 2014
@@ -1,0 +1,165 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+  <!-- Subscribe -->
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:[service]@[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: "alice" <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Event: message-summary
+      Expires: 300
+      Accept: application/simple-message-summary
+      Allow-Events: message-summary
+      User-Agent: SIPp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" rtd="true">
+    <action>
+          <ereg regexp="(;tag=.*)" header="To:" search_in="hdr" check_it="true" assign_to="to_tag"/>
+    </action>
+  </recv>
+
+  <recv request="NOTIFY" crlf="true">
+    <action>
+      <ereg regexp="message-summary" check_it="true" search_in="hdr" header="Event" assign_to="subevent" />
+      <ereg regexp="active;expires=[2,3][0,9][0,5-9]" check_it="true" search_in="hdr" header="Subscription-State" assign_to="substate" />
+    </action>
+  </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>
+
+  <!-- Resubscribe -->
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:[service]@[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: "alice" <sip:[service]@[remote_ip]:[remote_port]>[$to_tag]
+      Call-ID: [call_id]
+      CSeq: 2 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Event: message-summary
+      Expires: 600
+      Accept: application/simple-message-summary
+      Allow-Events: message-summary
+      User-Agent: SIPp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" crlf="true">
+    <action>
+      <ereg regexp="message-summary" check_it="true" search_in="hdr" header="Event" assign_to="resubevent" />
+      <ereg regexp="active;expires=[5,6][0,9][0,5-9]" check_it="true" search_in="hdr" header="Subscription-State" assign_to="resubstate" />
+    </action>
+  </recv>
+
+  <recv response="200" rtd="true" />
+
+  <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>
+
+  <recv request="NOTIFY" crlf="true" />
+
+  <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>
+
+  <pause milliseconds="1000"/>
+
+  <!-- Unsubscribe -->
+  <send retrans="500">
+    <![CDATA[
+      SUBSCRIBE sip:[service]@[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: "alice" <sip:[service]@[remote_ip]:[remote_port]>[$to_tag]
+      Call-ID: [call_id]
+      CSeq: 3 SUBSCRIBE
+      Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Event: message-summary
+      Expires: 0
+      Accept: application/simple-message-summary
+      Allow-Events: message-summary
+      User-Agent: SIPp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" crlf="true">
+    <action>
+      <ereg regexp="message-summary" check_it="true" search_in="hdr" header="Event" assign_to="unsubevent" />
+      <ereg regexp="terminated" check_it="true" search_in="hdr" header="Subscription-State" assign_to="unsubstate" />
+    </action>
+  </recv>
+
+  <recv response="200" rtd="true" />
+
+  <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>
+
+  <Reference variables="subevent,substate,resubevent,resubstate,unsubevent,unsubstate" />
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/sipp/mwi_subscription.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/test-config.yaml?view=auto&rev=4886
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/test-config.yaml Mon Mar 24 09:14:36 2014
@@ -1,0 +1,31 @@
+testinfo:
+    summary:     'Test MWI subscribe, un-unsubscribe, and re-subscribe for PJSIP.'
+    description: |
+        'For MWI this subscribes, re-subscribes, and then un-subscribes. It
+        checks the Event and Subscription-State headers to ensure they are what
+        is expected.'
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'res_pjsip'
+        - sipp:
+            version: 'v3.0'
+    tags:
+        - pjsip
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: test-case-config
+        typename: 'sipp.SIPpTestCase'
+
+test-case-config:
+    fail-on-any: False
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'mwi_subscription.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'alice'} }
+

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

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

Propchange: asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/sub_setup_teardown/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=4886&r1=4885&r2=4886
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/subscriptions/mwi/tests.yaml Mon Mar 24 09:14:36 2014
@@ -3,3 +3,4 @@
     - test: 'missing_aor'
     - test: 'unsolicited'
     - test: 'mwi_aggregate'
+    - test: 'sub_setup_teardown'




More information about the svn-commits mailing list