[svn-commits] sgriepentrog: testsuite/asterisk/trunk r4370 - in /asterisk/trunk/tests/chann...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 26 11:22:03 CST 2013


Author: sgriepentrog
Date: Tue Nov 26 11:21:57 2013
New Revision: 4370

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4370
Log:
Testsuite: check SIP outbound register for consistent local tag

Pair of tests to check outbound register (unanswered) and
reregistration messages to insure that the from tag value
is consistent per RFC3261 8.1.3.5.

(issue ASTERISK-12117)
Review: https://reviewboard.asterisk.org/r/3020/

Added:
    asterisk/trunk/tests/channels/SIP/outbound_register_from/
    asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/
    asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/
    asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/
    asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml   (with props)
    asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml   (with props)
    asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/SIP/tests.yaml

Added: asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf Tue Nov 26 11:21:57 2013
@@ -1,0 +1,2 @@
+[general]
+register => test:secret at 127.0.0.1:5062

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml Tue Nov 26 11:21:57 2013
@@ -1,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Check From ;tag consistency check with no reply to REGISTER">
+
+	<!-- Store the tag of the first register -->
+	<recv request="REGISTER">
+		<action>
+			<ereg regexp="tag=.*" search_in="hdr" header="From:" assign_to="firsttag" />
+			<log message="Received First REGISTER [$firsttag]" />
+		</action>
+	</recv>
+
+	<!-- Loop here processing register requests -->
+	<label id="loop" />
+	<recv request="REGISTER" >
+		<action>
+			<ereg regexp="tag=.*" search_in="hdr" header="From:" assign_to="fromtag" />
+			<log message="Received REGISTER [$fromtag]" />
+		</action>
+	</recv>
+
+	<!-- Did tag match first one? -->
+	<nop hide="true">
+		<action>
+			<strcmp assign_to="match" variable="fromtag" variable2="firsttag" />
+			<test assign_to="wrongtag" compare="not_equal" variable="match" value="0" />
+		</action>
+	</nop>
+
+	<!-- Fail test if not the same -->
+	<nop hide="true" condexec="wrongtag">
+		<action>
+			<log message="From tag has changed - test has failed - aborting" />
+			<exec int_cmd="stop_now" />
+		</action>
+	</nop>
+
+
+	<!-- And just keep doing that until core breach -->
+	<nop hide="true" next="loop" />
+
+
+	<!-- definition of the response time repartition table (unit is ms)   -->
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<!-- definition of the call length repartition table (unit is ms)     -->
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml Tue Nov 26 11:21:57 2013
@@ -1,0 +1,38 @@
+testinfo:
+    summary:    'Test outgoing SIP REGISTER for consistant from tag'
+    description: |
+        'This test checks outgoing SIP REGISTER messages to insure that
+        the From: ;tag=X value does not change.'
+    issues:
+        - jira: 'ASTERISK-12117'
+
+properties:
+    minversion: '1.8.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - python : 'construct'
+        - sipp :
+            version : 'v3.3'
+        - asterisk: 'chan_sip'
+    tags:
+        - SIP
+        - REGISTER
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    fail-on-any: False
+    # tag should change every 20s when not answered
+    reactor-timeout: 60
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'register.xml',
+                                    '-i': '127.0.0.1',
+                                    '-p': '5062',
+                                    '-log_file': 'logs/chan_SIP_outbound_register_from-sipp.log',
+                                    '-trace_logs': '' }}

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_register_from/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf Tue Nov 26 11:21:57 2013
@@ -1,0 +1,2 @@
+[general]
+register => test:secret at 127.0.0.1:5062

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml Tue Nov 26 11:21:57 2013
@@ -1,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Registrar with authentication and From ;tag consistency check">
+
+	<!-- Store the tag of the first register -->
+	<recv request="REGISTER">
+		<action>
+			<ereg regexp="tag=.*" search_in="hdr" header="From:" assign_to="firsttag" />
+			<log message="Received First REGISTER [$firsttag]" />
+		</action>
+	</recv>
+
+	<!-- Loop here processing register requests -->
+	<label id="badauth" />
+	<recv request="REGISTER" />
+	<send><![CDATA[
+
+      SIP/2.0 401 Authorization Required
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      WWW-Authenticate: Digest realm="test.example.com", nonce="47ebe028cda119c35d4877b383027d28da013815"
+      Content-Length: [len]
+
+	]]>
+	</send>
+
+	<!-- Process second register with authorization string, also check tag -->
+	<recv request="REGISTER" >
+		<action>
+			<ereg regexp="tag=.*" search_in="hdr" header="From:" assign_to="fromtag" />
+			<log message="Received REGISTER [$fromtag]" />
+			<verifyauth assign_to="authvalid" username="test" password="secret" />
+		</action>
+	</recv>
+
+	<!-- Did tag match first one? -->
+	<nop hide="true">
+		<action>
+			<strcmp assign_to="match" variable="fromtag" variable2="firsttag" />
+			<test assign_to="wrongtag" compare="not_equal" variable="match" value="0" />
+		</action>
+	</nop>
+
+	<!-- Fail test if not the same -->
+	<nop hide="true" condexec="wrongtag">
+		<action>
+			<log message="From tag has changed - test has failed - aborting" />
+			<exec int_cmd="stop_now" />
+		</action>
+	</nop>
+
+
+	<!-- For valid authorization, send 200 OK, otherwise loop -->
+	<nop hide="true" test="authvalid" next="goodauth" />
+	<nop hide="true" next="badauth" />
+
+	<label id="goodauth" />
+	<send><![CDATA[
+ 
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip];transport=[transport]>
+      Content-Length: 0
+      Expires: 30
+ 
+	]]>
+	</send>
+	<nop hide="true" next="badauth" />
+
+
+	<!-- definition of the response time repartition table (unit is ms)   -->
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<!-- definition of the call length repartition table (unit is ms)     -->
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/sipp/register.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml?view=auto&rev=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml Tue Nov 26 11:21:57 2013
@@ -1,0 +1,38 @@
+testinfo:
+    summary:    'Test outgoing SIP REGISTER for consistant from tag'
+    description: |
+        'This test checks outgoing SIP REGISTER messages to insure that
+        the From: ;tag=X value does not change.'
+    issues:
+        - jira: 'ASTERISK-12117'
+
+properties:
+    minversion: '1.8.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - python : 'construct'
+        - sipp :
+            version : 'v3.3'
+        - asterisk: 'chan_sip'
+    tags:
+        - SIP
+        - REGISTER
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    fail-on-any: False
+    # 3 registers at 30s each = 90 + 10s =
+    reactor-timeout: 100
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'register.xml',
+                                    '-i': '127.0.0.1',
+                                    '-p': '5062',
+                                    '-log_file': 'logs/chan_SIP_outbound_reregister_from-sipp.log',
+                                    '-trace_logs': '' }}

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/outbound_reregister_from/test-config.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=4370&r1=4369&r2=4370
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Tue Nov 26 11:21:57 2013
@@ -61,3 +61,5 @@
     - test: 'path'
     - test: 'alwaysauthreject'
     - dir: 'register_forbidden_retry'
+    - test: 'outbound_register_from'
+    - test: 'outbound_reregister_from'




More information about the svn-commits mailing list