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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 25 12:42:42 CDT 2014


Author: mmichelson
Date: Tue Mar 25 12:42:38 2014
New Revision: 4891

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4891
Log:
Test for the message_context PJSIP endpoint option.


Added:
    asterisk/trunk/tests/channels/pjsip/message/message_context/
    asterisk/trunk/tests/channels/pjsip/message/message_context/configs/
    asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/
    asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/message/message_context/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/message/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/extensions.conf?view=auto&rev=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/extensions.conf Tue Mar 25 12:42:38 2014
@@ -1,0 +1,7 @@
+[message_context]
+exten => eggs,1,NoOp()
+      same => n,UserEvent(Message,MessageFrom: ${MESSAGE(from)},Context: ${CONTEXT})
+
+[context]
+exten => eggs,1,NoOp()
+      same => n,UserEvent(Message,MessageFrom: ${MESSAGE(from)},Context: ${CONTEXT})

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf?view=auto&rev=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf Tue Mar 25 12:42:38 2014
@@ -1,0 +1,5 @@
+[modules]
+
+noload => chan_sip.so
+
+autoload => yes

Propchange: asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/modules.conf
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/pjsip.conf?view=auto&rev=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/message/message_context/configs/ast1/pjsip.conf Tue Mar 25 12:42:38 2014
@@ -1,0 +1,17 @@
+[global]
+type=global
+debug=yes
+
+[main-transport]
+type=transport
+protocol=udp
+bind=127.0.0.1
+
+[alice]
+type=endpoint
+message_context=message_context
+context=context
+
+[bob]
+type=endpoint
+context=context

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml?view=auto&rev=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml Tue Mar 25 12:42:38 2014
@@ -1,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic MESSAGE send and receive">
+  <send retrans="500">
+    <![CDATA[
+
+      MESSAGE sip:eggs@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: [from_user] <sip:[from_user]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:eggs@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 MESSAGE
+      Max-Forwards: 70
+      Expires: 3600
+      Content-Type: text/plain
+      Content-Length: 18
+
+      Watson, come here.
+
+    ]]>
+  </send>
+
+  <recv response="202" rtd="true" />
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/message/message_context/sipp/message.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/message/message_context/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/message_context/test-config.yaml?view=auto&rev=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/message_context/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/message/message_context/test-config.yaml Tue Mar 25 12:42:38 2014
@@ -1,0 +1,58 @@
+testinfo:
+    summary: 'Test that proper context is used for inbound MESSAGE requests'
+    description: |
+        'Two PJSIP endpoints, alice and bob, are created. Alice specifies a message_context
+        but bob does not. MESSAGEs from alice should go to her configured message_context, while
+        MESSAGEs from bob should go to his configured context.'
+
+properties:
+    minversion: '12.2.0'
+    dependencies:
+        - app: 'sipp'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_messaging'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+test-object-config:
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': { 'scenario': 'message.xml', '-p': '5061', '-i': '127.0.0.1' }, 'ordered-args': ['-key', 'from_user', 'alice'] }
+                - { 'key-args': { 'scenario': 'message.xml', '-p': '5062', '-i': '127.0.0.1' }, 'ordered-args': ['-key', 'from_user', 'bob'] }
+
+
+ami-config:
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'Message'
+                MessageFrom: 'alice <sip:alice at 127.0.0.1>'
+        requirements:
+            match:
+                Context: 'message_context'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'Message'
+                MessageFrom: 'bob <sip:bob at 127.0.0.1>'
+        requirements:
+            match:
+                Context: 'context'
+        count: '1'

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

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

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

Modified: asterisk/trunk/tests/channels/pjsip/message/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/message/tests.yaml?view=diff&rev=4891&r1=4890&r2=4891
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/message/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/message/tests.yaml Tue Mar 25 12:42:38 2014
@@ -1,6 +1,7 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - test: 'message_basic'
+    - test: 'message_context'
     - test: 'message_to_uri'
     - test: 'message_from'
     - test: 'message_cust_hdr'




More information about the asterisk-commits mailing list