[asterisk-commits] pjsip presence: Fix tests for updated PIDF/XPIDF logic (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 1 12:07:54 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6112 )

Change subject: pjsip presence: Fix tests for updated PIDF/XPIDF logic
......................................................................

pjsip presence: Fix tests for updated PIDF/XPIDF logic

ASTERISK-26659

Change-Id: Ifb7bfa23172cd6481f788c35124ddcca772dbe1f
---
M tests/channels/pjsip/publish/presence_pidf/sipp/publish.xml
M tests/channels/pjsip/publish/presence_xpidf/sipp/publish.xml
M tests/channels/pjsip/subscriptions/presence/presence_pidf/state_check.py
M tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_pidf/test-config.yaml
M tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_xpidf/test-config.yaml
5 files changed, 42 insertions(+), 51 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/channels/pjsip/publish/presence_pidf/sipp/publish.xml b/tests/channels/pjsip/publish/presence_pidf/sipp/publish.xml
index eb97c2a..98295c1 100644
--- a/tests/channels/pjsip/publish/presence_pidf/sipp/publish.xml
+++ b/tests/channels/pjsip/publish/presence_pidf/sipp/publish.xml
@@ -5,7 +5,7 @@
   <recv request="PUBLISH" crlf="true">
     <action>
       <ereg regexp="<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>
-<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:pp=\"urn:ietf:params:xml:ns:pidf:person\" xmlns:es=\"urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status\" xmlns:ep=\"urn:ietf:params:xml:ns:pidf:rpid:rpid-person\">
+<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\">
  <note>Ready</note>
  <tuple id=\"presence\">
   <status>
@@ -13,9 +13,7 @@
   </status>
   <contact priority=\"1\">sip:presence at 127.0.0.1:5061</contact>
  </tuple>
- <pp:person>
-  <status />
- </pp:person>
+ <dm:person />
 </presence>" check_it="true" search_in="body" assign_to="presence1" />
     </action>
   </recv>
@@ -40,19 +38,19 @@
   <recv request="PUBLISH" crlf="true">
     <action>
       <ereg regexp="<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>
-<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:pp=\"urn:ietf:params:xml:ns:pidf:person\" xmlns:es=\"urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status\" xmlns:ep=\"urn:ietf:params:xml:ns:pidf:rpid:rpid-person\">
+<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\">
  <note>Ringing</note>
  <tuple id=\"presence\">
   <status>
-   <basic>closed</basic>
+   <basic>open</basic>
   </status>
   <contact priority=\"1\">sip:presence at 127.0.0.1:5061</contact>
  </tuple>
- <pp:person>
-  <status>
-   <ep:activities>ep:busy</ep:activities>
-  </status>
- </pp:person>
+ <dm:person>
+  <rpid:activities>
+   <rpid:on-the-phone />
+  </rpid:activities>
+ </dm:person>
 </presence>" check_it="true" search_in="body" assign_to="presence2" />
     </action>
   </recv>
@@ -77,19 +75,19 @@
   <recv request="PUBLISH" crlf="true">
     <action>
       <ereg regexp="<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>
-<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:pp=\"urn:ietf:params:xml:ns:pidf:person\" xmlns:es=\"urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status\" xmlns:ep=\"urn:ietf:params:xml:ns:pidf:rpid:rpid-person\">
+<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\">
  <note>On the phone</note>
  <tuple id=\"presence\">
   <status>
-   <basic>closed</basic>
+   <basic>open</basic>
   </status>
   <contact priority=\"1\">sip:presence at 127.0.0.1:5061</contact>
  </tuple>
- <pp:person>
-  <status>
-   <ep:activities>ep:busy</ep:activities>
-  </status>
- </pp:person>
+ <dm:person>
+  <rpid:activities>
+   <rpid:on-the-phone />
+  </rpid:activities>
+ </dm:person>
 </presence>" check_it="true" search_in="body" assign_to="presence3" />
     </action>
   </recv>
@@ -114,19 +112,19 @@
   <recv request="PUBLISH" crlf="true">
     <action>
       <ereg regexp="<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>
-<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:pp=\"urn:ietf:params:xml:ns:pidf:person\" xmlns:es=\"urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status\" xmlns:ep=\"urn:ietf:params:xml:ns:pidf:rpid:rpid-person\">
+<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\">
  <note>On hold</note>
  <tuple id=\"presence\">
   <status>
-   <basic>closed</basic>
+   <basic>open</basic>
   </status>
   <contact priority=\"1\">sip:presence at 127.0.0.1:5061</contact>
  </tuple>
- <pp:person>
-  <status>
-   <ep:activities>ep:busy</ep:activities>
-  </status>
- </pp:person>
+ <dm:person>
+  <rpid:activities>
+   <rpid:on-the-phone />
+  </rpid:activities>
+ </dm:person>
 </presence>" check_it="true" search_in="body" assign_to="presence4" />
     </action>
   </recv>
@@ -151,7 +149,7 @@
   <recv request="PUBLISH" crlf="true">
     <action>
       <ereg regexp="<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>
-<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:pp=\"urn:ietf:params:xml:ns:pidf:person\" xmlns:es=\"urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status\" xmlns:ep=\"urn:ietf:params:xml:ns:pidf:rpid:rpid-person\">
+<presence entity=\"sip:presence at 127.0.0.1:5061\" xmlns=\"urn:ietf:params:xml:ns:pidf\" xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\">
  <note>Ready</note>
  <tuple id=\"presence\">
   <status>
