Merge pull request #21778 from owncloud/share-calendars

More tests for CalDAV
This commit is contained in:
Thomas Müller 2016-01-21 12:31:26 +01:00
commit 2540ac431c
22 changed files with 339 additions and 204 deletions

View File

@ -9,8 +9,11 @@ sleep 30
# run the tests
cd "$SCRIPTPATH/CalDAVTester"
PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/../caldavtest/serverinfo.xml" -o cdt.txt \
"$SCRIPTPATH/../caldavtest/tests/CalDAV/current-user-principal.xml"
PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail --basedir "$SCRIPTPATH/../caldavtest/" -o cdt.txt \
"CalDAV/current-user-principal.xml" \
"CalDAV/sync-report.xml"
RESULT=$?
tail "$/../../../../../data-autotest/owncloud.log"

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:current-user-principal/>
</D:prop>
</D:propfind>

View File

@ -0,0 +1,32 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T205953Z
CREATED:20060101T150000Z
DTSTART;TZID=US/Eastern:$now.year.1:0101T100000
DURATION:PT1H
SUMMARY:event 1
UID:54E181BC7CCC373042B28842@ninevah.local
CATEGORIES:cool
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:mkcol xmlns:D="DAV:"
xmlns:E="urn:ietf:params:xml:ns:caldav">
<D:set>
<D:prop>
<D:resourcetype>
<D:collection/>
<E:calendar/>
</D:resourcetype>
<D:displayname>Special Resource</D:displayname>
</D:prop>
</D:set>
</D:mkcol>

View File

@ -0,0 +1,33 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Mountain
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:MDT
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:MST
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T210052Z
CREATED:20060101T160000Z
DTSTART;TZID=US/Mountain:$now.year.1:0101T110000
DURATION:PT1H
SUMMARY:event 2
DESCRIPTION:Some notes
UID:9A6519F71822CD45840C3440@ninevah.local
CATEGORIES:cool,hot
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,34 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Pacific
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T210146Z
CREATED:20060101T210000Z
DTSTART;TZID=US/Pacific:$now.year.1:0101T130000
DURATION:PT1H
LAST-MODIFIED:20051222T210203Z
SEQUENCE:1
SUMMARY:event 3
UID:DB3F97EF10A051730E2F752E@ninevah.local
CATEGORIES:hot
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,39 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T210310Z
CREATED:20060101T230000Z
DTSTART;TZID=US/Eastern:$now.year.1:0101T180000
DURATION:PT1H
SUMMARY:event 4
UID:A3217B429B4D2FF2DC2EEE66@ninevah.local
CATEGORIES:cool
CATEGORIES:hot
BEGIN:VALARM
ACTION:AUDIO
TRIGGER;RELATED=START:-PT1H
REPEAT:5
DURATION:PT10M
END:VALARM
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,38 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T210412Z
CREATED:20060102T150000Z
DTSTART;TZID=US/Eastern:$now.year.1:0102T100000
DURATION:PT1H
RRULE:FREQ=DAILY;COUNT=5
SUMMARY:event 5
UID:945113826375CBB89184DC36@ninevah.local
CATEGORIES:cool,hot
CATEGORIES:warm
BEGIN:VALARM
ACTION:AUDIO
TRIGGER;RELATED=START:-PT10M
END:VALARM
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,48 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Example Inc.//Example Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
LAST-MODIFIED:20040110T032845Z
TZID:US/Eastern
BEGIN:DAYLIGHT
DTSTART:20000404T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20001026T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20051222T210507Z
CREATED:20060102T190000Z
DTSTART;TZID=US/Eastern:$now.year.1:0102T140000
DURATION:PT1H
RRULE:FREQ=DAILY;COUNT=5
SUMMARY:event 6
UID:F5B811E00073B22BA6B87551@ninevah.local
CATEGORIES:warm,hot
CATEGORIES:cool
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20051222T210507Z
UID:F5B811E00073B22BA6B87551@ninevah.local
RECURRENCE-ID;TZID=US/Eastern:$now.year.1:0104T140000
CREATED:20060102T190000Z
DTSTART;TZID=US/Eastern:$now.year.1:0104T160000
DURATION:PT1H
SUMMARY:event 6 changed
DESCRIPTION:Some notes
BEGIN:VALARM
ACTION:AUDIO
TRIGGER;RELATED=START:-PT10M
END:VALARM
END:VEVENT
END:VCALENDAR

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:supported-report-set/>
<D:sync-token/>
</D:prop>
</D:propfind>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token/>
<D:sync-level>bogus</D:sync-level>
<D:prop/>
</D:sync-collection>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>null</D:sync-token>
<D:prop>
<D:getetag/>
</D:prop>
</D:sync-collection>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token/>
<D:prop/>
</D:sync-collection>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token/>
<D:sync-level>0</D:sync-level>
<D:limit><D:nresults>10</D:nresults></D:limit>
<D:prop/>
</D:sync-collection>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>$synctoken1:</D:sync-token>
<D:prop/>
</D:sync-collection>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>$synctoken2:</D:sync-token>
<D:prop/>
</D:sync-collection>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token/>
<D:prop>
<D:getcontenttype/>
<D:getetag/>
</D:prop>
</D:sync-collection>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>$synctoken1:</D:sync-token>
<D:prop>
<D:getcontenttype/>
<D:getetag/>
</D:prop>
</D:sync-collection>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>$synctoken2:</D:sync-token>
<D:prop>
<D:getcontenttype/>
<D:getetag/>
</D:prop>
</D:sync-collection>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token/>
<D:sync-level>1</D:sync-level>
<D:prop/>
</D:sync-collection>

