[CalendarServer-changes] [14535] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 9 14:22:31 PDT 2015


Revision: 14535
          http://trac.calendarserver.org//changeset/14535
Author:   cdaboo at apple.com
Date:     2015-03-09 14:22:31 -0700 (Mon, 09 Mar 2015)
Log Message:
-----------
Test that MKCALENDAR after delete of shared calendar fails properly. Whitespace fix.

Modified Paths:
--------------
    CalDAVTester/trunk/cdtdiagnose.py

Added Paths:
-----------
    CalDAVTester/trunk/scripts/tests/CalDAV/sharing-errors.xml

Modified: CalDAVTester/trunk/cdtdiagnose.py
===================================================================
--- CalDAVTester/trunk/cdtdiagnose.py	2015-03-09 20:57:54 UTC (rev 14534)
+++ CalDAVTester/trunk/cdtdiagnose.py	2015-03-09 21:22:31 UTC (rev 14535)
@@ -49,8 +49,10 @@
     parser = argparse.ArgumentParser(
         description='Gather CalDAVTester diagnostics.',
     )
-    parser.add_argument('-d', '--directory', action='store',
-              help='Destination directory for diagnostics archive')
+    parser.add_argument(
+        '-d', '--directory', action='store',
+        help='Destination directory for diagnostics archive'
+    )
     args = parser.parse_args()
 
     print "Running CDT diagnostics due to test failure."

Added: CalDAVTester/trunk/scripts/tests/CalDAV/sharing-errors.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/sharing-errors.xml	                        (rev 0)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/sharing-errors.xml	2015-03-09 21:22:31 UTC (rev 14535)
@@ -0,0 +1,190 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006-2015 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 calendar sharing under various error conditions</description>
+
+	<require-feature>
+		<feature>caldav</feature>
+		<feature>shared-calendars</feature>
+	</require-feature>
+
+	<start>
+		<request user="$userid1:" pswd="$pswd1:">
+			<method>DELETEALL</method>
+			<ruri>$notificationpath1:/</ruri>
+		</request>
+		<request user="$userid2:" pswd="$pswd2:">
+			<method>DELETEALL</method>
+			<ruri>$notificationpath2:/</ruri>
+		</request>
+		<request end-delete="yes">
+			<method>MKCALENDAR</method>
+			<ruri>$calendarhome1:/shared/</ruri>
+			<verify>
+				<callback>statusCode</callback>
+			</verify>
+		</request>
+	</start>
+	
+	<test-suite name='MKCALENDAR after share delete'>
+		<test name='1'>
+			<description>POST invitation</description>
+			<request>
+				<method>POST</method>
+				<ruri>$calendarhome1:/shared/</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='2'>
+			<description>Check Sharee notification collection</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>WAITCOUNT 1</method>
+				<ruri>$notificationpath2:/</ruri>
+			</request>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>GETNEW</method>
+				<ruri>$notificationpath2:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</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='3'>
+			<description>Sharee replies ACCEPTED</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>POST</method>
+				<ruri>$calendarhome2:/</ruri>
+				<data>
+					<content-type>application/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/POST/sharingreply2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<grabelement>
+					<name>{DAV:}href</name>
+					<variable>$sharedcalendar2:</variable>
+				</grabelement>
+			</request>
+		</test>
+		<test name='4'>
+			<description>Sharee deletes shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>DELETE</method>
+				<ruri>$sharedcalendar2:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>infinity</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>No more shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>PROPFIND</method>
+				<ruri>$sharedcalendar2:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>0</value>
+				</header>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/PROPFIND/resourcetype.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>404</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Sharee tried to re-create shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>MKCALENDAR</method>
+				<ruri>$sharedcalendar2:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>infinity</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='7'>
+			<description>No more shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>PROPFIND</method>
+				<ruri>$sharedcalendar2:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>0</value>
+				</header>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/PROPFIND/resourcetype.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>$notificationpath1:/</ruri>
+			<ruri>$notificationpath2:/</ruri>
+			<ruri>$notificationpath3:/</ruri>
+			<ruri>$notificationpath4:/</ruri>
+		</request>
+	</end>
+
+</caldavtest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150309/a1d63c45/attachment.html>


More information about the calendarserver-changes mailing list