@@ -159,9 +157,7 @@
   </status>
   <contact priority=\"1\">sip:presence at 127.0.0.1:5061</contact>
  </tuple>
- <pp:person>
-  <status />
- </pp:person>
+ <dm:person />
 </presence>" check_it="true" search_in="body" assign_to="presence5" />
     </action>
   </recv>
diff --git a/tests/channels/pjsip/publish/presence_xpidf/sipp/publish.xml b/tests/channels/pjsip/publish/presence_xpidf/sipp/publish.xml
index 599009d..af0f6e3 100644
--- a/tests/channels/pjsip/publish/presence_xpidf/sipp/publish.xml
+++ b/tests/channels/pjsip/publish/presence_xpidf/sipp/publish.xml
@@ -105,8 +105,8 @@
  <presentity uri=\"sip:presence at 127.0.0.1:5061;method=SUBSCRIBE\" />
  <atom atomid=(.*?) id=\"presence\">
   <address uri=\"sip:presence at 127.0.0.1:5061;user=ip\" priority=\"0.80000\">
-   <status status=\"closed\" />
-   <msnsubstatus substatus=\"offline\" />
+   <status status=\"inuse\" />
+   <msnsubstatus substatus=\"onthephone\" />
   </address>
  </atom>
 </presence>" check_it="true" search_in="body" assign_to="presence4" />
diff --git a/tests/channels/pjsip/subscriptions/presence/presence_pidf/state_check.py b/tests/channels/pjsip/subscriptions/presence/presence_pidf/state_check.py
index f51a725..ffe82a0 100644
--- a/tests/channels/pjsip/subscriptions/presence/presence_pidf/state_check.py
+++ b/tests/channels/pjsip/subscriptions/presence/presence_pidf/state_check.py
@@ -11,10 +11,10 @@
 LOGGER = logging.getLogger(__name__)
 
 states = [
-    ('INUSE', 2, "On the phone"),
-    ('ONHOLD', 2, "On hold"),
-    ('BUSY', 2, "On the phone"),
-    ('RINGING', 2, "Ringing"),
+    ('INUSE', 1, "On the phone"),
+    ('ONHOLD', 1, "On hold"),
+    ('BUSY', 1, "On the phone"),
+    ('RINGING', 1, "Ringing"),
     ('UNAVAILABLE', 2, "Unavailable"),
     ('NOT_INUSE', 1, "Ready"),
     ('', 1, "Ready")  # Final state upon subscription teardown
diff --git a/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_pidf/test-config.yaml b/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_pidf/test-config.yaml
index 17bba83..027c6e1 100644
--- a/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_pidf/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_pidf/test-config.yaml
@@ -62,12 +62,12 @@
         # Expected namespaces for PIDF bodies.
         namespaces:
             default: 'urn:ietf:params:xml:ns:pidf'
-            pp: 'urn:ietf:params:xml:ns:pidf:person'
-            ep: 'urn:ietf:params:xml:ns:pidf:rpid:rpid-person'
+            pp: 'urn:ietf:params:xml:ns:pidf:data-model'
+            ep: 'urn:ietf:params:xml:ns:pidf:rpid'
         # All expected element tag names for PIDF bodies.
         tags:
             ['presence', 'note', 'tuple', 'status', 'basic', 'contact',
-             'pp:person', 'ep:activities']
+             'pp:person', 'ep:activities', 'ep:on-the-phone']
         # Regex patterns for element attributes for each body in order. Some
         # attribute values of elements differ for each body depending on the
         # body type and state changes. Therefore we list them in the order that
@@ -134,28 +134,23 @@
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'Ringing'
-                basic: 'closed'
-                activities: 'ep:busy'
+                basic: 'open'
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'On the phone'
-                basic: 'closed'
-                activities: 'ep:busy'
+                basic: 'open'
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'On hold'
-                basic: 'closed'
-                activities: 'ep:busy'
+                basic: 'open'
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'On the phone'
-                basic: 'closed'
-                activities: 'ep:busy'
+                basic: 'open'
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'Unavailable'
                 basic: 'closed'
-                activities: 'ep:away'
                 contact: '^"alice" <sip:alice at 127.0.0.1(:5060)?>$'
             -
                 note: 'Ready'
diff --git a/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_xpidf/test-config.yaml b/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_xpidf/test-config.yaml
index b6bfc53..8918bae 100644
--- a/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_xpidf/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/presence/verify_bodies/verify_xpidf/test-config.yaml
@@ -118,9 +118,9 @@
                     uri: '^"alice" <sip:alice at 127.0.0.1(:5060)?>;user=ip$'
                     priority: '^0\.80000$'
                 status:
-                    status: '^closed$'
+                    status: '^inuse$'
                 msnsubstatus:
-                    substatus: '^offline$'
+                    substatus: '^onthephone$'
             -
                 presentity:
                     uri: '^sip:bob at 127.0.0.1(:5060)?;method=SUBSCRIBE$'
@@ -131,9 +131,9 @@
                     uri: '^"alice" <sip:alice at 127.0.0.1(:5060)?>;user=ip$'
                     priority: '^0\.80000$'
                 status:
-                    status: '^closed$'
+                    status: '^inuse$'
                 msnsubstatus:
-                    substatus: '^offline$'
+                    substatus: '^onthephone$'
             -
                 presentity:
                     uri: '^sip:bob at 127.0.0.1(:5060)?;method=SUBSCRIBE$'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb7bfa23172cd6481f788c35124ddcca772dbe1f
Gerrit-Change-Number: 6112
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170801/95c44c00/attachment-0001.html>


More information about the asterisk-commits mailing list