[Asterisk-code-review] dialog info xml: Fix SIPp scenario variable names and regex. (testsuite[master])

John Bigelow asteriskteam at digium.com
Fri Jul 31 17:39:40 CDT 2015


John Bigelow has uploaded a new change for review.

  https://gerrit.asterisk.org/1026

Change subject: dialog_info_xml: Fix SIPp scenario variable names and regex.
......................................................................

dialog_info_xml: Fix SIPp scenario variable names and regex.

The SIPp scenario contains multiple regular expressions and assigns the same
variable name for each. This causes the regex checks following the first check
to always be successful even if they do not match. This changes the variable
names so they are all unique.

Fixing the variable names resulted in two expressions failing which appear to
be issues with the regex and not Asterisk. This additionally fixes the regex.

A minor change to the test-config.yaml was made to add TEST_FRAMEWORK as a
dependency for the test since it expects a TestEvent.

Change-Id: I9a380bc36e243fc0a3dcc1dfc1db999e7308099a
---
M tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe.xml
M tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
2 files changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/26/1026/1

diff --git a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe.xml b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe.xml
index 85f3047..fcfd261 100644
--- a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe.xml
+++ b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe.xml
@@ -28,11 +28,11 @@
  <dialog id=\"presence\">
   <state>terminated</state>
  </dialog>
-</dialog-info>" check_it="true" search_in="body" assign_to="body" />
+</dialog-info>" check_it="true" search_in="body" assign_to="body1" />
     </action>
   </recv>
 
-  <Reference variables="body" />
+  <Reference variables="body1" />
 
   <send>
     <![CDATA[
@@ -55,11 +55,11 @@
  <dialog id=\"presence\">
   <state>early</state>
  </dialog>
-</dialog-info>" check_it="true" search_in="body" assign_to="body" />
+</dialog-info>" check_it="true" search_in="body" assign_to="body2" />
     </action>
   </recv>
 
-  <Reference variables="body" />
+  <Reference variables="body2" />
 
   <send>
     <![CDATA[
@@ -78,15 +78,15 @@
 
   <recv request="NOTIFY" crlf="true">
     <action>
-      <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"1\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
+      <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"2\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
  <dialog id=\"presence\">
   <state>confirmed</state>
  </dialog>
-</dialog-info>" check_it="true" search_in="body" assign_to="body" />
+</dialog-info>" check_it="true" search_in="body" assign_to="body3" />
     </action>
   </recv>
 
-  <Reference variables="body" />
+  <Reference variables="body3" />
 
   <send>
     <![CDATA[
@@ -109,16 +109,16 @@
  <dialog id=\"presence\">
   <state>confirmed</state>
   <local>
-   <target uri=\"sip:presence at 127.0.0.1\">
+   <target uri=\"sip:presence at 127.0.0.1(:5060)?\">
     <param pname=\"\+sip.rendering\" pvalue=\"no\" />
    </target>
   </local>
  </dialog>
-</dialog-info>" check_it="true" search_in="body" assign_to="body" />
+</dialog-info>" check_it="true" search_in="body" assign_to="body4" />
     </action>
   </recv>
 
-  <Reference variables="body" />
+  <Reference variables="body4" />
 
   <send>
     <![CDATA[
diff --git a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
index 8652bd8..30c7627 100644
--- a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
@@ -7,6 +7,7 @@
 properties:
     minversion: '12.4.0'
     dependencies:
+        - buildoption: 'TEST_FRAMEWORK'
         - sipp :
             version : 'v3.0'
         - python: 'twisted'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a380bc36e243fc0a3dcc1dfc1db999e7308099a
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: John Bigelow <jbigelow at digium.com>



More information about the asterisk-code-review mailing list