[asterisk-commits] jrose: testsuite/asterisk/trunk r5127 - in /asterisk/trunk: lib/python/asteri...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 13 13:55:12 CDT 2014
Author: jrose
Date: Fri Jun 13 13:54:59 2014
New Revision: 5127
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5127
Log:
Testsuite: SIP/PJSIP Notify AMI command tests
AFS-59 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/3600/
Added:
asterisk/trunk/tests/channels/SIP/ami/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml (with props)
asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml (with props)
asterisk/trunk/tests/channels/SIP/ami/tests.yaml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml (with props)
asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml (with props)
Modified:
asterisk/trunk/lib/python/asterisk/sipp.py
asterisk/trunk/tests/channels/SIP/tests.yaml
asterisk/trunk/tests/channels/pjsip/ami/tests.yaml
Modified: asterisk/trunk/lib/python/asterisk/sipp.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/sipp.py?view=diff&rev=5127&r1=5126&r2=5127
==============================================================================
--- asterisk/trunk/lib/python/asterisk/sipp.py (original)
+++ asterisk/trunk/lib/python/asterisk/sipp.py Fri Jun 13 13:54:59 2014
@@ -207,6 +207,49 @@
for observer in self._scenario_stopped_observers:
observer(result)
return result
+
+
+class SIPpAMIActionTestCase(SIPpTestCase):
+ """SIPpTestCase that also executes an AMI action"""
+ def __init__(self, test_path, test_config):
+ """Constructor
+
+ Keyword Arguments:
+ test_path path to the location of the test directory
+ test_config yaml loaded object containing config information
+ """
+
+ super(SIPpAMIActionTestCase, self).__init__(test_path,
+ test_config=test_config)
+
+ self.ami_token = self.create_fail_token("Remove token when AMI "
+ "command is successful")
+
+ self.ami_args = test_config['ami-action']['args']
+ self.ami_delay = test_config['ami-action'].get('delay', 0)
+
+ def on_reactor_timeout(self):
+ """Create a failure token when the test times out"""
+ self.create_fail_token("Reactor timed out. Test Failed.")
+
+ def remove_token_on_success(self, message, expected='Success'):
+ """Remove the failure token for AMI message if it didn't fail"""
+ if type(message) is dict and message['response'] != expected:
+ return
+ self.remove_fail_token(self.ami_token)
+
+ def ami_connect(self, ami):
+ """Handle the AMI connect event"""
+ super(SIPpAMIActionTestCase, self).ami_connect(ami)
+
+ def _ami_action():
+ """Send the AMI action"""
+ LOGGER.info("Sending Action: %s" % self.ami_args)
+ ami_out = ami.sendDeferred(self.ami_args)
+ ami_out.addCallback(ami.errorUnlessResponse)
+ ami_out.addCallback(self.remove_token_on_success)
+
+ reactor.callLater(self.ami_delay, _ami_action)
class SIPpScenarioSequence(object):
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf Fri Jun 13 13:54:59 2014
@@ -1,0 +1,11 @@
+[general]
+udpbindaddr=0.0.0.0:5060
+
+[user1]
+type=friend
+host=127.0.0.1
+port=5062
+directmedia=no
+disallow=all
+allow=ulaw
+context=default
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Notify Request">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp=": lettuce/varieties"
+ search_in="hdr"
+ header="Content-Type"
+ check_it="true"
+ assign_to="1"/>
+ <log message="Received NOTIFY [$1]." />
+ <ereg regexp="Bibb\r\nBoston\r\nIceberg\r\nRomaine"
+ search_in="body"
+ check_it="true"
+ assign_to="2"/>
+ <log message="Received NOTIFY [$2]." />
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,34 @@
+info:
+ summary: 'Test SIPNotify AMI Action for content order'
+ description: |
+ This Tests the AMI Action SIPNotify in order to make sure
+ that Content section is put into the body of the NOTIFY in
+ the same order that it was specified in the request.
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - asterisk : 'chan_sip'
+ tags:
+ - SIP
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'options.xml', '-p': '5062'} }
+ ami-action:
+ delay: 1
+ args:
+ Action: "SIPNotify"
+ Channel: "user1"
+ Variable: "Content-Type=lettuce/varieties,Content=Bibb,Content=Boston,Content=Iceberg,Content=Romaine"
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf Fri Jun 13 13:54:59 2014
@@ -1,0 +1,11 @@
+[general]
+udpbindaddr=0.0.0.0:5060
+
+[user1]
+type=friend
+host=127.0.0.1
+port=5062
+directmedia=no
+disallow=all
+allow=ulaw
+context=default
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Notify Request">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp=": val1"
+ search_in="hdr"
+ header="chead1"
+ check_it="true"
+ assign_to="1"/>
+ <log message="Received NOTIFY chead1: [$1]." />
+ <ereg regexp=": val2"
+ search_in="hdr"
+ header="chead2"
+ check_it="true"
+ assign_to="2"/>
+ <log message="Received NOTIFY chead2: [$2]." />
+ <ereg regexp=": val3"
+ search_in="hdr"
+ header="chead3"
+ check_it="true"
+ assign_to="3"/>
+ <log message="Received NOTIFY chead3: [$3]." />
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,33 @@
+tinfo:
+ summary: 'Test SIPNotify AMI Action for custom header usage'
+ description: |
+ This Tests the AMI Action SIPNotify in order to make sure
+ custom headers are accepted and applied as expected
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - asterisk : 'chan_sip'
+ tags:
+ - SIP
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'options.xml', '-p': '5062'} }
+ ami-action:
+ delay: 1
+ args:
+ Action: "SIPNotify"
+ Channel: "user1"
+ Variable: "chead1=val1,chead2=val2,chead3=val3"
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,4 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - test: 'custom_headers'
+ - test: 'content'
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/sip_notify/tests.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/ami/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/ami/tests.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/ami/tests.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/ami/tests.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - dir: 'sip_notify'
Propchange: asterisk/trunk/tests/channels/SIP/ami/tests.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/ami/tests.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/ami/tests.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=5127&r1=5126&r2=5127
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Fri Jun 13 13:54:59 2014
@@ -68,3 +68,4 @@
- test: 'direct_rtp_fallback'
- dir: 'sendrpid'
- test: 'tel_uri'
+ - dir: 'ami'
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf Fri Jun 13 13:54:59 2014
@@ -1,0 +1,27 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_q](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_q](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_q)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](endpoint_q)
+aors=user1
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Notify Request">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp=": lettuce/varieties"
+ search_in="hdr"
+ header="Content-Type"
+ check_it="true"
+ assign_to="1"/>
+ <log message="Received NOTIFY [$1]." />
+ <ereg regexp="Bibb\r\nBoston\r\nIceberg\r\nRomaine"
+ search_in="body"
+ check_it="true"
+ assign_to="2"/>
+ <log message="Received NOTIFY [$2]." />
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/sipp/options.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,34 @@
+tinfo:
+ summary: 'Test PJSIPNotify AMI Action for content order'
+ description: |
+ This Tests the AMI Action PJSIPNotify in order to make sure
+ that Content section is put into the body of the NOTIFY in
+ the same order that it was specified in the request.
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - asterisk : 'res_pjsip'
+ tags:
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'options.xml', '-p': '5062'} }
+ ami-action:
+ delay: 1
+ args:
+ Action: "PJSIPNotify"
+ Endpoint: "user1"
+ Variable: "Content-Type=lettuce/varieties,Content=Bibb,Content=Boston,Content=Iceberg,Content=Romaine"
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/content/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf Fri Jun 13 13:54:59 2014
@@ -1,0 +1,27 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_q](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_q](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_q)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](endpoint_q)
+aors=user1
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Notify Request">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp=": val1"
+ search_in="hdr"
+ header="chead1"
+ check_it="true"
+ assign_to="1"/>
+ <log message="Received NOTIFY chead1: [$1]." />
+ <ereg regexp=": val2"
+ search_in="hdr"
+ header="chead2"
+ check_it="true"
+ assign_to="2"/>
+ <log message="Received NOTIFY chead2: [$2]." />
+ <ereg regexp=": val3"
+ search_in="hdr"
+ header="chead3"
+ check_it="true"
+ assign_to="3"/>
+ <log message="Received NOTIFY chead3: [$3]." />
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,33 @@
+tinfo:
+ summary: 'Test PJSIPNotify AMI Action for custom header usage'
+ description: |
+ This Tests the AMI Action PJSIPNotify in order to make sure
+ custom headers are accepted and applied as expected
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - asterisk : 'res_pjsip'
+ tags:
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'options.xml', '-p': '5062'} }
+ ami-action:
+ delay: 1
+ args:
+ Action: "PJSIPNotify"
+ Endpoint: "user1"
+ Variable: "chead1=val1,chead2=val2,chead3=val3"
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/custom_headers/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf Fri Jun 13 13:54:59 2014
@@ -1,0 +1,27 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_q](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_q](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_q)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](endpoint_q)
+aors=user1
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Notify Request">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp=": valid"
+ search_in="hdr"
+ header="controlheader"
+ check_it="true"
+ assign_to="1"/>
+ <log message="Received NOTIFY [$1]." />
+ <ereg regexp=": failure"
+ search_in="hdr"
+ header="From"
+ check_it_inverse="true"
+ assign_to="2"/>
+ <log message="Received NOTIFY [$2]." />
+ <ereg regexp=": failure"
+ search_in="hdr"
+ header="To"
+ check_it_inverse="true"
+ assign_to="3"/>
+ <log message="Received NOTIFY [$3]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Cseq"
+ check_it_inverse="true"
+ assign_to="4"/>
+ <log message="Received NOTIFY [$4]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Contact":
+ check_it_inverse="true"
+ assign_to="5"/>
+ <log message="Received NOTIFY [$5]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Call-Id"
+ check_it_inverse="true"
+ assign_to="6"/>
+ <log message="Received NOTIFY [$6]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Record-Route"
+ check_it_inverse="true"
+ assign_to="7"/>
+ <log message="Received NOTIFY [$7]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Route"
+ check_it_inverse="true"
+ assign_to="8"/>
+ <log message="Received NOTIFY [$8]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="Request-Uri"
+ check_it_inverse="true"
+ assign_to="9"/>
+ <log message="Received NOTIFY [$9]." />
+ <ereg regexp=" failure"
+ search_in="hdr"
+ header="via"
+ check_it_inverse="true"
+ assign_to="10"/>
+ <log message="Received NOTIFY [$10]." />
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/sipp/options.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,34 @@
+tinfo:
+ summary: 'Test PJSIPNotify AMI Action for reserved header usage'
+ description: |
+ This Tests the AMI Action PJSIPNotify in order to make sure
+ reserved headers can not be overwritten using variables in
+ the request.
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - asterisk : 'res_pjsip'
+ tags:
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'options.xml', '-p': '5062'} }
+ ami-action:
+ delay: 1
+ args:
+ Action: "PJSIPNotify"
+ Endpoint: "user1"
+ Variable: "controlheader=valid,From=failure,To=failure,Cseq=failure,Contact=failure,Call-Id=failure,Record-Route=failure,Route=failure,Request-Uri=failure,via=failure"
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/reserved_headers/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml?view=auto&rev=5127
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml Fri Jun 13 13:54:59 2014
@@ -1,0 +1,5 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - test: 'custom_headers'
+ - test: 'reserved_headers'
+ - test: 'content'
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/ami/pjsip_notify/tests.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/channels/pjsip/ami/tests.yaml
[... 13 lines stripped ...]
More information about the asterisk-commits
mailing list