[CalendarServer-changes] [11595] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Sat Aug 10 08:58:02 PDT 2013
Revision: 11595
http://trac.calendarserver.org//changeset/11595
Author: gaya at apple.com
Date: 2013-08-10 08:58:02 -0700 (Sat, 10 Aug 2013)
Log Message:
-----------
Fix remove in group-shared addressbook. Fix CalDAVTester tests
Modified Paths:
--------------
CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml
CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml
CalendarServer/trunk/txdav/carddav/datastore/sql.py
Added Paths:
-----------
CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml
CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/17.xml
CalendarServer/trunk/_cffi_twext_python_launchd_x71c5fdx5b3668f3.so
CalendarServer/trunk/calendarserver/platform/darwin/_sacl.so
Removed Paths:
-------------
CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/15a.xml
CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml
Deleted: CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/15a.xml
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/15a.xml 2013-08-10 15:34:43 UTC (rev 11594)
+++ CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/15a.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<CS:share xmlns:D="DAV:" xmlns:CS="http://calendarserver.org/ns/">
- <CS:remove>
- <D:href>$cuaddrurn2:</D:href>
- </CS:remove>
-</CS:share>
Deleted: CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml 2013-08-10 15:34:43 UTC (rev 11594)
+++ CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -1,19 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?><notification xmlns='http://calendarserver.org/ns/'>
- <dtstamp></dtstamp>
- <invite-notification shared-type='group'>
- <uid></uid>
- <href xmlns='DAV:'>$cuaddrurn2:</href>
- <invite-deleted/>
- <access>
- <read-write/>
- </access>
- <hosturl>
- <href xmlns='DAV:'>$addressbookpath1:/3.vcf</href>
- </hosturl>
- <organizer>
- <href xmlns='DAV:'>$cuaddrurn1:</href>
- <common-name>User 01</common-name>
- </organizer>
- <summary>Group Address Book</summary>
- </invite-notification>
-</notification>
Copied: CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml (from rev 11591, CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/15a.xml)
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CS:share xmlns:D="DAV:" xmlns:CS="http://calendarserver.org/ns/">
+ <CS:remove>
+ <D:href>$cuaddrurn2:</D:href>
+ </CS:remove>
+</CS:share>
Copied: CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/17.xml (from rev 11591, CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/16.xml)
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/17.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CardDAV/sharing/groups/read-write/17.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?><notification xmlns='http://calendarserver.org/ns/'>
+ <dtstamp></dtstamp>
+ <invite-notification shared-type='group'>
+ <uid></uid>
+ <href xmlns='DAV:'>$cuaddrurn2:</href>
+ <invite-deleted/>
+ <access>
+ <read-write/>
+ </access>
+ <hosturl>
+ <href xmlns='DAV:'>$addressbookpath1:/3.vcf</href>
+ </hosturl>
+ <organizer>
+ <href xmlns='DAV:'>$cuaddrurn1:</href>
+ <common-name>User 01</common-name>
+ </organizer>
+ <summary>Group Address Book</summary>
+ </invite-notification>
+</notification>
Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml 2013-08-10 15:34:43 UTC (rev 11594)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -650,7 +650,7 @@
<ruri>$addressbookhome1:/$userguid2:/9.vcf</ruri>
<data>
<content-type>text/vcard; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/sharing/access/setup/2.vcf</filepath>
+ <filepath>Resource/CardDAV/sharing/access/setup/4.vcf</filepath>
</data>
<verify>
<callback>prepostcondition</callback>
@@ -665,7 +665,7 @@
<description>adding vCard with name in owner's address book fails</description>
<request>
<method>PUT</method>
- <ruri>$addressbookhome1:/$userguid2:/2.vcf</ruri>
+ <ruri>$addressbookhome1:/$userguid2:/5.vcf</ruri>
<data>
<content-type>text/vcard; charset=utf-8</content-type>
<filepath>Resource/CardDAV/sharing/access/setup/6.vcf</filepath>
@@ -711,6 +711,17 @@
<description>restore group membership</description>
<request user="$userid2:" pswd="$pswd2:">
<method>PUT</method>
+ <ruri>$addressbookpath2:/2.vcf</ruri>
+ <data>
+ <content-type>text/vcard; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/sharing/access/setup/2.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>PUT</method>
<ruri>$addressbookpath2:/g123.vcf</ruri>
<data>
<content-type>text/vcard; charset=utf-8</content-type>
Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml 2013-08-10 15:34:43 UTC (rev 11594)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml 2013-08-10 15:58:02 UTC (rev 11595)
@@ -34,47 +34,45 @@
<ruri>$notificationpath1:/</ruri>
<ruri>$notificationpath2:/</ruri>
</request>
+ <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/groups/read-write/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/groups/read-write/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/groups/read-write/3.vcf</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
</start>
<test-suite name='read-write' ignore='no'>
<test name='1' 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/groups/read-write/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/groups/read-write/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/groups/read-write/3.vcf</filepath>
- </data>
- <verify>
- <callback>statusCode</callback>
- </verify>
- </request>
- </test>
- <test name='2' ignore='no'>
<description>POST invitation to user vCard</description>
<request print-response='no'>
<method>POST</method>
@@ -92,7 +90,7 @@
</verify>
</request>
</test>
- <test name='3' ignore='no'>
+ <test name='2' ignore='no'>
<description>POST invitation to group vCard</description>
<request print-response='no'>
<method>POST</method>
@@ -106,7 +104,7 @@
</verify>
</request>
</test>
- <test name='3a' ignore='no'>
+ <test name='3' ignore='no'>
<description>Sharer sees group as shared-owner</description>
<request user="$userid1:" pswd="$pswd1:" print-response='no'>
<method>PROPFIND</method>
@@ -217,7 +215,7 @@
</verify>
</request>
</test>
- <test name='6a' ignore='no'>
+ <test name='7' ignore='no'>
<description>Sharee sees shared address book and shared vCards</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>PROPFIND</method>
@@ -251,7 +249,7 @@
</verify>
</request>
</test>
- <test name='7'>
+ <test name='8'>
<description>Shared address book exists Depth:1</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>PROPFIND</method>
@@ -289,7 +287,7 @@
</verify>
</request>
</test>
- <test name='8' ignore='no'>
+ <test name='9' ignore='no'>
<description>Sharee sees shared group vcard</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
@@ -303,20 +301,6 @@
</verify>
</request>
</test>
- <test name='9' ignore='yes'>
- <description>Sharee cannot delete shared group vcard</description>
- <request user="$userid2:" pswd="$pswd2:" print-response='no'>
- <method>DELETE</method>
- <ruri>$sharedgroup:</ruri>
- <verify>
- <callback>statusCode</callback>
- <arg>
- <name>status</name>
- <value>403</value>
- </arg>
- </verify>
- </request>
- </test>
<test name='10' ignore='no'>
<description>Sharee creates group vcard with unknown member UID</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
@@ -380,6 +364,9 @@
</arg>
</verify>
</request>
+ </test>
+ <test name='14' ignore='no'>
+ <description>Sharer sees vcard as group member</description>
<request print-response='no'>
<method>GET</method>
<ruri>$addressbookpath1:/3.vcf</ruri>
@@ -392,7 +379,7 @@
</verify>
</request>
</test>
- <test name='14' ignore='no'>
+ <test name='15' ignore='no'>
<description>Sharer changes vcard</description>
<request print-response='no'>
<method>PUT</method>
@@ -406,7 +393,7 @@
</verify>
</request>
</test>
- <test name='14+' ignore='no'>
+ <test name='16' ignore='no'>
<description>Sharee sees changed vcard</description>
<request>
<method>GET</method>
@@ -420,7 +407,7 @@
</verify>
</request>
</test>
- <test name='15' ignore='no'>
+ <test name='17' ignore='no'>
<description>Sharee sees changed vcard</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
@@ -434,7 +421,7 @@
</verify>
</request>
</test>
- <test name='16' ignore='no'>
+ <test name='18' ignore='no'>
<description>Sharer creates subgroup that contains 2 already present members</description>
<request print-response='no'>
<method>PUT</method>
@@ -448,7 +435,7 @@
</verify>
</request>
</test>
- <test name='17' ignore='no'>
+ <test name='19' ignore='no'>
<description>Sharee sees new vcards</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
@@ -461,6 +448,9 @@
</arg>
</verify>
</request>
+ </test>
+ <test name='20' ignore='no'>
+ <description>Sharee sees new vcards</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
<ruri>$addressbookhome2:/$userguid1:/2.vcf</ruri>
@@ -472,6 +462,9 @@
</arg>
</verify>
</request>
+ </test>
+ <test name='21' ignore='no'>
+ <description>Sharee sees new vcards</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
<ruri>$addressbookhome2:/$userguid1:/1.vcf</ruri>
@@ -484,7 +477,7 @@
</verify>
</request>
</test>
- <test name='18' ignore='no'>
+ <test name='22' ignore='no'>
<description>Sharee removes vCard from subgroup</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>PUT</method>
@@ -498,7 +491,7 @@
</verify>
</request>
</test>
- <test name='19' ignore='no'>
+ <test name='23' ignore='no'>
<description>Sharee cannot access removed sub group member</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GET</method>
@@ -512,7 +505,7 @@
</verify>
</request>
</test>
- <test name='20' ignore='no'>
+ <test name='24' ignore='no'>
<description>Sharer sees subgroup changes and removed subgroup member</description>
<request print-response='no'>
<method>GET</method>
@@ -525,6 +518,9 @@
</arg>
</verify>
</request>
+ </test>
+ <test name='25' ignore='no'>
+ <description>Sharer sees removed subgroup member</description>
<request print-response='no'>
<method>GET</method>
<ruri>$addressbookpath1:/1.vcf</ruri>
@@ -537,7 +533,7 @@
</verify>
</request>
</test>
- <test name='21' ignore='no'>
+ <test name='26' ignore='no'>
<description>Sharee deletes vCard in subgroup</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>DELETE</method>
@@ -547,8 +543,8 @@
</verify>
</request>
</test>
- <test name='22' ignore='no'>
- <description>Sharer sees subgroup changes and sharee-deleted subgroup member</description>
+ <test name='27' ignore='no'>
+ <description>Sharer sees subgroup changes</description>
<request print-response='no'>
<method>GET</method>
<ruri>$addressbookpath1:/5.vcf</ruri>
@@ -560,40 +556,29 @@
</arg>
</verify>
</request>
+ </test>
+ <test name='28' ignore='no'>
+ <description>sharee-deleted subgroup member is gone</description>
<request print-response='no'>
<method>GET</method>
<ruri>$addressbookpath1:/2.vcf</ruri>
<verify>
- <callback>addressDataMatch</callback>
- <arg>
- <name>filepath</name>
- <value>Resource/CardDAV/sharing/groups/read-write/2.vcf</value>
- </arg>
- </verify>
- </request>
- </test>
- <test name='23' ignore='no'>
- <description>Sharer deletes shared group</description>
- <request print-response='no'>
- <method>DELETE</method>
- <ruri>$addressbookpath1:/3.vcf</ruri>
- <verify>
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>204</value>
+ <value>404</value>
</arg>
</verify>
</request>
</test>
- <test name='23a' ignore='yes'>
+ <test name='29' ignore='no'>
<description>Unshare main address book</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/CardDAV/sharing/groups/read-write/15a.xml</filepath>
+ <filepath>Resource/CardDAV/sharing/groups/read-write/16.xml</filepath>
</data>
<verify>
<callback>statusCode</callback>
@@ -604,7 +589,7 @@
</verify>
</request>
</test>
- <test name='24' ignore='no'>
+ <test name='30' ignore='no'>
<description>Check Sharee notification collection and delete invite-deleted</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>WAITCOUNT 1</method>
@@ -617,7 +602,7 @@
<callback>xmlDataMatch</callback>
<arg>
<name>filepath</name>
- <value>Resource/CardDAV/sharing/groups/read-write/16.xml</value>
+ <value>Resource/CardDAV/sharing/groups/read-write/17.xml</value>
</arg>
<arg>
<name>filter</name>
@@ -631,7 +616,7 @@
<ruri>$</ruri>
</request>
</test>
- <test name='25' ignore='no'>
+ <test name='31' ignore='no'>
<description>No more shared addressbook</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>PROPFIND</method>
Added: CalendarServer/trunk/_cffi_twext_python_launchd_x71c5fdx5b3668f3.so
===================================================================
(Binary files differ)
Property changes on: CalendarServer/trunk/_cffi_twext_python_launchd_x71c5fdx5b3668f3.so
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: CalendarServer/trunk/calendarserver/platform/darwin/_sacl.so
===================================================================
(Binary files differ)
Property changes on: CalendarServer/trunk/calendarserver/platform/darwin/_sacl.so
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Modified: CalendarServer/trunk/txdav/carddav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-10 15:34:43 UTC (rev 11594)
+++ CalendarServer/trunk/txdav/carddav/datastore/sql.py 2013-08-10 15:58:02 UTC (rev 11595)
@@ -1340,36 +1340,30 @@
self._txn, groupIDs=readWriteObjectIDs
)
- yield self._changeAddressBookRevision(self.ownerHome().addressbook())
+ aboMembers = schema.ABO_MEMBERS
+ aboForeignMembers = schema.ABO_FOREIGN_MEMBERS
- # FIXME: drop though here and actually delete
- else: # owned or fully shared
- # delete members table rows for this object,...
- aboMembers = schema.ABO_MEMBERS
- aboForeignMembers = schema.ABO_FOREIGN_MEMBERS
+ groupIDRows = yield Delete(
+ aboMembers,
+ Where=aboMembers.MEMBER_ID == self._resourceID,
+ Return=aboMembers.GROUP_ID
+ ).on(self._txn)
- groupIDRows = yield Delete(
- aboMembers,
- Where=aboMembers.MEMBER_ID == self._resourceID,
- Return=aboMembers.GROUP_ID
+ # add to foreign member table row by UID (aboForeignMembers on address books)
+ memberAddress = "urn:uuid:" + self._uid
+ for groupID in set([groupIDRow[0] for groupIDRow in groupIDRows]) - set([self._ownerAddressBookResourceID]):
+ yield Insert(
+ {aboForeignMembers.GROUP_ID: groupID,
+ aboForeignMembers.ADDRESSBOOK_ID: self._ownerAddressBookResourceID,
+ aboForeignMembers.MEMBER_ADDRESS: memberAddress, }
).on(self._txn)
- # add to foreign member table row by UID
- memberAddress = "urn:uuid:" + self._uid
- for groupID in [groupIDRow[0] for groupIDRow in groupIDRows]:
- if groupID != self._ownerAddressBookResourceID: # no aboForeignMembers on address books
- yield Insert(
- {aboForeignMembers.GROUP_ID: groupID,
- aboForeignMembers.ADDRESSBOOK_ID: self._ownerAddressBookResourceID,
- aboForeignMembers.MEMBER_ADDRESS: memberAddress, }
- ).on(self._txn)
+ yield super(AddressBookObject, self).remove()
+ self._kind = None
+ self._ownerAddressBookResourceID = None
+ self._component = None
- yield super(AddressBookObject, self).remove()
- self._kind = None
- self._ownerAddressBookResourceID = None
- self._component = None
-
@inlineCallbacks
def readWriteAccess(self):
assert not self.owned(), "Don't call items in owned address book"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130810/d5f7b9c4/attachment-0001.html>
More information about the calendarserver-changes
mailing list