[CalendarServer-changes] [11262] CalDAVTester/branches/users/cdaboo/group-sync
source_changes at macosforge.org
source_changes at macosforge.org
Thu May 30 09:53:36 PDT 2013
Revision: 11262
http://trac.calendarserver.org//changeset/11262
Author: cdaboo at apple.com
Date: 2013-05-30 09:53:36 -0700 (Thu, 30 May 2013)
Log Message:
-----------
Checkpoint for shared group sync work.
Modified Paths:
--------------
CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/1.vcf
CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/2.vcf
CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/3.vcf
CalDAVTester/branches/users/cdaboo/group-sync/scripts/tests/CardDAV/sharing-sync.xml
CalDAVTester/branches/users/cdaboo/group-sync/src/caldavtest.py
CalDAVTester/branches/users/cdaboo/group-sync/src/serverinfo.py
CalDAVTester/branches/users/cdaboo/group-sync/verifiers/xmlElementMatch.py
Modified: CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/1.vcf
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/1.vcf 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/1.vcf 2013-05-30 16:53:36 UTC (rev 11262)
@@ -7,5 +7,5 @@
TEL;type=CELL:1-555-555-5555
item1.ADR;type=WORK;type=pref:;;2 Lag;Elk Forest;California;99999;USA
item1.X-ABADR:us
-UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson
+UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1
END:VCARD
Modified: CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/2.vcf
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/2.vcf 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/2.vcf 2013-05-30 16:53:36 UTC (rev 11262)
@@ -8,5 +8,5 @@
item1.ADR;type=WORK;type=pref:;;2 Fidel Ave. Suite 1;Mountain Top;CA;99999;USA
item1.X-ABADR:us
X-ABShowAs:COMPANY
-UID:FCBA0FA3-00B2-4C95-B4EC-4CCC4843F8B1:ABPerson
+UID:FCBA0FA3-00B2-4C95-B4EC-4CCC4843F8B1
END:VCARD
Modified: CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/3.vcf
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/3.vcf 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/Resource/CardDAV/sharing/sync/group-one/3.vcf 2013-05-30 16:53:36 UTC (rev 11262)
@@ -6,5 +6,5 @@
N:Shared Group;;;;
REV:20120503T194243Z
X-ADDRESSBOOKSERVER-KIND:group
-X-ADDRESSBOOKSERVER-MEMBER:urn:uuid:8aa9ed15-5619-44d7-b061-51976dd5a174
+X-ADDRESSBOOKSERVER-MEMBER:urn:uuid:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1
END:VCARD
Modified: CalDAVTester/branches/users/cdaboo/group-sync/scripts/tests/CardDAV/sharing-sync.xml
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/scripts/tests/CardDAV/sharing-sync.xml 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/scripts/tests/CardDAV/sharing-sync.xml 2013-05-30 16:53:36 UTC (rev 11262)
@@ -176,7 +176,11 @@
<filepath>Resource/Common/POST/sharingreply2.xml</filepath>
</data>
<verify>
- <callback>statusCode</callback>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>{http://calendarserver.org/ns/}shared-as/{DAV:}href[=$addressbookhome2:/$userid1:/]</value>
+ </arg>
</verify>
<grabelement>
<name>{DAV:}href</name>
@@ -827,9 +831,858 @@
</test>
</test-suite>
+ <test-suite name='Single shared group' only="yes">
+ <test name='1' ignore='no'>
+ <description>Initial sync tokens</description>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='yes'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2' ignore='no'>
+ <description>Sharer creates 2 persons and a group</description>
+ <request print-response='no'>
+ <method>PUT</method>
+ <ruri>$addressbookpath1:/1.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/sync/group-one/1.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request print-response='no'>
+ <method>PUT</method>
+ <ruri>$addressbookpath1:/2.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/sync/group-one/2.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request print-response='no'>
+ <method>PUT</method>
+ <ruri>$addressbookpath1:/3.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/sync/group-one/3.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='3' ignore='no'>
+ <description>POST invitation</description>
+ <request print-response='no'>
+ <method>POST</method>
+ <ruri>$addressbookpath1:/3.vcf</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/POST/sharinginvite2.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>Check Sharee notification collection</description>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>WAITCOUNT 1</method>
+ <ruri>$notificationpath2:/</ruri>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>GETNEW</method>
+ <ruri>$notificationpath2:/</ruri>
+ <verify>
+ <callback>xmlDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CardDAV/sharing/sync/group-one/4.xml</value>
+ </arg>
+ <arg>
+ <name>filter</name>
+ <value>{http://calendarserver.org/ns/}dtstamp</value>
+ <value>{http://calendarserver.org/ns/}uid</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>{http://calendarserver.org/ns/}invite-notification/{http://calendarserver.org/ns/}uid</name>
+ <variable>$inviteuid2:</variable>
+ </grabelement>
+ <grabelement>
+ <name>{http://calendarserver.org/ns/}invite-notification/{http://calendarserver.org/ns/}hosturl/{DAV:}href</name>
+ <variable>$hosturl2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='5'>
+ <description>Sharee replies ACCEPTED</description>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>POST</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>application/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/POST/sharingreply2.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{http://calendarserver.org/ns/}shared-as/{DAV:}href[=$addressbookhome2:/$userid1:/3.vcf]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>{DAV:}href</name>
+ <variable>parentname($sharedaddressbook:)</variable>
+ </grabelement>
+ </request>
+ <request user="$useradmin:" pswd="$pswdadmin:">
+ <method>DELETEALL</method>
+ <ruri>$notificationpath1:/</ruri>
+ <ruri>$notificationpath2:/</ruri>
+ </request>
+ </test>
+ <test name='6' ignore='no'>
+ <description>Updated tokens</description>
+ <pause/>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token1-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token2-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ <value>$addressbook:/1.vcf</value>
+ <value>$addressbook:/2.vcf</value>
+ <value>$addressbook:/3.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token3-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ <value>2.vcf</value>
+ <value>3.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='yes'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token4-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token5-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ <value>$sharedaddressbook:/1.vcf</value>
+ <value>$sharedaddressbook:/3.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-init-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ <value>3.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken6:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <!--
+ <test name='7'>
+ <description>Sharee creates vcard</description>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>PUT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/1.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/sync/addressbook/2.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='7' ignore='no'>
+ <description>Updated tokens</description>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token1-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token2-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ <value>$addressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token3-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token4-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token5-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ <value>$sharedaddressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token6-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken6:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='8'>
+ <description>Sharer changes event</description>
+ <request print-response='no'>
+ <method>PUT</method>
+ <ruri>$addressbookpath1:/1.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/sync/addressbook/3.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='9' ignore='no'>
+ <description>Updated tokens</description>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token1-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token2-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ <value>$addressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token3-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token4-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token5-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ <value>$sharedaddressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token6-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken6:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='10'>
+ <description>Sharee deletes event</description>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>DELETE</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/1.vcf</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='11' ignore='no'>
+ <description>Updated tokens</description>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token1-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token2-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$addressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token3-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token4-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token5-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$sharedaddressbook:/1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token6-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>1.vcf</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken6:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='12'>
+ <description>Sharer unshares</description>
+ <request print-response='no'>
+ <method>POST</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/POST/sharingremove2.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='13' ignore='no'>
+ <description>Updated tokens</description>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token1-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token2-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$addressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ <request print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookpath1:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token3-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken3:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token4-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken4:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token5-level-infinite.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>$sharedaddressbook:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken5:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>REPORT</method>
+ <ruri>$addressbookhome2:/$sharedaddressbook:/</ruri>
+ <data substitutions='yes'>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/REPORT/sync-token6-level-1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>404</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ -->
+ </test-suite>
+
<end>
<request user="$useradmin:" pswd="$pswdadmin:">
<method>DELETEALL</method>
+ <ruri>$addressbookpath1:/</ruri>
<ruri>$notificationpath1:/</ruri>
<ruri>$notificationpath2:/</ruri>
<ruri>$notificationpath3:/</ruri>
Modified: CalDAVTester/branches/users/cdaboo/group-sync/src/caldavtest.py
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/src/caldavtest.py 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/src/caldavtest.py 2013-05-30 16:53:36 UTC (rev 11262)
@@ -199,7 +199,7 @@
return "i"
else:
result = False
- resulttxt = ""
+ overalltxt = ""
postgresCount = self.postgresInit()
if test.stats:
reqstats = stats()
@@ -208,12 +208,13 @@
for ctr in range(test.count): #@UnusedVariable
for req_count, req in enumerate(test.requests):
result, resulttxt, _ignore_response, _ignore_respdata = self.dorequest(req, test.details, True, False, reqstats, etags=etags, label="%s | #%s" % (label, req_count + 1,), count=ctr + 1)
+ overalltxt += resulttxt
if not result:
break
loglevel = [manager.LOG_ERROR, manager.LOG_HIGH][result]
self.manager.log(loglevel, ["[FAILED]", "[OK]"][result])
- if len(resulttxt) > 0:
- self.manager.log(loglevel, resulttxt)
+ if len(overalltxt) > 0:
+ self.manager.log(loglevel, overalltxt)
if result and test.stats:
self.manager.log(manager.LOG_MEDIUM, "Total Time: %.3f secs" % (reqstats.totaltime,), indent=8)
self.manager.log(manager.LOG_MEDIUM, "Average Time: %.3f secs" % (reqstats.totaltime / reqstats.count,), indent=8)
@@ -226,15 +227,17 @@
return True
description += " " * max(1, STATUSTXT_WIDTH - len(description))
self.manager.log(manager.LOG_HIGH, description, before=1, after=0)
+ overalltxt = ""
for req_count, req in enumerate(list):
result, resulttxt, _ignore_response, _ignore_respdata = self.dorequest(req, False, doverify, forceverify, label="%s | #%s" % (label, req_count + 1), count=count)
+ overalltxt += resulttxt
if not result:
- resulttxt += "\nFailure during multiple requests #%d out of %d, request=%s" % (req_count + 1, len(list), str(req))
+ overalltxt += "\nFailure during multiple requests #%d out of %d, request=%s" % (req_count + 1, len(list), str(req))
break
loglevel = [manager.LOG_ERROR, manager.LOG_HIGH][result]
self.manager.log(loglevel, ["[FAILED]", "[OK]"][result])
- if len(resulttxt) > 0:
- self.manager.log(loglevel, resulttxt)
+ if len(overalltxt) > 0:
+ self.manager.log(loglevel, overalltxt)
return result
Modified: CalDAVTester/branches/users/cdaboo/group-sync/src/serverinfo.py
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/src/serverinfo.py 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/src/serverinfo.py 2013-05-30 16:53:36 UTC (rev 11262)
@@ -113,12 +113,29 @@
# basename() - extract just the URL last path segment from the value
if variable.startswith("basename("):
variable = variable[len("basename("):-1]
- value = value.rstrip("/").split("/")[-1]
+ value = self._variable_basename(value)
+
+ # parentname() - extract just the URL second to last path segment from the value
+ elif variable.startswith("parentname("):
+ variable = variable[len("parentname("):-1]
+ value = self._variable_parentname(value)
+
processed[variable] = value
self.addsubs(processed, self.extrasubsdict)
+ def _variable_basename(self, value):
+ return value.rstrip("/").split("/")[-1]
+
+
+ def _variable_parentname(self, value):
+ try:
+ return value.rstrip("/").split("/")[-2]
+ except IndexError:
+ return ""
+
+
def parseXML(self, node):
for child in node.getchildren():
if child.tag == src.xmlDefs.ELEMENT_HOST:
Modified: CalDAVTester/branches/users/cdaboo/group-sync/verifiers/xmlElementMatch.py
===================================================================
--- CalDAVTester/branches/users/cdaboo/group-sync/verifiers/xmlElementMatch.py 2013-05-30 16:52:27 UTC (rev 11261)
+++ CalDAVTester/branches/users/cdaboo/group-sync/verifiers/xmlElementMatch.py 2013-05-30 16:53:36 UTC (rev 11262)
@@ -142,6 +142,12 @@
return results
+ def splitRootFromPath(self, path):
+ piece = path.find("}")
+ splitat = path[piece:].find("/")
+ return path[:piece + splitat], path[piece + splitat + 1:]
+
+
def matchPath(self, root, path):
result = True
@@ -157,7 +163,7 @@
if actual_path[0] == '/':
actual_path = actual_path[1:]
if '/' in actual_path:
- root_path, child_path = actual_path.split('/', 1)
+ root_path, child_path = self.splitRootFromPath(actual_path)
if root.tag != root_path:
resulttxt += " Items not returned in XML for %s\n" % (path,)
nodes = root.findall(child_path)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130530/7f306490/attachment-0001.html>
More information about the calendarserver-changes
mailing list