[asterisk-commits] Testsuite: res pjsip outbound registration fatal retry inter... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 21 14:14:06 CDT 2015


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: Testsuite: res_pjsip_outbound_registration fatal_retry_interval option test
......................................................................


Testsuite: res_pjsip_outbound_registration fatal_retry_interval option test

Added a test to test the 'fatal_retry_interval' option added to pjsip
outbound registration.

ASTERISK-25485

Change-Id: I2e9982a1b442723adeee0b87117cc0898e0e0b82
---
A tests/channels/pjsip/registration/outbound/fatal_retry/configs/ast1/pjsip.conf
A tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-no-retry.xml
A tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-retry.xml
A tests/channels/pjsip/registration/outbound/fatal_retry/test-config.yaml
M tests/channels/pjsip/registration/outbound/tests.yaml
5 files changed, 184 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/tests/channels/pjsip/registration/outbound/fatal_retry/configs/ast1/pjsip.conf b/tests/channels/pjsip/registration/outbound/fatal_retry/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..e79d289
--- /dev/null
+++ b/tests/channels/pjsip/registration/outbound/fatal_retry/configs/ast1/pjsip.conf
@@ -0,0 +1,30 @@
+[local-transport-template](!)
+type=transport
+bind=127.0.0.1
+
+[local-transport-udp](local-transport-template)
+protocol=udp
+
+[alice-auth]
+type=auth
+auth_type=userpass
+username=alice
+password=blah
+realm=test.example.com
+
+[alice-template](!)
+type=registration
+transport=local-transport-udp
+outbound_auth=alice-auth
+retry_interval=10
+
+[alice-retry](alice-template)
+server_uri=sip:alice at 127.0.0.1:5065
+client_uri=sip:alice at 127.0.0.1
+fatal_retry_interval=20
+
+[alice-no-retry](alice-template)
+server_uri=sip:alice at 127.0.0.1:5066
+client_uri=sip:alice at 127.0.0.1
+
+
diff --git a/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-no-retry.xml b/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-no-retry.xml
new file mode 100644
index 0000000..ce6f8e7
--- /dev/null
+++ b/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-no-retry.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Authenticating registrar">
+  <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>
+  <recv request="REGISTER" >
+        <action>
+                <ereg regexp="Digest .*username=.alice" search_in="hdr" header="Authorization:" check_it="true" assign_to="1" />
+                <ereg regexp="Digest .*response=.f2e4537a79a463484cbdf47c9688ecaa" search_in="hdr" header="Authorization:" check_it="true" assign_to="2" />
+                <ereg regexp="Digest .*nonce=.47ebe028cda119c35d4877b383027d28da013815" search_in="hdr" header="Authorization:" check_it="true" assign_to="3" />
+        </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 400 Bad Request
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <pause milliseconds="25000" />
+
+  <Reference variables="1,2,3" />
+
+  <!-- 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>
diff --git a/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-retry.xml b/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-retry.xml
new file mode 100644
index 0000000..291d80e
--- /dev/null
+++ b/tests/channels/pjsip/registration/outbound/fatal_retry/sipp/register-retry.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Authenticating registrar">
+  <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>
+  <recv request="REGISTER" >
+        <action>
+                <ereg regexp="Digest .*username=.alice" search_in="hdr" header="Authorization:" check_it="true" assign_to="1" />
+                <ereg regexp="Digest .*response=.7a436814111968c5fcf13d393deca1fc" search_in="hdr" header="Authorization:" check_it="true" assign_to="2" />
+                <ereg regexp="Digest .*nonce=.47ebe028cda119c35d4877b383027d28da013815" search_in="hdr" header="Authorization:" check_it="true" assign_to="3" />
+        </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 400 Bad Request
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <pause milliseconds="16000" />
+
+  <recv request="REGISTER">
+        <action>
+                <ereg regexp="Authorization:" search_in="msg" check_it_inverse="true" assign_to="4" />
+        </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:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <Reference variables="1,2,3,4" />
+
+  <!-- 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>
diff --git a/tests/channels/pjsip/registration/outbound/fatal_retry/test-config.yaml b/tests/channels/pjsip/registration/outbound/fatal_retry/test-config.yaml
new file mode 100644
index 0000000..8753e42
--- /dev/null
+++ b/tests/channels/pjsip/registration/outbound/fatal_retry/test-config.yaml
@@ -0,0 +1,28 @@
+testinfo:
+    summary:     'Test outbound registration with auth and fatal response retry'
+    description: |
+        "This tests whether Asterisk will treat a fatal response as a non-fatal
+         response when the fatal_retry_interval is set and continue retrying."
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    reactor-timeout: 50
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': { 'scenario': 'register-retry.xml', '-p': '5065' } }
+                - { 'key-args': { 'scenario': 'register-no-retry.xml', '-p': '5066' } }
+
+properties:
+    minversion: '13.7.0'
+    dependencies:
+        - python: 'starpy'
+        - sipp :
+            version : 'v3.1'
+        - asterisk: 'res_pjsip'
+    tags:
+        - pjsip
diff --git a/tests/channels/pjsip/registration/outbound/tests.yaml b/tests/channels/pjsip/registration/outbound/tests.yaml
index 8ff4a2c..8138ea2 100644
--- a/tests/channels/pjsip/registration/outbound/tests.yaml
+++ b/tests/channels/pjsip/registration/outbound/tests.yaml
@@ -1,6 +1,7 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - test: 'forbidden_retry'
+    - test: 'fatal_retry'
     - dir: 'unregister'
     - test: 'auth_loop'
     - test: 'line_parameter'

-- 
To view, visit https://gerrit.asterisk.org/1475
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e9982a1b442723adeee0b87117cc0898e0e0b82
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list