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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 24 11:53:49 CDT 2014


Author: jbigelow
Date: Fri Oct 24 11:53:42 2014
New Revision: 5773

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5773
Log:
Add test to unregister registered outbound registrations.

This tests unregistering registered outbound registrations using the
PJSIPUnregister AMI action. It ensures that Asterisk sends a REGISTER message
with an Expires header of '0' upon executing the AMI action. It also ensures
that AMI 'Registry' events are present with a status of 'Unregistered'. All
combintations of IPv4/IPv6 and UDP/TCP are utilized.

Notes:
* The 'expected-result' YAML property is set to False as the test is
currently expected to fail due to bug ASTERISK-24411. The property should be
removed when the bug is resolved.
* The SIPp scenario contains a pause at the end to work around bug
ASTERISK-24414. It should be removed when the bug is resolved.

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


Added:
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/registration/outbound/tests.yaml

Modified: asterisk/trunk/tests/channels/pjsip/registration/outbound/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/outbound/tests.yaml?view=diff&rev=5773&r1=5772&r2=5773
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/outbound/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/registration/outbound/tests.yaml Fri Oct 24 11:53:42 2014
@@ -1,3 +1,4 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - test: 'forbidden_retry'
+    - dir: 'unregister'

Added: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml?view=auto&rev=5773
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml Fri Oct 24 11:53:42 2014
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'unauthed'

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf?view=auto&rev=5773
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf Fri Oct 24 11:53:42 2014
@@ -1,0 +1,60 @@
+[local-transport-template](!)
+type=transport
+bind=127.0.0.1:5060
+
+[local-transport6-template](!)
+type=transport
+bind=[::1]:5060
+
+[local-transport-udp](local-transport-template)
+protocol=udp
+
+[local-transport-udp6](local-transport6-template)
+protocol=udp
+
+[local-transport-tcp](local-transport-template)
+protocol=tcp
+
+[local-transport-tcp6](local-transport6-template)
+protocol=tcp
+
+[registrar-ipv4-udp]
+type=registration
+max_retries=0
+retry_interval=60
+forbidden_retry_interval=0
+client_uri=sip:ua-ipv4-udp at 127.0.0.1:5060\;transport=udp
+server_uri=sip:ua-ipv4-udp at 127.0.0.1:5061\;transport=udp
+expiration=300
+auth_rejection_permanent=yes
+
+[registrar-ipv4-tcp]
+type=registration
+max_retries=0
+retry_interval=60
+forbidden_retry_interval=0
+client_uri=sip:ua-ipv4-tcp at 127.0.0.1:5060\;transport=tcp
+server_uri=sip:ua-ipv4-tcp at 127.0.0.1:5061\;transport=tcp
+expiration=300
+auth_rejection_permanent=yes
+
+[registrar-ipv6-udp]
+type=registration
+max_retries=0
+retry_interval=60
+forbidden_retry_interval=0
+client_uri=sip:ua-ipv6-udp@[::1]:5060\;transport=udp
+server_uri=sip:ua-ipv6-udp@[::1]:5061\;transport=udp
+expiration=300
+auth_rejection_permanent=yes
+
+[registrar-ipv6-tcp]
+type=registration
+max_retries=0
+retry_interval=60
+forbidden_retry_interval=0
+client_uri=sip:ua-ipv6-tcp@[::1]:5060\;transport=tcp
+server_uri=sip:ua-ipv6-tcp@[::1]:5061\;transport=tcp
+expiration=300
+auth_rejection_permanent=yes
+

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml?view=auto&rev=5773
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml Fri Oct 24 11:53:42 2014
@@ -1,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UA unregisters from registrar">
+
+  <!-- UA registers -->
+  <recv request="REGISTER" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      [last_Expires:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <!-- UA unregisters -->
+  <!-- Ensure the Expires header is 0. -->
+  <recv request="REGISTER" >
+        <action>
+                <ereg regexp="0" search_in="hdr" header="Expires:" check_it="true" assign_to="1" />
+        </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      [last_Expires:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <!--
+  Work around for fequent failures caused by ASTERISK-24414. Remove this
+  pause when it has been resolved.
+  -->
+  <pause milliseconds="1000" />
+
+  <Reference variables="1" />
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/sipp/unregister.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml?view=auto&rev=5773
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml Fri Oct 24 11:53:42 2014
@@ -1,0 +1,115 @@
+testinfo:
+    summary: 'Unregister an outbound registration that is registered'
+    description: |
+        'Using all combinations of IPv4/IPv6 and UDP/TCP, make outbound
+         registrations to SIPp instances. The PJSIPUnregister AMI action is
+         used to unregister the outbound registrations. This ensures that
+         Asterisk sends a REGISTER message with an Expires header of '0' upon
+         executing the PJSIPUnregister AMI action and that AMI Registry events
+         are present with a status of "Unregistered".'
+    issues:
+        - jira: 'ASTERISK-24411'
+        - jira: 'ASTERISK-24414'
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_outbound_registration'
+        - sipp:
+            version: 'v3.0'
+        - custom: 'ipv6'
+    tags:
+        - pjsip
+        - AMI
+    # Expect it to fail until ASTERISK-24411 is resolved. Note: A pause has
+    # been added to the end of the SIPp scenario to work around frequent
+    # failures caused by ASTERISK-24414. The pause should be removed once
+    # ASTERISK-24414 is resolved.
+    expected-result: False
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: pluggable-config
+            minversion: '12.0.0'
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    fail-on-any: False
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'unregister.xml', '-i': '127.0.0.1',
+                                    '-p': '5061'} }
+                - { 'key-args': {'scenario': 'unregister.xml', '-i': '127.0.0.1',
+                                    '-p': '5061', '-t': 't1'} }
+                - { 'target': '[::1]', 'key-args': {'scenario': 'unregister.xml',
+                                    '-i': '[::1]', '-p': '5061'} }
+                - { 'target': '[::1]', 'key-args': {'scenario': 'unregister.xml',
+                                    '-i': '[::1]', '-p': '5061', '-t': 't1'} }
+
+pluggable-config:
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Registry'
+                    Username: 'sip:ua-ipv4-udp at 127.0.0.1:5060;transport=udp'
+                    Status: 'Registered'
+            count: '1'
+        ami-actions:
+            action:
+                action: 'PJSIPUnregister'
+                registration: 'registrar-ipv4-udp'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Registry'
+                    Username: 'sip:ua-ipv4-tcp at 127.0.0.1:5060;transport=tcp'
+                    Status: 'Registered'
+            count: '1'
+        ami-actions:
+            action:
+                action: 'PJSIPUnregister'
+                registration: 'registrar-ipv4-tcp'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Registry'
+                    Username: 'sip:ua-ipv6-udp@\[::1\]:5060;transport=udp'
+                    Status: 'Registered'
+            count: '1'
+        ami-actions:
+            action:
+                action: 'PJSIPUnregister'
+                registration: 'registrar-ipv6-udp'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Registry'
+                    Username: 'sip:ua-ipv6-tcp@\[::1\]:5060;transport=tcp'
+                    Status: 'Registered'
+            count: '1'
+        ami-actions:
+            action:
+                action: 'PJSIPUnregister'
+                registration: 'registrar-ipv6-tcp'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Registry'
+                    Username: 'sip:ua-ipv(4|6)-(udp|tcp)@(127.0.0.1|\[::1\]):5060;transport=(udp|tcp)'
+                    Status: 'Unregistered'
+            count: '4'
+

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/outbound/unregister/unauthed/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list