davical/testing/tests/regression-suite/2601-POST-freebusy-confidential.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

59 lines
2.0 KiB
Plaintext

#
# POST to scheduling outbox for freebusy query of user4 for user1
# "Daily Recurring" event should generate 4x events, 3x at the same
# time, and 1x at a different time.
#
TYPE=POST
AUTH=user4:user4
HEADER=User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.18pre) Gecko/20100917 Sunbird/0.9
HEADER=Accept: text/xml
HEADER=Accept-Language: en-us,en;q=0.5
HEADER=Accept-Charset: utf-8,*;q=0.1
HEADER=Content-Type: text/calendar; charset=utf-8
HEADER=Originator: mailto:user4@example.net
HEADER=Recipient: mailto:user1@example.net
# HEAD
REPLACE=/^DTSTAMP:\d{4}[01]\d[0123]\dT[012]\d[0-5]\d[0-6]\dZ\r?$/DTSTAMP:yyyymmddThhmmssZ/
# REPLACE=/^ETag: "[[:hexdigit:]]+"\s$/ETag: "a fine looking etag"/
BEGINDATA
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VFREEBUSY
DTSTAMP:20230430T062945Z
ORGANIZER:mailto:user4@example.net
DTSTART:20230416T000000Z
DTEND:20230421T000000Z
UID:c5bd82ea-cd89-4f58-8d31-336f47e44f98
ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL:
mailto:user1@example.net
END:VFREEBUSY
END:VCALENDAR
ENDDATA
URL=http://regression.host/caldav.php/user4/.out/
QUERY
SELECT calendar_item.rrule,
to_char(calendar_item.dtstart at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS start,
to_char(calendar_item.dtend at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS finish,
class,
calendar_item.dav_name
FROM usr INNER JOIN collection USING (user_no)
INNER JOIN caldav_data USING (collection_id)
INNER JOIN calendar_item USING(dav_id)
WHERE caldav_data.dav_name LIKE '/user1/291-test-fb-rr-changes/%'
AND collection.is_calendar
AND rrule_event_overlaps( dtstart, dtend, rrule, '20230417T000000Z', '20230421T000000Z' )
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 dav_id
ENDQUERY