<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12189] CalDAVTester/trunk/scripts/tests-pod/CalDAV/sharing-managed-attachments.xml</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12189">12189</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2013-12-23 08:36:11 -0800 (Mon, 23 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Checkpoint: cross-pod managed attachments.</pre>
<h3>Added Paths</h3>
<ul>
<li><a href="#CalDAVTestertrunkscriptstestspodCalDAVsharingmanagedattachmentsxml">CalDAVTester/trunk/scripts/tests-pod/CalDAV/sharing-managed-attachments.xml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalDAVTestertrunkscriptstestspodCalDAVsharingmanagedattachmentsxml"></a>
<div class="addfile"><h4>Added: CalDAVTester/trunk/scripts/tests-pod/CalDAV/sharing-managed-attachments.xml (0 => 12189)</h4>
<pre class="diff"><span>
<span class="info">--- CalDAVTester/trunk/scripts/tests-pod/CalDAV/sharing-managed-attachments.xml         (rev 0)
+++ CalDAVTester/trunk/scripts/tests-pod/CalDAV/sharing-managed-attachments.xml        2013-12-23 16:36:11 UTC (rev 12189)
</span><span class="lines">@@ -0,0 +1,1723 @@
</span><ins>+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2012-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 with shared calendars</description>
+
+        <require-feature>
+                <feature>caldav</feature>
+                <feature>managed-attachments</feature>
+                <feature>prefer-representation</feature>
+                <feature>shared-calendars</feature>
+        </require-feature>
+
+        <start>
+                <request end-delete="yes">
+                        <method>MKCALENDAR</method>
+                        <ruri>$calendarhome1:/shared/</ruri>
+                </request>
+                <request>
+                        <method>POST</method>
+                        <ruri>$calendarhome1:/shared/</ruri>
+                        <data>
+                                <content-type>text/xml; charset=utf-8</content-type>
+                                <filepath>Resource/Common/POST/sharinginvite23-pod.xml</filepath>
+                        </data>
+                        <verify>
+                                <callback>statusCode</callback>
+                        </verify>
+                </request>
+                <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                        <method>WAITCOUNT 1</method>
+                        <ruri>$pnotificationpath2:/</ruri>
+                </request>
+                <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                        <method>GETNEW</method>
+                        <ruri>$pnotificationpath2:/</ruri>
+                        <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>
+                <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                        <method>POST</method>
+                        <ruri>$pcalendarhome2:/</ruri>
+                        <data substitutions='yes'>
+                                <content-type>application/xml; charset=utf-8</content-type>
+                                <filepath>Resource/Common/POST/sharingreply2-pod.xml</filepath>
+                        </data>
+                        <grabelement>
+                                <name>{DAV:}href</name>
+                                <variable>$sharedcalendar2:</variable>
+                        </grabelement>
+                </request>
+                <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                        <method>WAITCOUNT 1</method>
+                        <ruri>$pnotificationpath3:/</ruri>
+                </request>
+                <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                        <method>GETNEW</method>
+                        <ruri>$pnotificationpath3:/</ruri>
+                        <grabelement>
+                                <name>{http://calendarserver.org/ns/}invite-notification/{http://calendarserver.org/ns/}uid</name>
+                                <variable>$inviteuid3:</variable>
+                        </grabelement>
+                        <grabelement>
+                                <name>{http://calendarserver.org/ns/}invite-notification/{http://calendarserver.org/ns/}hosturl/{DAV:}href</name>
+                                <variable>$hosturl3:</variable>
+                        </grabelement>
+                </request>
+                <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                        <method>POST</method>
+                        <ruri>$pcalendarhome3:/</ruri>
+                        <data substitutions='yes'>
+                                <content-type>application/xml; charset=utf-8</content-type>
+                                <filepath>Resource/Common/POST/sharingreply3-pod.xml</filepath>
+                        </data>
+                        <grabelement>
+                                <name>{DAV:}href</name>
+                                <variable>$sharedcalendar3:</variable>
+                        </grabelement>
+                </request>
+        </start>
+        
+        <test-suite name='Sharer add attachment'>
+                <test name='1'>
+                        <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='2'>
+                        <description>Sharer add attachment</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/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='3'>
+                        <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='4'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='5'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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='6'>
+                        <description>Remove attachment</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/1.ics?action=attachment-remove&amp;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='7'>
+                        <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='8'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='9'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='10'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarhome1:/shared/1.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+        </test-suite>
+
+        <test-suite name='Sharee add attachment'>
+                <test name='1'>
+                        <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='2'>
+                        <description>Read-only sharee cannot add attachment</description>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='3'>
+                        <description>Sharee can add attachment</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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='4'>
+                        <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='5'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='6'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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='7'>
+                        <description>Read-only sharee cannot remove attachment</description>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>POST</method>
+                                <ruri>$sharedcalendar3:/1.ics?action=attachment-remove&amp;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='8'>
+                        <description>Sharee remove attachment</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>POST</method>
+                                <ruri>$sharedcalendar2:/1.ics?action=attachment-remove&amp;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='9'>
+                        <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='10'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='11'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='12'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarhome1:/shared/1.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+        </test-suite>
+
+        <test-suite name='Sharee add attachment existing managed-id'>
+                <test name='1'>
+                        <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='2'>
+                        <description>Sharer add attachment</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/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>$location1:</variable>
+                                </grabheader>
+                                <grabcalproperty>
+                                        <name>VEVENT/ATTACH</name>
+                                        <variable>$attach1:</variable>
+                                </grabcalproperty>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/MANAGED-ID</name>
+                                        <variable>$managed_id1:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/FILENAME</name>
+                                        <variable>$filename1:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/FMTTYPE</name>
+                                        <variable>$fmttype1:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/SIZE</name>
+                                        <variable>$size1:</variable>
+                                </grabcalparameter>
+                        </request>
+                </test>
+                <test name='3'>
+                        <description>Check for attachment - sharer</description>
+                        <request>
+                                <method>GET</method>
+                                <ruri>$attach1:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='4'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$attach1:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>GET</method>
+                                <ruri>$attach1:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='5'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <method>GET</method>
+                                <ruri>$attach1:</ruri>
+                                <verify>
+                                        <callback>prepostcondition</callback>
+                                        <arg>
+                                                <name>error</name>
+                                                <value>{DAV:}need-privileges</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='6'>
+                        <description>PUT another event</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:" end-delete='no'>
+                                <method>PUT</method>
+                                <ruri>$sharedcalendar2:/2.ics</ruri>
+                                <header>
+                                        <name>Prefer</name>
+                                        <value>return=representation</value>
+                                </header>
+                                <data>
+                                        <content-type>text/calendar; charset=utf-8</content-type>
+                                        <filepath>Resource/CalDAV/managedattachments/sharing/3.ics</filepath>
+                                </data>
+                                <verify>
+                                        <callback>calendarDataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/sharing/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>;MANAGED-ID=$managed_id1:</value>
+                                        </arg>
+                                </verify>
+                                <grabheader>
+                                        <name>ETag</name>
+                                        <variable>$etag2:</variable>
+                                </grabheader>
+                                <grabcalproperty>
+                                        <name>VEVENT/ATTACH</name>
+                                        <variable>$attach2:</variable>
+                                </grabcalproperty>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/MANAGED-ID</name>
+                                        <variable>$managed_id2:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/FILENAME</name>
+                                        <variable>$filename2:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/FMTTYPE</name>
+                                        <variable>$fmttype2:</variable>
+                                </grabcalparameter>
+                                <grabcalparameter>
+                                        <name>VEVENT/ATTACH/SIZE</name>
+                                        <variable>$size2:</variable>
+                                </grabcalparameter>
+                        </request>
+                </test>
+                <test name='7'>
+                        <description>Check for attachment - sharer</description>
+                        <request>
+                                <method>GET</method>
+                                <ruri>$attach2:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='8'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$attach2:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>GET</method>
+                                <ruri>$attach2:</ruri>
+                                <verify>
+                                        <callback>dataMatch</callback>
+                                        <arg>
+                                                <name>filepath</name>
+                                                <value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='9'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <method>GET</method>
+                                <ruri>$attach2:</ruri>
+                                <verify>
+                                        <callback>prepostcondition</callback>
+                                        <arg>
+                                                <name>error</name>
+                                                <value>{DAV:}need-privileges</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='10'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarhome1:/shared/1.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+                <test name='11'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarhome1:/shared/2.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+        </test-suite>
+
+        <test-suite name='No access after move'>
+                <test name='1'>
+                        <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='2'>
+                        <description>Sharer add attachment</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/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='3'>
+                        <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='4'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='5'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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='6'>
+                        <description>Move</description>
+                        <request>
+                                <method>MOVE</method>
+                                <ruri>$calendarhome1:/shared/1.ics</ruri>
+                                <header>
+                                        <name>Destination</name>
+                                        <value>$host:$calendarpath1:/move1.ics</value>
+                                </header>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+                <test name='7'>
+                        <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'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>prepostcondition</callback>
+                                        <arg>
+                                                <name>error</name>
+                                                <value>{DAV:}need-privileges</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='9'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarpath1:/move1.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+                <test name='11'>
+                        <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-suite>
+
+        <test-suite name='No access after unshare'>
+                <test name='1'>
+                        <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='2'>
+                        <description>Sharer add attachment</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/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='3'>
+                        <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='4'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='5'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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='6'>
+                        <description>Unshare</description>
+                        <request>
+                                <method>POST</method>
+                                <ruri>$calendarhome1:/shared/</ruri>
+                                <data>
+                                        <content-type>text/xml; charset=utf-8</content-type>
+                                        <filepath>Resource/Common/POST/sharingremove23-pod.xml</filepath>
+                                </data>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+                <test name='7'>
+                        <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'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>prepostcondition</callback>
+                                        <arg>
+                                                <name>error</name>
+                                                <value>{DAV:}need-privileges</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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='9'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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'>
+                        <description>Delete calendar data</description>
+                        <request>
+                                <method>DELETE</method>
+                                <ruri>$calendarhome1:/shared/1.ics</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                </test>
+        </test-suite>
+
+        <test-suite name='Direct share'>
+                <test name='1'>
+                        <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-pod/sharing/managedattachments/1.xml</filepath>
+                                </data>
+                                <verify>
+                                        <callback>propfindItems</callback>
+                                        <arg>
+                                                <name>okprops</name>
+                                                <value>{DAV:}group-member-set</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='2'>
+                        <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-pod/sharing/managedattachments/2.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 host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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'>
+                        <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'>
+                        <description>Read-only sharee cannot add attachment</description>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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'>
+                        <description>Sharee can add attachment</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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'>
+                        <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'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <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 host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <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'>
+                        <description>Read-only sharee cannot remove attachment</description>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>POST</method>
+                                <ruri>$sharedcalendar3:/1.ics?action=attachment-remove&amp;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'>
+                        <description>Sharee remove attachment</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>POST</method>
+                                <ruri>$sharedcalendar2:/1.ics?action=attachment-remove&amp;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'>
+                        <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'>
+                        <description>Check for attachment - sharees</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='14'>
+                        <description>Check for attachment - non sharee</description>
+                        <request user="$puserid4:" pswd="$ppswd4:">
+                                <method>GET</method>
+                                <ruri>$location:</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                        <arg>
+                                                <name>status</name>
+                                                <value>403</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='15'>
+                        <description>Delete calendar data</description>
+                        <request host2="yes" user="$puserid2:" pswd="$ppswd2:">
+                                <method>DELETE</method>
+                                <ruri>$sharedcalendar2:/</ruri>
+                                <verify>
+                                        <callback>statusCode</callback>
+                                </verify>
+                        </request>
+                        <request host2="yes" user="$puserid3:" pswd="$ppswd3:">
+                                <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'>
+                        <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-pod/sharing/managedattachments/3.xml</filepath>
+                                </data>
+                                <verify>
+                                        <callback>propfindItems</callback>
+                                        <arg>
+                                                <name>okprops</name>
+                                                <value>{DAV:}group-member-set</value>
+                                        </arg>
+                                </verify>
+                        </request>
+                </test>
+                <test name='17'>
+                        <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-pod/sharing/managedattachments/3.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>
+                        <ruri>$notificationpath1:/</ruri>
+                </request>
+                <request host2="yes" user="$useradmin:" pswd="$pswdadmin:">
+                        <method>DELETEALL</method>
+                        <ruri>$pnotificationpath2:/</ruri>
+                        <ruri>$pnotificationpath3:/</ruri>
+                </request>
+        </end>
+
+</caldavtest>
</ins></span></pre>
</div>
</div>
</body>
</html>