[CalendarServer-changes] [304] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 26 09:02:36 PDT 2006


Revision: 304
          http://trac.macosforge.org/projects/calendarserver/changeset/304
Author:   cdaboo at apple.com
Date:     2006-10-26 09:02:36 -0700 (Thu, 26 Oct 2006)

Log Message:
-----------
Tests for drop box functionaility.

Added Paths:
-----------
    CalDAVTester/trunk/Resource/dropbox/
    CalDAVTester/trunk/Resource/dropbox/1.xml
    CalDAVTester/trunk/Resource/dropbox/2.xml
    CalDAVTester/trunk/Resource/dropbox/3.xml
    CalDAVTester/trunk/scripts/tests/dropbox.xml

Added: CalDAVTester/trunk/Resource/dropbox/1.xml
===================================================================
--- CalDAVTester/trunk/Resource/dropbox/1.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/dropbox/1.xml	2006-10-26 16:02:36 UTC (rev 304)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:" xmlns:T="http://twistedmatrix.com/xml_namespace/dav/">
+<D:prop>
+<T:drop-box-home-URL/>
+<T:notifications-URL/>
+</D:prop>
+</D:propfind>

Added: CalDAVTester/trunk/Resource/dropbox/2.xml
===================================================================
--- CalDAVTester/trunk/Resource/dropbox/2.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/dropbox/2.xml	2006-10-26 16:02:36 UTC (rev 304)
@@ -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/dropbox/3.xml
===================================================================
--- CalDAVTester/trunk/Resource/dropbox/3.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/dropbox/3.xml	2006-10-26 16:02:36 UTC (rev 304)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:acl xmlns:D="DAV:">
+	<D:ace>
+		<D:principal>
+			<D:href>$principal2:</D:href>
+		</D:principal>
+		<D:grant>
+			<D:privilege><D:read/></D:privilege>
+		</D:grant>
+	</D:ace>
+</D:acl>

Added: CalDAVTester/trunk/scripts/tests/dropbox.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/dropbox.xml	                        (rev 0)
+++ CalDAVTester/trunk/scripts/tests/dropbox.xml	2006-10-26 16:02:36 UTC (rev 304)
@@ -0,0 +1,200 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006 Apple Computer, 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.
+
+ DRI: Cyrus Daboo, cdaboo at apple.com
+ -->
+
+<caldavtest>
+	<start/>
+	
+	<test-suite name='Principal properties'>
+		<test name='1'>
+			<description>Look for properties</description>
+			<request>
+				<method>PROPFIND</method>
+				<ruri>$principal:</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/1.xml</filepath>
+				</data>
+				<verify>
+					<callback>propfindItems</callback>
+					<arg>
+						<name>okprops</name>
+						<value>http://twistedmatrix.com/xml_namespace/dav/drop-box-home-URL$&lt;href xmlns="DAV:">$pathprefix:/dropbox/&lt;/href></value>
+						<value>http://twistedmatrix.com/xml_namespace/dav/notifications-URL$&lt;href xmlns="DAV:">$pathprefix:/notifications/&lt;/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>$pathprefix:/dropbox/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>propfindItems</callback>
+					<arg>
+						<name>okprops</name>
+						<value>DAV:resourcetype$&lt;collection/>&lt;dropboxhome xmlns="http://twistedmatrix.com/xml_namespace/dav/"/></value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Look for properties</description>
+			<request>
+				<method>PROPFIND</method>
+				<ruri>$pathprefix:/notifications/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>propfindItems</callback>
+					<arg>
+						<name>okprops</name>
+						<value>DAV:resourcetype$&lt;collection/>&lt;notifications xmlns="http://twistedmatrix.com/xml_namespace/dav/"/></value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+	<test-suite name='Drop Box Collection Create'>
+		<test name='1'>
+			<description>Create drop box</description>
+			<request end-delete='yes'>
+				<method>MKCOL</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>201</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='1'>
+			<description>Look for properties</description>
+			<request>
+				<method>PROPFIND</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>propfindItems</callback>
+					<arg>
+						<name>okprops</name>
+						<value>DAV:resourcetype$&lt;collection/>&lt;dropbox xmlns="http://twistedmatrix.com/xml_namespace/dav/"/></value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+	<test-suite name='Drop Box Collection ACLs'>
+		<test name='1'>
+			<description>Create drop box resource</description>
+			<request>
+				<method>PUT</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/test.xml</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Verify that user01 can read it</description>
+			<request>
+				<method>GET</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='3'>
+			<description>Verify that user03 cannot read it</description>
+			<request user='$userid2:' pswd='$pswd2:'>
+				<method>GET</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='4'>
+			<description>Add user02 read privilege on collection</description>
+			<request>
+				<method>ACL</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/dropbox/3.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Verify that user02 can now read it</description>
+			<request user='$userid2:' pswd='$pswd2:'>
+				<method>GET</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Verify that user03 cannot read it</description>
+			<request user='$userid3:' pswd='$pswd3:'>
+				<method>GET</method>
+				<ruri>$pathprefix:/dropbox/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+	
+	<end/>
+
+</caldavtest>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061026/ea6e26f3/attachment.html


More information about the calendarserver-changes mailing list