[CalendarServer-changes] [10303] CalDAVTester/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jan 15 07:00:32 PST 2013
Revision: 10303
http://trac.calendarserver.org//changeset/10303
Author: cdaboo at apple.com
Date: 2013-01-15 07:00:32 -0800 (Tue, 15 Jan 2013)
Log Message:
-----------
Tests for managed attachments with dropbox compatibility. Note this turns off regular dropbox tests as that feature will be disabled in the server.
Modified Paths:
--------------
CalDAVTester/trunk/scripts/server/serverinfo-partitioning.xml
CalDAVTester/trunk/scripts/server/serverinfo-template.xml
CalDAVTester/trunk/scripts/server/serverinfo.xml
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-implicit.xml
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-recurrence.xml
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml
CalDAVTester/trunk/src/caldavtest.py
Added Paths:
-----------
CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/
CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/1.xml
CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/2.xml
CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/3.ics
CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/4.txt
CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-dropbox.xml
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/1.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/1.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/1.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:" xmlns:A="http://calendarserver.org/ns/">
+<D:prop>
+<A:dropbox-home-URL/>
+</D:prop>
+</D:propfind>
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/2.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/2.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/2.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:">
+<D:prop>
+<D:resourcetype/>
+</D:prop>
+</D:propfind>
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/3.ics
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/3.ics (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/3.ics 2013-01-15 15:00:32 UTC (rev 10303)
@@ -0,0 +1,11 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Example Inc.//Example Calendar//EN
+BEGIN:VEVENT
+UID:put-1 at example.com
+DTSTART:$now.year.1:0101T120000Z
+DURATION:P1DT
+DTSTAMP:20051222T205953Z
+SUMMARY:event 1
+END:VEVENT
+END:VCALENDAR
Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/4.txt
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/4.txt (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/dropbox/4.txt 2013-01-15 15:00:32 UTC (rev 10303)
@@ -0,0 +1,3 @@
+This is a text file being used
+as a test of managed attachment
+support in calendarserver.
Modified: CalDAVTester/trunk/scripts/server/serverinfo-partitioning.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-partitioning.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/server/serverinfo-partitioning.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -65,7 +65,7 @@
<feature>caldav</feature> <!-- Basic CalDAV feature enabler -->
<feature>auto-accept</feature> <!-- Auto-accept for rooms & locations -->
<feature>auto-accept-modes</feature> <!-- Auto-accept modes -->
- <feature>dropbox</feature> <!-- dropbox extension -->
+ <!-- <feature>dropbox</feature> --> <!-- dropbox extension -->
<feature>default-alarms</feature> <!-- default alarms extension -->
<feature>EMAIL parameter</feature> <!-- Server normalizes cuaddress and adds EMAIL parameter -->
<feature>extended-freebusy</feature> <!-- Extended freebusy response -->
@@ -261,7 +261,7 @@
<!-- attachments name-->
<substitution>
<key>$attachments:</key>
- <value>attachments</value>
+ <value>dropbox</value>
</substitution>
<!-- notification name-->
Modified: CalDAVTester/trunk/scripts/server/serverinfo-template.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -65,7 +65,7 @@
<feature>caldav</feature> <!-- Basic CalDAV feature enabler -->
<feature>auto-accept</feature> <!-- Auto-accept for rooms & locations -->
<feature>auto-accept-modes</feature> <!-- Auto-accept modes -->
- <feature>dropbox</feature> <!-- dropbox extension -->
+ <!-- <feature>dropbox</feature> --> <!-- dropbox extension -->
<feature>default-alarms</feature> <!-- default alarms extension -->
<feature>EMAIL parameter</feature> <!-- Server normalizes cuaddress and adds EMAIL parameter -->
<feature>extended-freebusy</feature> <!-- Extended freebusy response -->
@@ -261,7 +261,7 @@
<!-- attachments name-->
<substitution>
<key>$attachments:</key>
- <value>attachments</value>
+ <value>dropbox</value>
</substitution>
<!-- notification name-->
Modified: CalDAVTester/trunk/scripts/server/serverinfo.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/server/serverinfo.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -65,7 +65,7 @@
<feature>caldav</feature> <!-- Basic CalDAV feature enabler -->
<feature>auto-accept</feature> <!-- Auto-accept for rooms & locations -->
<feature>auto-accept-modes</feature> <!-- Auto-accept modes -->
- <feature>dropbox</feature> <!-- dropbox extension -->
+ <!--<feature>dropbox</feature> --> <!-- dropbox extension -->
<feature>default-alarms</feature> <!-- default alarms extension -->
<feature>EMAIL parameter</feature> <!-- Server normalizes cuaddress and adds EMAIL parameter -->
<feature>extended-freebusy</feature> <!-- Extended freebusy response -->
@@ -261,7 +261,7 @@
<!-- attachments name-->
<substitution>
<key>$attachments:</key>
- <value>attachments</value>
+ <value>dropbox</value>
</substitution>
<!-- notification name-->
Added: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-dropbox.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-dropbox.xml (rev 0)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-dropbox.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -0,0 +1,413 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2013 Apple Inc. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<caldavtest>
+ <description>Test managed attachments dropbox compatibility</description>
+
+ <require-feature>
+ <feature>caldav</feature>
+ <feature>managed-attachments</feature>
+ <feature>prefer-representation</feature>
+ </require-feature>
+
+ <start/>
+
+ <test-suite name='Principal properties'>
+ <test name='1'>
+ <description>Look for properties</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$principal1:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value><![CDATA[{http://calendarserver.org/ns/}dropbox-home-URL$<href xmlns="DAV:">$dropboxpath1:/</href>]]></value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Collection properties'>
+ <test name='1'>
+ <description>Look for properties</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$dropboxpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>$verify-property-prefix:/{DAV:}resourcetype/{DAV:}collection</value>
+ <value>$verify-property-prefix:/{DAV:}resourcetype/{http://calendarserver.org/ns/}dropbox-home</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Create managed attachment'>
+ <test name='1'>
+ <description>No dropboxes to start</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$dropboxpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/PROPFIND/count.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>count</name>
+ <value>0</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2' ignore='no'>
+ <description>PUT event</description>
+ <request end-delete='yes'>
+ <method>PUT</method>
+ <ruri>$calendarpath1:/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/3.ics</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>GET</method>
+ <ruri>$calendarpath1:/1.ics</ruri>
+ <verify>
+ <callback>calendarDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/dropbox/3.ics</value>
+ </arg>
+ </verify>
+ <grabheader>
+ <name>ETag</name>
+ <variable>$etag:</variable>
+ </grabheader>
+ </request>
+ </test>
+ <test name='3' ignore='no'>
+ <description>Add attachment (with prefer)</description>
+ <request>
+ <method>POST</method>
+ <ruri>$calendarpath1:/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/dropbox/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>calendarDataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/dropbox/3.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>
+ <value>;FILENAME=</value>
+ <value>;FMTTYPE=</value>
+ <value>;SIZE=</value>
+ <value>;MTAG=</value>
+ <value>;MANAGED-ID=</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='4' ignore='no'>
+ <description>Check for attachment</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location:</ruri>
+ <verify>
+ <callback>dataMatch</callback>
+ <arg>
+ <name>filepath</name>
+ <value>Resource/CalDAV/managedattachments/dropbox/4.txt</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <description>One dropbox</description>
+ <request>
+ <method>FINDNEW</method>
+ <ruri>$dropboxpath1:/</ruri>
+ <graburi>$dropboxchild1:</graburi>
+ </request>
+ </test>
+ <test name='6'>
+ <description>Scan dropbox</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$dropboxchild1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/PROPFIND/count.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>count</name>
+ <value>1</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Drop Box Collection Create'>
+ <test name='1'>
+ <description>Create drop box - fails</description>
+ <request end-delete='yes' user="$userid1:" pswd="$pswd1:">
+ <method>MKCOL</method>
+ <ruri>$dropboxpath1:/ABCEFG/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Look for properties</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$dropboxpath1:/ABCEFG/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/PROPFIND/count.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Drop Box Home Restrictions'>
+ <test name='1'>
+ <description>Try to create a calendar</description>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$dropboxpath1:/calendar/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2' ignore="no">
+ <description>Try to create a resource</description>
+ <request end-delete="yes">
+ <method>PUT</method>
+ <ruri>$dropboxpath1:/test.xml</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Drop Box Restrictions'>
+ <test name='1'>
+ <description>Try to create a calendar - non-existent dropbox</description>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$dropboxpath1:/ABCEFG/calendar/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Try to create a collection</description>
+ <request end-delete="yes">
+ <method>MKCOL</method>
+ <ruri>$dropboxpath1:/ABCEFG/calendar/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Try to create a resource - non-existent dropbox</description>
+ <request end-delete="yes">
+ <method>PUT</method>
+ <ruri>$dropboxpath1:/ABCEFG/xyz.txt</ruri>
+ <data>
+ <content-type>text/plain</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>Try to create a calendar - existing dropbox</description>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$dropboxchild1:/calendar/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>405</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <description>Try to create a collection - existing dropbox</description>
+ <request end-delete="yes">
+ <method>MKCOL</method>
+ <ruri>$dropboxchild1:/calendar/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>405</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='6'>
+ <description>Try to create a resource - existing dropbox</description>
+ <request end-delete="yes">
+ <method>PUT</method>
+ <ruri>$dropboxchild1:/xyz.txt</ruri>
+ <data>
+ <content-type>text/plain</content-type>
+ <filepath>Resource/CalDAV/managedattachments/dropbox/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <end/>
+
+</caldavtest>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-implicit.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-implicit.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-implicit.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -912,7 +912,7 @@
</verify>
</request>
</test>
- <test name='8' ignore='no'>
+ <test name='12' ignore='no'>
<description>Remove attachment</description>
<request>
<method>POST</method>
@@ -930,7 +930,7 @@
</verify>
</request>
</test>
- <test name='9'>
+ <test name='13'>
<description>Attendee Inbox Item</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>WAITCOUNT 1</method>
@@ -955,7 +955,7 @@
</verify>
</request>
</test>
- <test name='10'>
+ <test name='14'>
<description>Attendee has data</description>
<request user="$userid2:" pswd="$pswd2:" print-response='no'>
<method>GETNEW</method>
@@ -969,7 +969,7 @@
</verify>
</request>
</test>
- <test name='11' ignore='no'>
+ <test name='15' ignore='no'>
<description>Check access to attachment</description>
<request>
<method>GET</method>
@@ -978,7 +978,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -986,10 +986,10 @@
<method>GET</method>
<ruri>$attach2:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-recurrence.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-recurrence.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-recurrence.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -275,13 +275,17 @@
<value>Cal-Managed-ID$$managed-id:</value>
</arg>
</verify>
+ <grabheader>
+ <name>Location</name>
+ <variable>$location2:</variable>
+ </grabheader>
</request>
</test>
<test name='5' ignore='no'>
<description>Check for attachment</description>
<request>
<method>GET</method>
- <ruri>$location:</ruri>
+ <ruri>$location2:</ruri>
<verify>
<callback>dataMatch</callback>
<arg>
@@ -310,11 +314,25 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
</test>
+ <test name='8' ignore='no'>
+ <description>Check for attachment</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location2:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<end/>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments-sharing.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -260,7 +260,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -271,10 +271,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -282,10 +282,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -296,10 +296,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -526,7 +526,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -537,10 +537,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -548,10 +548,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -562,10 +562,10 @@
<method>GET</method>
<ruri>$location:</ruri>
<verify>
- <callback>prepostcondition</callback>
+ <callback>statusCode</callback>
<arg>
- <name>error</name>
- <value>{DAV:}need-privileges</value>
+ <name>status</name>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -1106,7 +1106,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml 2013-01-15 15:00:32 UTC (rev 10303)
@@ -282,7 +282,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -498,7 +498,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -639,7 +639,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -789,7 +789,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -813,7 +813,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -1026,7 +1026,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -1189,13 +1189,17 @@
<value>Cal-Managed-ID$$managed-id:</value>
</arg>
</verify>
+ <grabheader>
+ <name>Location</name>
+ <variable>$location2:</variable>
+ </grabheader>
</request>
</test>
<test name='5' ignore='no'>
<description>Check for attachment</description>
<request>
<method>GET</method>
- <ruri>$location:</ruri>
+ <ruri>$location2:</ruri>
<verify>
<callback>dataMatch</callback>
<arg>
@@ -1224,11 +1228,25 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
</test>
+ <test name='8' ignore='no'>
+ <description>Check for attachment</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location2:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='Simple non-recurring, non-scheduled update attachment invalid'>
@@ -1441,7 +1459,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -1692,7 +1710,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -1944,13 +1962,17 @@
<value>;MANAGED-ID=$managed_id1:</value>
</arg>
</verify>
+ <grabheader>
+ <name>Location</name>
+ <variable>$location2:</variable>
+ </grabheader>
</request>
</test>
<test name='7' ignore='no'>
<description>Check for attachment</description>
<request>
<method>GET</method>
- <ruri>$attach1:</ruri>
+ <ruri>$location2:</ruri>
<verify>
<callback>dataMatch</callback>
<arg>
@@ -2017,11 +2039,25 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
</test>
+ <test name='13' ignore='no'>
+ <description>Check for attachment</description>
+ <request>
+ <method>GET</method>
+ <ruri>$location2:</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>403</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='Simple non-recurring, non-scheduled add attachment on update - invalid managed-id'>
@@ -2317,7 +2353,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -2379,7 +2415,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
@@ -2563,7 +2599,7 @@
<callback>statusCode</callback>
<arg>
<name>status</name>
- <value>404</value>
+ <value>403</value>
</arg>
</verify>
</request>
Modified: CalDAVTester/trunk/src/caldavtest.py
===================================================================
--- CalDAVTester/trunk/src/caldavtest.py 2013-01-15 00:00:30 UTC (rev 10302)
+++ CalDAVTester/trunk/src/caldavtest.py 2013-01-15 15:00:32 UTC (rev 10303)
@@ -342,21 +342,24 @@
else:
status = False
- # Get properties for this propstat
- prop = props.findall("{DAV:}prop")
- for el in prop:
-
+ if status:
# Get properties for this propstat
- glm = el.findall("{DAV:}getlastmodified")
- if len(glm) != 1:
- continue
- value = glm[0].text
- value = rfc822.parsedate(value)
- value = time.mktime(value)
- if value > latest:
- hresult = href
- latest = value
+ prop = props.findall("{DAV:}prop")
+ for el in prop:
+ # Get properties for this propstat
+ glm = el.findall("{DAV:}getlastmodified")
+ if len(glm) != 1:
+ continue
+ value = glm[0].text
+ value = rfc822.parsedate(value)
+ value = time.mktime(value)
+ if value > latest:
+ hresult = href
+ latest = value
+ elif not hresult:
+ hresult = href
+
return hresult
@@ -491,6 +494,14 @@
req.method = "GET"
req.ruri = "$"
+ # Special for FINDNEW
+ elif req.method == "FINDNEW":
+ collection = (req.ruri, req.user, req.pswd)
+ self.grabbedlocation = self.dofindnew(collection, label=label)
+ if req.graburi:
+ self.manager.server_info.addextrasubs({req.graburi: self.grabbedlocation})
+ return True, "", None, None
+
# Special check for WAITCOUNT
elif req.method.startswith("WAITCOUNT"):
count = int(req.method[10:])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130115/cfba1b5a/attachment-0001.html>
More information about the calendarserver-changes
mailing list