[asterisk-commits] pjsip/register/interval too brief: Re-work sipp scenarios (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 30 17:07:25 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4844 )

Change subject: pjsip/register/interval_too_brief:  Re-work sipp scenarios
......................................................................


pjsip/register/interval_too_brief:  Re-work sipp scenarios

This test has a high failure rate mostly due to the fact that
it didn't respond to the unregisters asterisk sends when the
registrations time out.  Also, nothing was ever checking that
asterisk actually sent the correct Expires value after receiving
the 423 response from sipp.

* Added check of REGISTERs after the 423 to make sure the new value
  equals the value sipp sent in the 423.  Technically it could be
  greater than the value sent in the 423 but sipp has a problem
  with math and asterisk currently does send back the exact value.

* Added a recv and send to address the final re/un register.  This
  also drops the time to execute from about 50 seconds down to
  <= 20 seconds.

Change-Id: Idff6147b0a5f357d9d1226c6afd8978525af99c1
---
M tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario1.xml
M tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario2.xml
2 files changed, 72 insertions(+), 8 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/interval_too_brief/sipp/uas-reg-423-scenario1.xml b/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario1.xml
index 1d22fff..c2fd7dc 100644
--- a/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario1.xml
+++ b/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario1.xml
@@ -19,7 +19,14 @@
         ]]>
     </send>
 
-    <recv request="REGISTER" crlf="true">
+    <recv request="REGISTER">
+        <action>
+            <ereg regexp="20"
+                search_in="hdr"
+                check_it="true"
+                header="Expires: "
+                assign_to="1" />
+        </action>
     </recv>
 
     <send>
@@ -36,7 +43,14 @@
         ]]>
     </send>
 
-    <recv request="REGISTER" crlf="true">
+    <recv request="REGISTER">
+        <action>
+            <ereg regexp="20"
+                search_in="hdr"
+                check_it="true"
+                header="Expires: "
+                assign_to="1" />
+        </action>
     </recv>
 
     <send>
@@ -53,6 +67,24 @@
         ]]>
     </send>
 
-    <!-- Keep the scenario going for a while to ensure that no further messages are sent -->
-    <timewait milliseconds="5000" />
+    <!--  This could be a re- or un- register -->
+    <recv request="REGISTER" crlf="true">
+    </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]>
+            Expires: 0
+            Content-Length: 0
+        ]]>
+    </send>
+
+	<Reference variables="1"/>
+
 </scenario>
diff --git a/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario2.xml b/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario2.xml
index a19ddfe..945a2b3 100644
--- a/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario2.xml
+++ b/tests/channels/pjsip/registration/outbound/interval_too_brief/sipp/uas-reg-423-scenario2.xml
@@ -36,7 +36,14 @@
         ]]>
     </send>
 
-    <recv request="REGISTER" crlf="true">
+    <recv request="REGISTER">
+        <action>
+            <ereg regexp="20"
+                search_in="hdr"
+                check_it="true"
+                header="Expires: "
+                assign_to="1" />
+        </action>
     </recv>
 
     <send>
@@ -53,7 +60,14 @@
         ]]>
     </send>
 
-    <recv request="REGISTER" crlf="true">
+    <recv request="REGISTER">
+        <action>
+            <ereg regexp="20"
+                search_in="hdr"
+                check_it="true"
+                header="Expires: "
+                assign_to="1" />
+        </action>
     </recv>
 
     <send>
@@ -70,6 +84,24 @@
         ]]>
     </send>
 
-    <!-- Keep the scenario going for a while to ensure that no further messages are sent -->
-    <timewait milliseconds="5000" />
+    <!--  This could be a re- or un- register -->
+    <recv request="REGISTER" crlf="true">
+    </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]>
+            Expires: 0
+            Content-Length: 0
+        ]]>
+    </send>
+
+	<Reference variables="1"/>
+
 </scenario>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idff6147b0a5f357d9d1226c6afd8978525af99c1
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph 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