diff --git a/testing/dav_test b/testing/dav_test new file mode 100755 index 00000000..c22acbd1 --- /dev/null +++ b/testing/dav_test @@ -0,0 +1,108 @@ +#!/usr/bin/perl -w +# +# Run a test +# + +my $suite=$ARGV[0]; +my $test=$ARGV[1]; + +usage() unless ( defined($suite) && defined($test) ); + +my @arguments = ( "--basic", "--user", "andrew:x", "--proxy", "", "--silent" ); +push @arguments, "--verbose" if ( defined($ARGV[2]) ); + +my $url; + +my $datafile = "tests/$suite/$test.data"; + +open( TEST, '<', "tests/$suite/$test.test" ) or die "Can't open 'tests/$suite/$test.test'"; +while( ) { + /^\s*(#|$)/ && next; + + /^\s*HEAD\s*(#|$|=)/ && do { + push @arguments, "--include"; + }; + + /^\s*DATA\s*=\s*(\S.*)$/ && do { + $datafile="tests/$suite/$1.data"; + }; + + /^\s*VERBOSE\s*(#|$|=)/ && do { + push @arguments, "--verbose"; + }; + + /^\s*TYPE\s*=\s*(\S.*)$/ && do { + push @arguments, "--request", $1; + }; + + /^\s*HEADER\s*=\s*(\S.*)$/ && do { + push @arguments, "--header", $1; + }; + + /^\s*URL\s*=\s*(\S.*)$/ && do { + $url=$1; + }; + +} + +if ( !defined($url) ) { + print < ) { + print; +} + +exit(0); + +sub usage { + print < + +This program will read the file 'tests//.test +and follow the instructions there. Those instructions will include +lines defining the test like: +================================================= +# This is an example +URL=http://mycaldav/caldav.php/andrew/ +HEADER=Depth: 0 +HEADER=Content-type: text/xml +TYPE=PROPFIND +VERBOSE +DATA=OTHERTEST +================================================= + +URL The URL to request from. +HEADER An additional header for the request +TYPE The type of request (e.g. GET/PUT/POST/REPORT/...) +HEAD Whether to include the headers in the recorded response +VERBOSE Whether to provide the full request / response headers. +DATA The name of a different test in this suite to use data from. + +Additionally, if a file 'tests//.data' exists +the contents of that file will be sent in the body of the request. + +EOERROR + exit(1); +} diff --git a/testing/tests/chandler/OPTIONS-dotchandler.test b/testing/tests/chandler/OPTIONS-dotchandler.test new file mode 100644 index 00000000..78a9ec9d --- /dev/null +++ b/testing/tests/chandler/OPTIONS-dotchandler.test @@ -0,0 +1,6 @@ +# +# Test the initial OPTIONS for the root +# +TYPE=OPTIONS +URL=http://mycaldav/caldav.php/andrew/.chandler/ +HEAD \ No newline at end of file diff --git a/testing/tests/chandler/OPTIONS-top.test b/testing/tests/chandler/OPTIONS-top.test new file mode 100644 index 00000000..029a4dd2 --- /dev/null +++ b/testing/tests/chandler/OPTIONS-top.test @@ -0,0 +1,6 @@ +# +# Test the initial OPTIONS for the root +# +TYPE=OPTIONS +URL=http://mycaldav/caldav.php/andrew/ +HEAD \ No newline at end of file diff --git a/testing/tests/chandler/PROPFIND-dotchandler.test b/testing/tests/chandler/PROPFIND-dotchandler.test new file mode 100644 index 00000000..2080127f --- /dev/null +++ b/testing/tests/chandler/PROPFIND-dotchandler.test @@ -0,0 +1,8 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 0 +URL=http://mycaldav/caldav.php/andrew/.chandler/ +HEADER=Content-Type: text/xml; charset="utf-8" +DATA=PROPFIND \ No newline at end of file diff --git a/testing/tests/chandler/PROPFIND.data b/testing/tests/chandler/PROPFIND.data new file mode 100644 index 00000000..a86bedc8 --- /dev/null +++ b/testing/tests/chandler/PROPFIND.data @@ -0,0 +1,2 @@ + + diff --git a/testing/tests/chandler/PROPFIND.test b/testing/tests/chandler/PROPFIND.test new file mode 100644 index 00000000..2dff8529 --- /dev/null +++ b/testing/tests/chandler/PROPFIND.test @@ -0,0 +1,7 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 0 +URL=http://mycaldav/caldav.php/andrew/ +HEADER=Content-Type: text/xml; charset="utf-8" diff --git a/testing/tests/chandler/PROPFIND1.test b/testing/tests/chandler/PROPFIND1.test new file mode 100644 index 00000000..b134388d --- /dev/null +++ b/testing/tests/chandler/PROPFIND1.test @@ -0,0 +1,9 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 0 +HEADER=Content-Type: text/xml; charset="utf-8" +URL=http://mycaldav/caldav.php/andrew/ +DATA=PROPFIND +HEAD diff --git a/testing/tests/chandler/PROPFIND2.test b/testing/tests/chandler/PROPFIND2.test new file mode 100644 index 00000000..aef95705 --- /dev/null +++ b/testing/tests/chandler/PROPFIND2.test @@ -0,0 +1,9 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 1 +HEADER=Content-Type: text/xml; charset="utf-8" +URL=http://mycaldav/caldav.php/ +DATA=PROPFIND +HEAD diff --git a/testing/tests/chandler/REPORT.test b/testing/tests/chandler/REPORT.test new file mode 100644 index 00000000..f1fa10df --- /dev/null +++ b/testing/tests/chandler/REPORT.test @@ -0,0 +1,7 @@ +# +# Test the REPORT request from Mulberry +# +TYPE=REPORT +HEADER=Content-Type: text/xml; charset=utf-8 +URL=http://mycaldav/caldav.php/andrew/mulberry/ +HEAD \ No newline at end of file diff --git a/testing/tests/chandler/privilege.data b/testing/tests/chandler/privilege.data new file mode 100644 index 00000000..318e485a --- /dev/null +++ b/testing/tests/chandler/privilege.data @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/testing/tests/chandler/privilege.test b/testing/tests/chandler/privilege.test new file mode 100644 index 00000000..12e21bd0 --- /dev/null +++ b/testing/tests/chandler/privilege.test @@ -0,0 +1,7 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 0 +HEADER=Content-Type: text/xml; charset="utf-8" +URL=http://mycaldav/caldav.php/andrew/ diff --git a/testing/tests/chandler/ticketdiscovery.data b/testing/tests/chandler/ticketdiscovery.data new file mode 100644 index 00000000..f179b57a --- /dev/null +++ b/testing/tests/chandler/ticketdiscovery.data @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/testing/tests/chandler/ticketdiscovery.test b/testing/tests/chandler/ticketdiscovery.test new file mode 100644 index 00000000..12e21bd0 --- /dev/null +++ b/testing/tests/chandler/ticketdiscovery.test @@ -0,0 +1,7 @@ +# +# Test the initial PROPFIND for the root. +# +TYPE=PROPFIND +HEADER=Depth: 0 +HEADER=Content-Type: text/xml; charset="utf-8" +URL=http://mycaldav/caldav.php/andrew/ diff --git a/testing/tests/evolution/OPTIONS.test b/testing/tests/evolution/OPTIONS.test new file mode 100644 index 00000000..029a4dd2 --- /dev/null +++ b/testing/tests/evolution/OPTIONS.test @@ -0,0 +1,6 @@ +# +# Test the initial OPTIONS for the root +# +TYPE=OPTIONS +URL=http://mycaldav/caldav.php/andrew/ +HEAD \ No newline at end of file diff --git a/testing/tests/evolution/REPORT.data b/testing/tests/evolution/REPORT.data new file mode 100644 index 00000000..9e62d01d --- /dev/null +++ b/testing/tests/evolution/REPORT.data @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/testing/tests/evolution/REPORT.test b/testing/tests/evolution/REPORT.test new file mode 100644 index 00000000..819ffbbf --- /dev/null +++ b/testing/tests/evolution/REPORT.test @@ -0,0 +1,7 @@ +# +# Test the REPORT request +# +TYPE=REPORT +URL=http://mycaldav/caldav.php/andrew/ +HEADER=Content-Type: text/xml +HEAD \ No newline at end of file diff --git a/testing/tests/mulberry/PROPFIND-initial.data b/testing/tests/mulberry/PROPFIND-initial.data new file mode 100644 index 00000000..032be966 --- /dev/null +++ b/testing/tests/mulberry/PROPFIND-initial.data @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/testing/tests/mulberry/PROPFIND-initial.test b/testing/tests/mulberry/PROPFIND-initial.test new file mode 100644 index 00000000..0d4e05bc --- /dev/null +++ b/testing/tests/mulberry/PROPFIND-initial.test @@ -0,0 +1,7 @@ +# +# After creating a calendar in Mulberry, we should be able +# to do a PROPFIND and discover it. +TYPE=PROPFIND +URL=http://mycaldav/caldav.php/andrew/ +HEADER=Depth: 1 +HEADER=Content-Type: text/xml; charset=utf-8 \ No newline at end of file diff --git a/testing/tests/mulberry/PROPFIND-mulberry.data b/testing/tests/mulberry/PROPFIND-mulberry.data new file mode 100644 index 00000000..20f99279 --- /dev/null +++ b/testing/tests/mulberry/PROPFIND-mulberry.data @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/testing/tests/mulberry/PROPFIND-mulberry.test b/testing/tests/mulberry/PROPFIND-mulberry.test new file mode 100644 index 00000000..d83d38c0 --- /dev/null +++ b/testing/tests/mulberry/PROPFIND-mulberry.test @@ -0,0 +1,7 @@ +# +# After creating a calendar in Mulberry, we should be able +# to do a PROPFIND and discover it. +TYPE=PROPFIND +URL=http://mycaldav/caldav.php/andrew/mulberry/ +HEADER=Depth: 1 +HEADER=Content-Type: text/xml; charset=utf-8 diff --git a/testing/tests/mulberry/PUT1.data b/testing/tests/mulberry/PUT1.data new file mode 100644 index 00000000..5956e80a --- /dev/null +++ b/testing/tests/mulberry/PUT1.data @@ -0,0 +1,31 @@ +BEGIN:VCALENDAR +CALSCALE:GREGORIAN +PRODID:-//mulberrymail.com//Mulberry v4.0//EN +VERSION:2.0 +BEGIN:VTIMEZONE +LAST-MODIFIED:20040110T032845Z +TZID:New Zealand Standard Time +X-LIC-LOCATION:Pacific/Auckland +BEGIN:DAYLIGHT +DTSTART:20000404T020000 +RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 +TZNAME:NZDT +TZOFFSETFROM:+1200 +TZOFFSETTO:+1300 +END:DAYLIGHT +BEGIN:STANDARD +DTSTART:20001026T020000 +RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=10 +TZNAME:NZST +TZOFFSETFROM:+1300 +TZOFFSETTO:+1200 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20061004T072647Z +DTSTART;TZID=New Zealand Standard Time:20061004T111500 +DURATION:PT1H +SUMMARY:A new event +UID:73CEA660B2AB08BE90C9D6B5@D76FAF7B10D9E8D2D41F779C +END:VEVENT +END:VCALENDAR diff --git a/testing/tests/mulberry/PUT1.test b/testing/tests/mulberry/PUT1.test new file mode 100644 index 00000000..f2426912 --- /dev/null +++ b/testing/tests/mulberry/PUT1.test @@ -0,0 +1,7 @@ +# +# PUT a calendar entry into the Mulberry calendar +# +TYPE=PUT +URL=http://mycaldav/caldav.php/andrew/mulberry/30A56217E5719B1453D1942F83106C7A-0.ics +HEADER=Content-Type: text/calendar; charset=utf-8 +HEAD \ No newline at end of file diff --git a/testing/tests/mulberry/PUT2.data b/testing/tests/mulberry/PUT2.data new file mode 100644 index 00000000..73adafe2 --- /dev/null +++ b/testing/tests/mulberry/PUT2.data @@ -0,0 +1,33 @@ +BEGIN:VCALENDAR +CALSCALE:GREGORIAN +PRODID:-//mulberrymail.com//Mulberry v4.0//EN +VERSION:2.0 +BEGIN:VTIMEZONE +LAST-MODIFIED:20040110T032845Z +TZID:New Zealand Standard Time +X-LIC-LOCATION:Pacific/Auckland +BEGIN:DAYLIGHT +DTSTART:20000404T020000 +RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4 +TZNAME:NZDT +TZOFFSETFROM:+1200 +TZOFFSETTO:+1300 +END:DAYLIGHT +BEGIN:STANDARD +DTSTART:20001026T020000 +RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=10 +TZNAME:NZST +TZOFFSETFROM:+1300 +TZOFFSETTO:+1200 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DESCRIPTION:Weigh a pie +DTSTAMP:20061004T102416Z +DTSTART;TZID=New Zealand Standard Time:20061004T110000 +DURATION:PT1H +LOCATION:Somewhere over the rainbow +SUMMARY:11am on Wednesday\, 4th +UID:A1E59F7D54EF85BE2A7E6900@CA1CBED546AAE36FF3BC722E +END:VEVENT +END:VCALENDAR diff --git a/testing/tests/mulberry/PUT2.test b/testing/tests/mulberry/PUT2.test new file mode 100644 index 00000000..ce3a9fd2 --- /dev/null +++ b/testing/tests/mulberry/PUT2.test @@ -0,0 +1,7 @@ +# +# PUT a calendar entry into the Mulberry calendar +# +TYPE=PUT +URL=http://mycaldav/caldav.php/andrew/mulberry/F91ACE37725E396C1A4BB87568CE36C0-0.ics +HEADER=Content-Type: text/calendar; charset=utf-8 +HEAD \ No newline at end of file diff --git a/testing/tests/mulberry/REPORT-1href.data b/testing/tests/mulberry/REPORT-1href.data new file mode 100644 index 00000000..f6eea5b7 --- /dev/null +++ b/testing/tests/mulberry/REPORT-1href.data @@ -0,0 +1,9 @@ + + + + + + +/caldav.php/andrew/mulberry/30A56217E5719B1453D1942F83106C7A-0.ics +/caldav.php/andrew/mulberry/F91ACE37725E396C1A4BB87568CE36C0-0.ics + \ No newline at end of file diff --git a/testing/tests/mulberry/REPORT-1href.test b/testing/tests/mulberry/REPORT-1href.test new file mode 100644 index 00000000..54bb72d1 --- /dev/null +++ b/testing/tests/mulberry/REPORT-1href.test @@ -0,0 +1,7 @@ +# +# Test the REPORT request +# +TYPE=REPORT +URL=http://mycaldav/caldav.php/andrew/mulberry/ +HEADER=Content-Type: text/xml; charset=utf-8 +HEAD \ No newline at end of file