View File

@ -64,7 +64,7 @@
<feature>resource-id</feature> <!-- WebDAV BIND DAV:resource-id property -->
<feature>sync-report</feature> <!-- WebDAV collection sync REPORT -->
<!-- <feature>sync-report-limit</feature> --> <!-- WebDAV collection sync REPORT DAV:limit support -->
<feature>sync-report-home</feature> <!-- WebDAV collection sync REPORT on Homes -->
<!--<feature>sync-report-home</feature> &lt;!&ndash; WebDAV collection sync REPORT on Homes &ndash;&gt;-->
<feature>sync-report-config-token</feature> <!-- Sync REPORT token includes configuration component -->
<feature>well-known</feature> <!-- well-known feature -->
@ -180,7 +180,7 @@
<!-- relative path to main principal collection-->
<substitution>
<key>$principalcollection:</key>
<value>$root:principals/users/</value>
<value>$root:principals/</value>
</substitution>
<!-- the core recored type collections-->
@ -482,7 +482,7 @@
</substitution>
<substitution>
<key>$principaluri%d:</key>
<value>$principalcollection:$userid%d:/</value>
<value>$principals_users:$userid%d:/</value>
</substitution>
<substitution>
<key>$principal%dnoslash:</key>
@ -492,7 +492,7 @@
<!-- relative path to user calendar home-->
<substitution>
<key>$calendarhome%d:</key>
<value>$calendars_uids:$userguid%d:</value>
<value>$calendars:$userid%d:</value>
</substitution>
<!-- relative path to user alternate calendar home-->
<substitution>

View File

