Test Free/Busy results for MONTHLY with BYMONTHDAY

Tests https://gitlab.com/davical-project/davical/-/issues/248
This commit is contained in:
Andrew Ruthven 2022-12-15 09:49:49 +13:00 committed by Andrew Ruthven
parent 64f47fd9e6
commit 7d0e2f2435
6 changed files with 191 additions and 0 deletions

View File

@ -0,0 +1,64 @@
HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "fa916ab734379e479662d1824da4c543"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"
CalDAV Data: >BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//davical.org//NONSGML AWL Calendar//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:19900318T030000
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
TZNAME:NZST
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
TZOFFSETTO:+1300
DTSTART:19901007T020000
RRULE:FREQ=YEARLY;UNTIL=20060930T140000Z;BYMONTH=10;BYDAY=1SU
TZNAME:NZDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:RFC5545-Compliance-MONTHLY
DTSTAMP:20210918T123000
SUMMARY:I repeat monthly on the 31st
CREATED:20210918T123000
DTSTART;TZID=Pacific/Auckland:20220131T070000
DTEND;TZID=Pacific/Auckland:20220131T080000
RRULE:FREQ=MONTHLY;BYMONTHDAY=31;COUNT=12
END:VEVENT
END:VCALENDAR
<
caldav_type: >VEVENT<
class: >PUBLIC<
dav_etag: >fa916ab734379e479662d1824da4c543<
description: >NULL<
dtend: >2022-01-31 08:00:00<
dtstamp: >2021-09-18 12:30:00<
dtstart: >2022-01-31 07:00:00<
due: >NULL<
last_modified: >2021-09-18 12:30:00<
location: >NULL<
logged_user: >13<
percent_complete: >NULL<
priority: >NULL<
rrule: >FREQ=MONTHLY;BYMONTHDAY=31;COUNT=12<
status: >NULL<
summary: >I repeat monthly on the 31st<
transp: >NULL<
tz_id: >Pacific/Auckland<
uid: >RFC5545-Compliance-MONTHLY<
url: >NULL<
user_no: >13<
~Duration: >01:00:00<

View File

@ -0,0 +1,58 @@
#
# Create an event that repeats monthly on the 31st.
#
TYPE=PUT
URL=http://regression.host/caldav.php/user4/home/RFC5545-Compliance-MONTHLY.ics
HEADER=Content-Type: text/calendar
AUTH=user4:user4
HEAD
BEGINDATA
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//davical.org//NONSGML AWL Calendar//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:19900318T030000
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
TZNAME:NZST
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
TZOFFSETTO:+1300
DTSTART:19901007T020000
RRULE:FREQ=YEARLY;UNTIL=20060930T140000Z;BYMONTH=10;BYDAY=1SU
TZNAME:NZDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:RFC5545-Compliance-MONTHLY
DTSTAMP:20210918T123000
SUMMARY:I repeat monthly on the 31st
CREATED:20210918T123000
DTSTART;TZID=Pacific/Auckland:20220131T070000
DTEND;TZID=Pacific/Auckland:20220131T080000
RRULE:FREQ=MONTHLY;BYMONTHDAY=31;COUNT=12
END:VEVENT
END:VCALENDAR
ENDDATA
QUERY
SELECT caldav_data.user_no, caldav_data.dav_etag, caldav_type, logged_user,
uid, dtstamp, dtstart at time zone olson_name as dtstart,
dtend at time zone olson_name as dtend, due, summary, location,
description, priority, class, transp, rrule, url,
percent_complete, tz_id, status,
caldav_data AS " CalDAV Data", calendar_item.last_modified,
dtend - dtstart AS "~Duration"
FROM caldav_data LEFT JOIN calendar_item USING(dav_name) LEFT JOIN timezones ON (tz_id=tzid)
WHERE caldav_data.dav_name =
'/user4/home/RFC5545-Compliance-MONTHLY.ics';
ENDQUERY

View File

@ -0,0 +1,24 @@
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
Content-Length: 530
Content-Type: text/calendar;charset=UTF-8
BEGIN:VCALENDAR
PRODID:-//davical.org//NONSGML AWL Calendar//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VFREEBUSY
DTSTAMP:yyyymmddThhmmssZ
DTSTART:20220101T000000Z
DTEND:20230110T000000Z
FREEBUSY:20220130T180000Z/20220130T190000Z
FREEBUSY:20220330T180000Z/20220330T190000Z
FREEBUSY:20220530T190000Z/20220530T200000Z
FREEBUSY:20220730T190000Z/20220730T200000Z
FREEBUSY:20220830T190000Z/20220830T200000Z
FREEBUSY:20221030T180000Z/20221030T190000Z
FREEBUSY:20221230T180000Z/20221230T190000Z
END:VFREEBUSY
END:VCALENDAR

View File

@ -0,0 +1,17 @@
#
# Fetch the recurring events for the year.
TYPE=REPORT
URL=http://regression.host/caldav.php/user4/home/
HEADER=Content-Type: text/xml; charset="UTF-8"
AUTH=user4:user4
HEAD
BEGINDATA
<?xml version='1.0' encoding='utf-8' ?>
<C:free-busy-query xmlns:C='urn:ietf:params:xml:ns:caldav'>
<C:time-range start='20220101T000000Z' end='20230110T000000Z'/>
</C:free-busy-query>
ENDDATA
REPLACE=/^DTSTAMP:\d{8}T\d{6}Z\r?$/DTSTAMP:yyyymmddThhmmssZ/

View File

@ -0,0 +1,6 @@
HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy

View File

@ -0,0 +1,22 @@
#
# Remove the event that repeats monthly on the 31st.
#
TYPE=DELETE
URL=http://regression.host/caldav.php/user4/home/RFC5545-Compliance-MONTHLY.ics
HEADER=Content-Type: text/calendar
AUTH=user4:user4
HEAD
QUERY
SELECT caldav_data.user_no, caldav_data.dav_etag, caldav_type, logged_user,
uid, dtstamp, dtstart at time zone olson_name as dtstart,
dtend at time zone olson_name as dtend, due, summary, location,
description, priority, class, transp, rrule, url,
percent_complete, tz_id, status,
caldav_data AS " CalDAV Data", calendar_item.last_modified,
dtend - dtstart AS "~Duration"
FROM caldav_data LEFT JOIN calendar_item USING(dav_name) LEFT JOIN timezones ON (tz_id=tzid)
WHERE caldav_data.dav_name =
'/user4/home/RFC5545-Compliance-MONTHLY.ics';
ENDQUERY