#!/usr/bin/perl # # Copyright (c) 2011-2017 FastMail Pty Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # 3. The name "Fastmail Pty Ltd" must not be used to # endorse or promote products derived from this software without # prior written permission. For permission or any legal # details, please contact # FastMail Pty Ltd # PO Box 234 # Collins St West 8007 # Victoria # Australia # # 4. Redistributions of any form whatsoever must retain the following # acknowledgment: # "This product includes software developed by Fastmail Pty. Ltd." # # FASTMAIL PTY LTD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # EVENT SHALL OPERA SOFTWARE AUSTRALIA BE LIABLE FOR ANY SPECIAL, INDIRECT # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF # USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # package Cassandane::Cyrus::TesterCalDAV; use strict; use warnings; use Cwd qw(abs_path); use File::Path qw(mkpath); use DateTime; use JSON::XS; use lib '.'; use base qw(Cassandane::Cyrus::TestCase); use Cassandane::Util::Log; use Cassandane::Util::Slurp; use Cassandane::Cassini; use Net::CalDAVTalk; my $basedir; my $binary; my $testdir; my %suppressed; my %expected; my $KNOWN_ERRORS = <SERVER/10 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/-1 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/11 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/5 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/6 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/7 | 1 implicitscheduleagent/Organizer CLIENT->SERVER/9 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/10 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/-1 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/11 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/12 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/13 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/14 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/2 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/3 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/4 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/6 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start)/9 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/10 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/-1 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/11 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/12 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/13 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/2 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/3 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/4 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/5 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/6 | 1 implicitscheduleagent/Organizer CLIENT->SERVER (no ATTENDEE at start recurring)/9 | 1 implicitscheduleagent/Organizer SERVER->NONE, no matching ATTENDEE/1 | 1 implicitscheduleagent/Organizer SERVER->NONE, no matching ATTENDEE/2 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/-1 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/11 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/12 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/13 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/15 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/16 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/2 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/21 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/22 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/23 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/25 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/26 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/3 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/31 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/33 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/34 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/35 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/4 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/6 | 1 implicitscheduleagent/Simple invite of three attendees - two initially not auto-scheduled/7 | 1 implicitscheduletag/Update to resource with schedule-tag behavior/3a | 1 implicitscheduletag/Update to resource with schedule-tag behavior/3b | 1 implicitsecurity/Prevent ATTENDEE party crash/2 | 1 implicitsecurity/Prevent ATTENDEE party crash/3 | 1 implicitsecurity/Prevent ATTENDEE party crash/4 | 1 implicitsecurity/Prevent ATTENDEE party crash/7 | 1 implicitsecurity/Prevent ATTENDEE party crash/8 | 1 implicitsecurity/Prevent ATTENDEE party crash/9 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/10 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/11 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/12 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/13 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/2 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/3 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/4 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/6 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - an attendee) via overwrite/8 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/10 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/11 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/12 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/13 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/2 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/3 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/4 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/6 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER (someone else - not an attendee) via overwrite/8 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/10 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/11 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/12 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/13 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/2 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/3 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/4 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/6 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/7 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via new event/9 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/10 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/11 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/12 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/13 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/2 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/3 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/4 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/6 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/8 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER via overwrite/9 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/10 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/2 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/3 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/5 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/6 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/7 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/8 | 1 implicitsecurity/Prevent ATTENDEE switching ORGANIZER without them as ATTENDEE via overwrite/9 | 1 implicitsecurity/Prevent ORGANIZER forgeries/10 | 1 implicitsecurity/Prevent ORGANIZER forgeries/2 | 1 implicitsecurity/Prevent ORGANIZER forgeries/3 | 1 implicitsecurity/Prevent ORGANIZER forgeries/4 | 1 implicitsecurity/Prevent ORGANIZER forgeries/7 | 1 implicitsecurity/Prevent ORGANIZER forgeries/8 | 1 implicitsecurity/Prevent ORGANIZER forgeries/9 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/10 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/2 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/3 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/5 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/7 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/8 | 1 implicitsecurity/Prevent ORGANIZER switching ORGANIZER without them as ATTENDEE via overwrite/9 | 1 implicitsequence/Lower Sequence/12 | 1 implicitsequence/Lower Sequence/13 | 1 implicitsequence/Lower Sequence/2 | 1 implicitsequence/Lower Sequence/3 | 1 implicitsequence/Lower Sequence/4 | 1 implicitsequence/Lower Sequence/7 | 1 implicitsequence/Lower Sequence/8 | 1 implicitsequence/Lower Sequence/9 | 1 implicitsequence/Recreate with Lower Sequence/-1 | 1 implicitsequence/Recreate with Lower Sequence/11 | 1 implicitsequence/Recreate with Lower Sequence/12 | 1 implicitsequence/Recreate with Lower Sequence/13 | 1 implicitsequence/Recreate with Lower Sequence/2 | 1 implicitsequence/Recreate with Lower Sequence/3 | 1 implicitsequence/Recreate with Lower Sequence/4 | 1 implicitsequence/Recreate with Lower Sequence/8 | 1 implicitsequence/Recreate with Lower Sequence/9 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/11 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/12 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/13 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/15 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/2 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/3 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/4 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/6 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/7 | 1 implicittimezones/Change event spanning a DST transition with R-IDs on either side/8 | 1 implicittodo/Attendee Delete/10 | 1 implicittodo/Attendee Delete/11 | 1 implicittodo/Attendee Delete/12 | 1 implicittodo/Attendee Delete/2 | 1 implicittodo/Attendee Delete/3 | 1 implicittodo/Attendee Delete/4 | 1 implicittodo/Attendee Delete/6 | 1 implicittodo/Attendee Delete/7 | 1 implicittodo/Attendee Delete/8 | 1 implicittodo/Client removing properties fix/10 | 1 implicittodo/Client removing properties fix/-1 | 1 implicittodo/Client removing properties fix/2 | 1 implicittodo/Client removing properties fix/3 | 1 implicittodo/Client removing properties fix/4 | 1 implicittodo/Client removing properties fix/6 | 1 implicittodo/Client removing properties fix/7 | 1 implicittodo/Client removing properties fix/8 | 1 implicittodo/Client removing properties fix/9 | 1 implicittodo/Organizer Delete/11 | 1 implicittodo/Organizer Delete/12 | 1 implicittodo/Organizer Delete/13 | 1 implicittodo/Organizer Delete/2 | 1 implicittodo/Organizer Delete/3 | 1 implicittodo/Organizer Delete/4 | 1 implicittodo/Organizer Delete/6 | 1 implicittodo/Organizer Delete/7 | 1 implicittodo/Organizer Delete/8 | 1 implicittodo/Per-attendee completed/10 | 1 implicittodo/Per-attendee completed/-1 | 1 implicittodo/Per-attendee completed/11 | 1 implicittodo/Per-attendee completed/13 | 1 implicittodo/Per-attendee completed/14 | 1 implicittodo/Per-attendee completed/15 | 1 implicittodo/Per-attendee completed/16 | 1 implicittodo/Per-attendee completed/18 | 1 implicittodo/Per-attendee completed/2 | 1 implicittodo/Per-attendee completed/3 | 1 implicittodo/Per-attendee completed/4 | 1 implicittodo/Per-attendee completed/6 | 1 implicittodo/Per-attendee completed/7 | 1 implicittodo/Per-attendee completed/9 | 1 implicittodo/Simple Changes/11 | 1 implicittodo/Simple Changes/12 | 1 implicittodo/Simple Changes/13 | 1 implicittodo/Simple Changes/15 | 1 implicittodo/Simple Changes/16 | 1 implicittodo/Simple Changes/17 | 1 implicittodo/Simple Changes/19 | 1 implicittodo/Simple Changes/2 | 1 implicittodo/Simple Changes/3 | 1 implicittodo/Simple Changes/4 | 1 implicittodo/Simple Changes/6 | 1 implicittodo/Simple Changes/7 | 1 implicittodo/Simple Changes/8 | 1 implicitxdash/Attendee to Organizer/10 | 1 implicitxdash/Attendee to Organizer/-1 | 1 implicitxdash/Attendee to Organizer/11 | 1 implicitxdash/Attendee to Organizer/13 | 1 implicitxdash/Attendee to Organizer/14 | 1 implicitxdash/Attendee to Organizer/15 | 1 implicitxdash/Attendee to Organizer/16 | 1 implicitxdash/Attendee to Organizer/17 | 1 implicitxdash/Attendee to Organizer/18 | 1 implicitxdash/Attendee to Organizer/19 | 1 implicitxdash/Attendee to Organizer/20 | 1 implicitxdash/Attendee to Organizer/2 | 1 implicitxdash/Attendee to Organizer/21 | 1 implicitxdash/Attendee to Organizer/22 | 1 implicitxdash/Attendee to Organizer/23 | 1 implicitxdash/Attendee to Organizer/24 | 1 implicitxdash/Attendee to Organizer/25 | 1 implicitxdash/Attendee to Organizer/26 | 1 implicitxdash/Attendee to Organizer/27 | 1 implicitxdash/Attendee to Organizer/28 | 1 implicitxdash/Attendee to Organizer/29 | 1 implicitxdash/Attendee to Organizer/3 | 1 implicitxdash/Attendee to Organizer/4 | 1 implicitxdash/Attendee to Organizer/5 | 1 implicitxdash/Attendee to Organizer/6 | 1 implicitxdash/Attendee to Organizer/7 | 1 implicitxdash/Attendee to Organizer/8 | 1 implicitxdash/Attendee to Organizer/9 | 1 implicitxdash/Organizer to Attendee/10 | 1 implicitxdash/Organizer to Attendee/-1 | 1 implicitxdash/Organizer to Attendee/11 | 1 implicitxdash/Organizer to Attendee/12 | 1 implicitxdash/Organizer to Attendee/2 | 1 implicitxdash/Organizer to Attendee/3 | 1 implicitxdash/Organizer to Attendee/4 | 1 implicitxdash/Organizer to Attendee/5 | 1 implicitxdash/Organizer to Attendee/6 | 1 implicitxdash/Organizer to Attendee/7 | 1 implicitxdash/Organizer to Attendee/8 | 1 json/Freebusy json/2 | 1 mkcalendar/MKCALENDAR with body/3 | 1 nonascii/Non-ascii calendar data/1 | 1 nonascii/Non-ascii calendar data/2 | 1 nonascii/Non-ascii calendar data/3 | 1 nonascii/Non-ascii calendar data/4 | 1 nonascii/Non-ascii calendar data/5 | 1 nonascii/Non-utf-8 calendar data/1 | 1 nonascii/Non-utf-8 calendar data/2 | 1 nonascii/Non-utf-8 calendar data/3 | 1 nonascii/POSTs/1 | 1 nonascii/POSTs/2 | 1 nonascii/PUT with CN re-write/1 | 1 nonascii/PUT with CN re-write/2 | 1 options/OPTIONS+DAV/1 | 1 options/OPTIONS+DAV/2 | 1 polls/PUT VPOLL - no scheduling/2 | 1 polls/PUT VPOLL - simple scheduling/-1 | 1 polls/PUT VPOLL - simple scheduling/2 | 1 polls/PUT VPOLL - simple scheduling/3 | 1 polls/PUT VPOLL - simple scheduling/4 | 1 polls/PUT VPOLL - simple scheduling/5 | 1 polls/PUT VPOLL - simple scheduling/6 | 1 polls/PUT VPOLL - simple scheduling/7 | 1 polls/PUT VPOLL - simple scheduling/8 | 1 polls/PUT VPOLL - Two voter scheduling/-1 | 1 polls/PUT VPOLL - Two voter scheduling/2 | 1 polls/PUT VPOLL - Two voter scheduling/3 | 1 polls/PUT VPOLL - Two voter scheduling/4 | 1 polls/PUT VPOLL - Two voter scheduling/5 | 1 polls/PUT VPOLL - Two voter scheduling/6 | 1 polls/PUT VPOLL - Two voter scheduling/7 | 1 polls/PUT VPOLL - Two voter scheduling/8 | 1 polls/PUT VPOLL - Two voter scheduling/9 | 1 prefer/representation schedule PUT/1 | 1 prefer/representation schedule PUT/2 | 1 prefer/representation schedule PUT/3 | 1 prefer/representation schedule PUT/4 | 1 prefer/representation schedule PUT/5 | 1 propfind/Depth:infinity disabled/2 | 1 propfind/Depth:infinity disabled/3 | 1 propfind/Depth:infinity disabled/4 | 1 propfind/Depth:infinity disabled/5 | 1 propfind/Depth:infinity disabled/6 | 1 propfind/Depth:infinity disabled/7 | 1 propfind/prop all/3 | 1 propfind/prop names/3 | 1 propfind/regular calendar prop finds/3 | 1 propfind/regular home prop finds/3 | 1 proppatch/prop patches/4 | 1 proppatch/prop patch property attributes/1 | 1 proppatch/prop patch property attributes/2 | 1 put/PUTs with ^ parameter encoding/1 | 1 put/PUT VEVENT/1 | 1 put/PUT with Content-Type parameters/3 | 1 put/PUT with relaxed parsing/1 | 1 put/PUT with relaxed parsing/2 | 1 put/PUT with X- using VALUE != TEXT/1 | 1 quota/Quota after collection create/2 | 1 quota/Quota after collection create, and PUT/3 | 1 quota/Quota after empty collection delete/2 | 1 quota/Quota after non-empty collection delete/1 | 1 quota/Quota after non-empty collection delete/2 | 1 quota/Quota enabled by default on calendar home and below only/3 | 1 quota/Quota enabled by default on calendar home and below only/4 | 1 reports/alarm time-range query reports/1 | 1 reports/alarm time-range query reports/3 | 1 reports/alarm time-range query reports/4 | 1 reports/alarm time-range query reports/5 | 1 reports/basic query reports/11 | 1 reports/basic query reports/13 | 1 reports/basic query reports/15 | 1 reports/basic query reports/16 | 1 reports/basic query reports/17a | 1 reports/basic query reports/19a | 1 reports/basic query reports/21 | 1 reports/basic query reports/23 | 1 reports/basic query reports/24 | 1 reports/basic query reports/25 | 1 reports/basic query reports/2a | 1 reports/basic query reports/3 | 1 reports/basic query reports/4 | 1 reports/basic query reports/5 | 1 reports/basic query reports/6 | 1 reports/basic query reports/7 | 1 reports/basic query reports/8 | 1 reports/basic query reports/9 | 1 reports/free-busy reports/1 | 1 reports/free-busy reports/2 | 1 reports/limit/expand recurrence in reports/10 | 1 reports/limit/expand recurrence in reports/11 | 1 reports/limit/expand recurrence in reports/12 | 1 reports/limit/expand recurrence in reports/9a | 1 reports/query reports with filtered data/1 | 1 reports/query reports with filtered data/2 | 1 reports/time-range query reports/10 | 1 reports/time-range query reports/11 | 1 reports/time-range query reports/12a | 1 reports/time-range query reports/16 | 1 reports/time-range query reports/19a | 1 reports/time-range query reports/2 | 1 reports/time-range query reports/21a | 1 reports/time-range query reports/23a | 1 reports/time-range query reports/4 | 1 reports/time-range query reports/6 | 1 reports/time-range query reports/7 | 1 reports/time-range query reports/8 | 1 rscale/Bad data/2 | 1 rscale/Chinese MonthDay Skip/1 | 1 rscale/Chinese MonthDay Skip/2 | 1 rscale/Chinese MonthDay Skip/3 | 1 rscale/Chinese MonthDay Skip/4 | 1 rscale/Chinese Monthly Skip/1 | 1 rscale/Chinese Monthly Skip/2 | 1 rscale/Chinese Monthly Skip/3 | 1 rscale/Chinese Monthly Skip/4 | 1 rscale/Ethiopic, Last Day Of Year/1 | 1 rscale/Gregorian Monthly Skip/1 | 1 rscale/Gregorian Monthly Skip/2 | 1 rscale/Gregorian Monthly Skip/3 | 1 rscale/Gregorian Monthly Skip/4 | 1 rscale/Gregorian Yearly Skip/1 | 1 rscale/Gregorian Yearly Skip/2 | 1 rscale/Gregorian Yearly Skip/3 | 1 rscale/Gregorian Yearly Skip/4 | 1 scheduleimplicit-compatability/OPTIONS header/1 | 1 scheduleimplicit-compatability/OPTIONS header/2 | 1 scheduleimplicit-compatability/POSTs ignored/1 | 1 schedulenomore/SCHEDULE Fails/1 | 1 schedulepost/POST Errors/10 | 1 schedulepost/POST Errors/1 | 1 schedulepost/POST Errors/11 | 1 schedulepost/POST Errors/2 | 1 schedulepost/POST Errors/3 | 1 schedulepost/POST Errors/4 | 1 schedulepost/POST Errors/5 | 1 schedulepost/POST Errors/6 | 1 schedulepost/POST Errors/7 | 1 schedulepost/POST Errors/8 | 1 schedulepost/POST Errors/9 | 1 schedulepost/POSTs/1 | 1 schedulepost/POSTs/5 | 1 schedulepost/POSTs/6 | 1 schedulepost/POSTs free busy/1 | 1 schedulepost/POSTs free busy/2 | 1 schedulepost/POSTs free busy/3 | 1 schedulepost/POSTs free busy/4 | 1 schedulepost/Reports on Inbox/Outbox/3 | 1 schedulepost/Reports on Inbox/Outbox/4 | 1 schedulepost/Reports on Inbox/Outbox/5 | 1 schedulepost/Reports on Inbox/Outbox/6 | 1 scheduleprops/free-busy-set/10 | 1 scheduleprops/free-busy-set/1 | 1 scheduleprops/free-busy-set/3 | 1 scheduleprops/free-busy-set/4 | 1 scheduleprops/free-busy-set/9 | 1 servertoserverincoming/POST Errors/1 | 1 servertoserverincoming/POST Errors/2 | 1 servertoserverincoming/POST Errors/3 | 1 servertoserverincoming/POST Errors/4 | 1 servertoserverincoming/POST Errors/5 | 1 servertoserverincoming/POST Errors/6 | 1 servertoserverincoming/POST free-busy/1 | 1 servertoserverincoming/POST free-busy/2 | 1 servertoserverincoming/POST invite one user/1 | 1 servertoserverincoming/POST invite one user/2 | 1 servertoserverincoming/POST invite two users/1 | 1 servertoserverincoming/POST invite two users/2 | 1 servertoserverincoming/POST invite two users/3 | 1 servertoserveroutgoing/POST free-busy/1 | 1 servertoserveroutgoing/POST invite/1 | 1 sync-report/simple reports - diff token - no props - calendar depth | 1 sync-report/simple reports - diff token - no props - calendar depth:1/1 | 1 sync-report/simple reports - diff token - props/1 | 1 sync-report/simple reports - empty inbox/1 | 1 sync-report/simple reports - empty token - no props/1 | 1 sync-report/simple reports - empty token - no props/13 | 1 sync-report/simple reports - empty token - no props/5 | 1 sync-report/simple reports - empty token - no props/9 | 1 sync-report/simple reports - empty token - props/1 | 1 sync-report/simple reports - empty token - props/2 | 1 sync-report/simple reports - empty token - props/3 | 1 sync-report/simple reports - empty token - props/4 | 1 sync-report/simple reports - sync-level/7 | 1 sync-report/simple reports - valid token/1 | 1 sync-report/support-report-set/sync-token property/1 | 1 sync-report/support-report-set/sync-token property/2 | 1 timezonestdservice/Expand/1 | 1 timezonestdservice/Expand/2 | 1 timezonestdservice/Expand/3 | 1 timezonestdservice/Expand/4 | 1 timezonestdservice/GET well-known/1 | 1 timezonestdservice/Invalid query action=expand/10 | 1 timezonestdservice/Invalid query action=expand/1 | 1 timezonestdservice/Invalid query action=expand/2 | 1 timezonestdservice/Invalid query action=expand/3 | 1 timezonestdservice/Invalid query action=expand/4 | 1 timezonestdservice/Invalid query action=expand/5 | 1 timezonestdservice/Invalid query action=expand/6 | 1 timezonestdservice/Invalid query action=expand/7 | 1 timezonestdservice/Invalid query action=expand/8 | 1 timezonestdservice/Invalid query action=expand/9 | 1 timezonestdservice/Invalid query action=find/1 | 1 timezonestdservice/Invalid query action=find/2 | 1 timezonestdservice/Invalid query action=find/3 | 1 timezonestdservice/Invalid query action=get/1 | 1 timezonestdservice/Invalid query action=get/2 | 1 timezonestdservice/Non-query GET/1 | 1 timezonestdservice/PROPFIND timezone-service-set/1 | 1 timezonestdservice/Query action=get/1 | 1 timezonestdservice/Query action=get/2 | 1 timezonestdservice/Query action=get/3 | 1 timezonestdservice/Query bogus parameters/1 | 1 timezonestdservice/Query bogus parameters/2 | 1 timezonestdservice/Query method=capabilities/1 | 1 timezonestdservice/Query method=find/1 | 1 timezonestdservice/Query method=find/2 | 1 timezonestdservice/Query method=find/3 | 1 timezonestdservice/Query method=find/4 | 1 timezonestdservice/Query method=find/5 | 1 timezonestdservice/Query method=find/6 | 1 timezonestdservice/Query method=find/7 | 1 timezonestdservice/Query method=find/8 | 1 timezonestdservice/Query method=find/9 | 1 timezonestdservice/Query method=list/1 | 1 timezones/Timezone cache/2 | 1 timezones/Timezone cache/4 | 1 timezones/Timezone cache - aliases/2 | 1 timezones/Timezone cache - aliases/4 | 1 timezones/Timezone properties/6 | 1 webcal/GET on calendar collection after DELETE/1 | 1 webcal/GET on calendar collection after DELETE/2 | 1 webcal/GET on calendar collection after initial PUT/1 | 1 webcal/GET on calendar collection after initial PUT/2 | 1 webcal/GET on calendar collection after PUT/1 | 1 webcal/GET on calendar collection after PUT/2 | 1 webcal/GET on empty calendar collection/1 | 1 webcal/GET on empty calendar collection/2 | 1 well-known/Simple GET tests/3 | 1 well-known/Simple GET tests/4 | 1 well-known/Simple PROPFIND tests/1 | 1 well-known/Simple PROPFIND tests/2 | 1 well-known/Simple PROPFIND tests/3 | 1 well-known/Simple PROPFIND tests/4 | 1 well-known/Simple PROPFIND tests/5 | 1 well-known/Simple PROPFIND tests/6 | 1 EOF sub init { my $cassini = Cassandane::Cassini->instance(); $basedir = $cassini->val('caldavtester', 'basedir'); return unless defined $basedir; $basedir = abs_path($basedir); my $supp = $cassini->val('caldavtester', 'suppress-caldav', ''); map { $suppressed{$_} = 1; } split(/\s+/, $supp); foreach my $row (split /\n/, $KNOWN_ERRORS) { next if $row =~ m/^\s*\#/; next unless $row =~ m/\S/; my ($key, @items) = split /\s*\|\s*/, $row; $expected{$key} = \@items; } $binary = "$basedir/testcaldav.py"; $testdir = "$basedir/scripts/tests/CalDAV"; } init; sub new { my $class = shift; my $buildinfo = Cassandane::BuildInfo->new(); if (not defined $basedir or not $buildinfo->get('component', 'httpd')) { # don't bother setting up, we're not running tests anyway return $class->SUPER::new({}, @_); } my $config = Cassandane::Config->default()->clone(); $config->set(servername => "127.0.0.1"); # urlauth needs matching servername $config->set(caldav_realm => 'Cassandane'); $config->set(httpmodules => 'caldav'); $config->set(httpallowcompress => 'no'); return $class->SUPER::new({ config => $config, adminstore => 1, services => ['imap', 'http'], }, @_); } sub set_up { my ($self) = @_; $self->SUPER::set_up(); if (not defined $basedir or not $self->{instance}->{buildinfo}->get('component', 'httpd')) { # don't bother setting up further, we're not running tests anyway return; } my $admintalk = $self->{adminstore}->get_client(); my $service = $self->{instance}->get_service("http"); $ENV{DEBUGDAV} = 1; $ENV{JMAP_ALWAYS_FULL} = 1; for (1..40) { my $name = sprintf("user%02d", $_); my $displayname = sprintf("User %02d", $_); $admintalk->create("user.$name"); $admintalk->setacl("user.$name", admin => 'lrswipkxtecda'); $admintalk->setacl("user.$name", $name => 'lrswipkxtecd'); my $CalDAV = Net::CalDAVTalk->new( user => $name, password => 'pass', host => $service->host(), port => $service->port(), scheme => 'http', url => '/', expandurl => 1, ); eval { # this fails on older Cyruses -- but don't crash during set_up! $CalDAV->UpdateAddressSet($displayname, "$name\@example.com"); }; } } sub tear_down { my ($self) = @_; $self->SUPER::tear_down(); } sub list_tests { my @tests; if (!defined $basedir) { return ( 'test_warning_caldavtester_is_not_installed' ); } open(FH, "-|", 'find', $testdir, '-name' => '*.xml'); while () { chomp; next unless s{^$testdir/}{}; next unless s{\.xml$}{}; next if $suppressed{$_}; push(@tests, "test_$_"); } close(FH); return @tests; } sub run_test { my ($self) = @_; if (!defined $basedir) { xlog "CalDAVTester tests are not enabled. To enabled them, please"; xlog "install CalDAVTester from http://calendarserver.org/wiki/CalDAVTester"; xlog "and edit [caldavtester]basedir in cassandane.ini"; xlog "This is not a failure"; return; } my $name = $self->name(); $name =~ s/^test_//; my $testname = $name; $testname .= ".xml"; my $logdir = "$self->{instance}->{basedir}/rawlog/"; mkdir($logdir); my $svc = $self->{instance}->get_service('http'); my $params = $svc->store_params(); my $rundir = "$self->{instance}->{basedir}/run"; mkdir($rundir); system('ln', '-s', "$testdir", "$rundir/tests"); system('ln', '-s', "$basedir", "$rundir/data"); # XXX - make the config file! my $configfile = "$rundir/serverinfo.xml"; { my $config = slurp_file(abs_path("data/caldavtester-serverinfo-template.xml")); $config =~ s/SERVICE_HOST/$params->{host}/g; $config =~ s/SERVICE_PORT/$params->{port}/g; open(FH, ">", $configfile); print FH $config; close(FH); } my $errfile = $self->{instance}->{basedir} . "/$name.errors"; my $outfile = $self->{instance}->{basedir} . "/$name.stdout"; my $status; my @verbose; if (get_verbose) { push @verbose, "--always-print-request", "--always-print-response"; } $self->{instance}->run_command({ redirects => { stderr => $errfile, stdout => $outfile }, workingdir => $logdir, handlers => { exited_normally => sub { $status = 1; }, exited_abnormally => sub { $status = 0; }, }, }, $binary, "--basedir" => $rundir, "--observer=jsondump", @verbose, $testname); my $json; { my $output = slurp_file($outfile); $output =~ s/^.*?\[/[/s; $json = decode_json($output); } if (0 && (!$status || get_verbose)) { foreach my $file ($errfile) { next unless -f $file; xlog $self, slurp_file($file); } } $json->[0]{name} = $name; # short name at top level $self->assert(_check_result($name, $json->[0])); } sub _check_result { my $name = shift; my $json = shift; my $res = 1; if (defined $json->{result}) { if ($json->{result} == 0) { xlog "$name [OK]"; } elsif ($json->{result} == 1) { xlog "$name [FAILED]"; $res = 0; } elsif ($json->{result} == 3) { xlog "$name [SKIPPED]"; } if (exists $expected{$name}) { if ($json->{result} == $expected{$name}[0]) { xlog "EXPECTED RESULT FOR $name"; $res = 1; } else { xlog "UNEXPECTED RESULT FOR $name: " . $expected{$name}[1] if $expected{$name}[1]; $res = 0; # yep, even if we succeeded } } xlog $json->{details} if $json->{result}; } xlog "FAILED WHEN NOT EXPECTED $name" unless $res; if ($json->{tests}) { foreach my $test (@{$json->{tests}}) { $res = 0 unless _check_result("$name/$test->{name}", $test); } } return $res; } 1;