[CalendarServer-changes] [10725] CalDAVTester/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Feb 14 09:40:02 PST 2013
Revision: 10725
http://trac.calendarserver.org//changeset/10725
Author: cdaboo at apple.com
Date: 2013-02-14 09:40:02 -0800 (Thu, 14 Feb 2013)
Log Message:
-----------
Tests for direct sharing and managed attachments.
Modified Paths:
--------------
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml
Added Paths:
-----------
CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/4.xml
CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/5.xml
CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/6.xml
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/4.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/4.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/4.xml 2013-02-14 17:40:02 UTC (rev 10725)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propertyupdate xmlns:D="DAV:">
+<D:set>
+<D:prop>
+<D:group-member-set><D:href>$principaluri2:</D:href></D:group-member-set>
+</D:prop>
+</D:set>
+</D:propertyupdate>
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/5.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/5.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/5.xml 2013-02-14 17:40:02 UTC (rev 10725)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propertyupdate xmlns:D="DAV:">
+<D:set>
+<D:prop>
+<D:group-member-set><D:href>$principaluri3:</D:href></D:group-member-set>
+</D:prop>
+</D:set>
+</D:propertyupdate>
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/6.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/6.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/sharing/6.xml 2013-02-14 17:40:02 UTC (rev 10725)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propertyupdate xmlns:D="DAV:">
+<D:set>
+<D:prop>
+<D:group-member-set/>
+</D:prop>
+</D:set>
+</D:propertyupdate>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml 2013-02-14 03:00:56 UTC (rev 10724)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml 2013-02-14 17:40:02 UTC (rev 10725)
@@ -1331,6 +1331,383 @@
</test>
</test-suite>
+ <test-suite name='Direct share' ignore='no'>
+ <test name='1' ignore='no'>
+ <description>Add user02 as read write for user01</description>
+ <request print-response="no">
+ <method>PROPPATCH</method>
+ <ruri>$principal1:calendar-proxy-write/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/4.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}group-member-set</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2' ignore='no'>
+ <description>Add user03 as read write for user01</description>
+ <request print-response="no">
+ <method>PROPPATCH</method>
+ <ruri>$principal1:calendar-proxy-read/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}group-member-set</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Sharees do direct share</description>
+ <request user="$userid2:" pswd="$pswd2:" print-response='no'>
+ <method>GET</method>
+ <ruri>$calendarhome1:/shared/?action=share</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>{DAV:}href</name>
+ <variable>$sharedcalendar2:</variable>
+ </grabelement>
+ </request>
+ <request user="$userid3:" pswd="$pswd3:" print-response='no'>
+ <method>GET</method>
+ <ruri>$calendarhome1:/shared/?action=share</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ <grabelement>
+ <name>{DAV:}href</name>
+ <variable>$sharedcalendar3:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='4' ignore='no'>
+ <description>PUT event</description>
+ <request end-delete='no'>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/shared/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/1.ics</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>GET</method>
+ <ruri>$calendarhome1:/shared/1.ics</ruri>
+ <verify>
+ <callback>calendarDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/sharing/1.ics</value>
+ </arg>
+ </verify>
+ <grabheader>
+ <name>ETag</name>
+ <variable>$etag:</variable>
+ </grabheader>
+ </request>
+ </test>
+ <test name='5' ignore='no'>
+ <description>Read-only sharee cannot add attachment</description>
+ <request user="$userid3:" pswd="$pswd3:">
+ <method>POST</method>
+ <ruri>$sharedcalendar3:/1.ics?action=attachment-add</ruri>
+ <header>
+ <name>Content-Disposition</name>
+ <value>attachment;filename=test.txt</value>
+ </header>
+ <header>
+ <name>Prefer</name>
+ <value>return=representation</value>
+ </header>
+ <data>
+ <content-type>text/plain</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/2.txt</filepath>
+ </data>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>{DAV:}need-privileges</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='6' ignore='no'>
+ <description>Sharee can add attachment</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>POST</method>
+ <ruri>$sharedcalendar2:/1.ics?action=attachment-add</ruri>
+ <header>
+ <name>Content-Disposition</name>
+ <value>attachment;filename=test.txt</value>
+ </header>
+ <header>
+ <name>Prefer</name>
+ <value>return=representation</value>
+ </header>
+ <data>
+ <content-type>text/plain</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/2.txt</filepath>
+ </data>
+ <verify>
+ <callback>calendarDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/sharing/1.ics</value>
+ </arg>
+ <arg>
+ <name>filter</name>
+ <value>ATTACH</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>unwrap</name>
+ <value/>
+ </arg>
+ <arg>
+ <name>contains</name>
+ <value>ATTACH</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>header</callback>
+ <arg>
+ <name>header</name>
+ <value>Cal-Managed-ID</value>
+ </arg>
+ </verify>
+ <grabheader>
+ <name>Location</name>
+ <variable>$location:</variable>
+ </grabheader>
+ <grabheader>
+ <name>Cal-Managed-ID</name>
+ <variable>$managed-id:</variable>
+ </grabheader>
+ </request>
+ </test>
+ <test name='7' ignore='no'>
+ <description>Check for attachment - sharer</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>dataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='8' ignore='no'>
+ <description>Check for attachment - sharees</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>dataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+ </arg>
+ </verify>
+ </request>
+ <request user="$userid3:" pswd="$pswd3:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>dataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='9' ignore='no'>
+ <description>Check for attachment - non sharee</description>
+ <request user="$userid4:" pswd="$pswd4:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>{DAV:}need-privileges</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='10' ignore='no'>
+ <description>Read-only sharee cannot remove attachment</description>
+ <request user="$userid3:" pswd="$pswd3:">
+ <method>POST</method>
+ <ruri>$sharedcalendar3:/1.ics?action=attachment-remove&managed-id=$managed-id:</ruri>
+ <header>
+ <name>Prefer</name>
+ <value>return=representation</value>
+ </header>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>{DAV:}need-privileges</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='11' ignore='no'>
+ <description>Sharee remove attachment</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>POST</method>
+ <ruri>$sharedcalendar2:/1.ics?action=attachment-remove&managed-id=$managed-id:</ruri>
+ <header>
+ <name>Prefer</name>
+ <value>return=representation</value>
+ </header>
+ <verify>
+ <callback>calendarDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/simple/1.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='12' ignore='no'>
+ <description>Check for attachment - sharer</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='13' ignore='no'>
+ <description>Check for attachment - sharees</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ <request user="$userid3:" pswd="$pswd3:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='14' ignore='no'>
+ <description>Check for attachment - non sharee</description>
+ <request user="$userid4:" pswd="$pswd4:">
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='15' ignore='no'>
+ <description>Delete calendar data</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>DELETE</method>
+ <ruri>$sharedcalendar2:/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request user="$userid3:" pswd="$pswd3:">
+ <method>DELETE</method>
+ <ruri>$sharedcalendar3:/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/shared/1.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='16' ignore='no'>
+ <description>Clear user02 as read-write proxy for user01</description>
+ <request print-response="no">
+ <method>PROPPATCH</method>
+ <ruri>$principal1:calendar-proxy-write/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}group-member-set</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='17' ignore='no'>
+ <description>Clear user03 as read-only proxy for user01</description>
+ <request print-response="no">
+ <method>PROPPATCH</method>
+ <ruri>$principal1:calendar-proxy-read/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/sharing/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}group-member-set</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
<end>
<request user="$useradmin:" pswd="$pswdadmin:">
<method>DELETEALL</method>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130214/35b8ba34/attachment-0001.html>
More information about the calendarserver-changes
mailing list