@ -26,8 +26,12 @@
<start>
<request end-delete="yes">
<method>MKCALENDAR</method>
<method>MKCOL</method>
<ruri>$calendarhome1:/synccalendar1/</ruri>
<data>
<content-type>application/xml; charset="utf-8"</content-type>
<filepath>Resource/CalDAV/reports/put/1.xml</filepath>
</data>
</request>
<request>
<method>PUT</method>
@ -46,8 +50,12 @@
</data>
</request>
<request end-delete="yes">
<method>MKCALENDAR</method>
<method>MKCOL</method>
<ruri>$calendarhome1:/synccalendar2/</ruri>
<data>
<content-type>application/xml; charset="utf-8"</content-type>
<filepath>Resource/CalDAV/reports/put/1.xml</filepath>
</data>
</request>
<request>
<method>PUT</method>
@ -101,67 +109,6 @@
</verify>
</request>
</test>
<test name='2'>
<description>On calendar-home</description>
<request>
<method>PROPFIND</method>
<ruri>$calendarhome1:/</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
</data>
<verify>
<require-feature>
<feature>sync-report-home</feature>
</require-feature>
<callback>xmlElementMatch</callback>
<arg>
<name>exists</name>
<value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
<value>$verify-property-prefix:/{DAV:}sync-token[+data:,]</value>
</arg>
</verify>
<verify>
<require-feature>
<feature>sync-report-home</feature>
</require-feature>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value>{DAV:}supported-report-set</value>
<value>{DAV:}sync-token</value>
</arg>
</verify>
<verify>
<exclude-feature>
<feature>sync-report-home</feature>
</exclude-feature>
<callback>xmlElementMatch</callback>
<arg>
<name>notexists</name>
<value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
</arg>
</verify>
<verify>
<exclude-feature>
<feature>sync-report-home</feature>
</exclude-feature>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value>{DAV:}supported-report-set</value>
</arg>
<arg>
<name>badprops</name>
<value>{DAV:}sync-token</value>
</arg>
</verify>
</request>
</test>
<test name='3'>
<description>On calendar</description>
<request>
@ -180,7 +127,7 @@
<arg>
<name>exists</name>
<value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
<value>$verify-property-prefix:/{DAV:}sync-token[+data:,]</value>
<!--<value>$verify-property-prefix:/{DAV:}sync-token[+data:,]</value>-->
</arg>
</verify>
<verify>
@ -193,53 +140,6 @@
</verify>
</request>
</test>
<test name='4'>
<description>On inbox</description>
<request>
<method>PROPFIND</method>
<ruri>$inboxpath1:/</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
</data>
<verify>
<callback>xmlElementMatch</callback>
<arg>
<name>exists</name>
<value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
</arg>
</verify>
<verify>
<callback>propfindItems</callback>
<arg>
<name>okprops</name>
<value>{DAV:}supported-report-set</value>
<value>{DAV:}sync-token</value>
</arg>
</verify>
</request>
</test>
<test name='5'>
<require-feature>
<feature>sync-report-home</feature>
</require-feature>
<description>Look for options header tag on principal</description>
<request>
<method>OPTIONS</method>
<ruri>$principal1:</ruri>
<verify>
<callback>header</callback>
<arg>
<name>header</name>
<value>*DAV$.*calendarserver-home-sync[^-]*</value>
</arg>
</verify>
</request>
</test>
</test-suite>
<test-suite name='simple reports - sync-level'>
@ -458,7 +358,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -600,28 +499,6 @@
</verify>
</request>
</test>
<test name='13'>
<description>Bad sync-level</description>
<request>
<method>REPORT</method>
<ruri>$calendarhome1:/synccalendar1/</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CalDAV/reports/sync/10.xml</filepath>
</data>
<verify>
<callback>statusCode</callback>
<arg>
<name>status</name>
<value>400</value>
</arg>
</verify>
</request>
</test>
</test-suite>
<test-suite name='simple reports - empty token - no props'>
@ -642,7 +519,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -746,7 +622,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
<value>3.ics</value>
@ -848,7 +723,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -952,7 +826,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -1045,7 +918,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -1227,7 +1099,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -1270,7 +1141,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
<value>3.ics</value>
@ -1310,7 +1180,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -1353,7 +1222,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -1388,7 +1256,6 @@
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
<value>1.ics</value>
<value>2.ics</value>
</arg>
@ -2827,31 +2694,6 @@
</test>
</test-suite>
<test-suite name='simple reports - empty inbox'>
<test name='1'>
<description>initial query</description>
<request>
<method>REPORT</method>
<ruri>$inboxpath1:/</ruri>
<header>
<name>Depth</name>
<value>1</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
</data>
<verify>
<callback>multistatusItems</callback>
<arg>
<name>okhrefs</name>
<value>$calendar_sync_extra_items:</value>
</arg>
</verify>
</request>
</test>
</test-suite>
<test-suite name='simple reports - valid token'>
<test name='1'>
<description>initial query</description>
@ -2872,6 +2714,10 @@
<name>error</name>
<value>{DAV:}valid-sync-token</value>
</arg>
<arg>
<name>ignoreextras</name>
<value>{http://sabredav.org/ns}message</value>
</arg>
</verify>
</request>
</test>
@ -3478,35 +3324,6 @@
</test>
</test-suite>
<test-suite name='limited reports'>
<test name='1'>
<exclude-feature>
<feature>sync-report-limit</feature>
</exclude-feature>
<description>Limit not allowed</description>
<request>
<method>REPORT</method>
<ruri>$calendarhome1:/</ruri>
<header>
<name>Depth</name>
<value>0</value>
</header>
<data>
<content-type>text/xml; charset=utf-8</content-type>
<filepath>Resource/CalDAV/reports/sync/21.xml</filepath>
</data>
<verify>
<callback>prepostcondition</callback>
<arg>
<name>error</name>
<value>{DAV:}number-of-matches-within-limits</value>
</arg>
</verify>
</request>
</test>
</test-suite>
<end/>
</caldavtest>