davical/testing/tests/regression-suite/0830-Spec-FREEBUSY-1.test
Andrew Ruthven 7c47658bee Make the curl and SQL requests when we see them
This allows us to have more complex test files where an action is taken, then
we test something, then another action is taken, etc.

Changes to test files are required so that URL is defined after all the
required settings are set.

Changes to the result files are either whitespace changes due to above logic
changes, or printing out a SQL Result header before each result. I figured it
was useful.
2024-04-01 22:57:10 +13:00

41 lines
1.5 KiB
Plaintext

#
# Request a REPORT which should report only freebusy
#
TYPE=REPORT
HEADER=User-Agent: CALDAV compliance testing
HEADER=Accept: text/calendar
HEADER=Content-Type: text/xml
HEADER=Depth: 1
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="20061004T140000Z"
end="20070105T220000Z"/>
</C:free-busy-query>
ENDDATA
REPLACE=/^DTSTAMP:\d{8}T\d{6}Z\r?$/DTSTAMP:yyyymmddThhmmssZ/
URL=http://regression.host/caldav.php/user1/home/
QUERY
SELECT calendar_item.rrule, calendar_item.status,
dtstart AT TIME ZONE olson_name AS "a) Start",
olson_name AS "b) Location",
to_char(calendar_item.dtstart at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS "c)UTC Start",
to_char(calendar_item.dtend at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS "d) UTC End"
FROM usr INNER JOIN collection USING (user_no)
INNER JOIN caldav_data USING (collection_id)
INNER JOIN calendar_item USING(dav_id)
LEFT JOIN timezones ON (tz_id=tzid)
WHERE caldav_data.dav_name ~ '^/user1/home/'
AND collection.is_calendar AND collection.schedule_transp = 'opaque'
AND rrule_event_overlaps( dtstart, dtend, rrule, '20061004T140000Z', '20070105T220000Z' )
AND caldav_data.caldav_type IN ( 'VEVENT', 'VFREEBUSY' )
AND (calendar_item.transp != 'TRANSPARENT' OR calendar_item.transp IS NULL)
AND (calendar_item.status != 'CANCELLED' OR calendar_item.status IS NULL)
ORDER BY 3
ENDQUERY