From af94c880b380264ecdec17183468170620be1382 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Sat, 31 Oct 2015 00:28:27 +0100 Subject: Add CalDAVTester to travis --- .../tests/travis/caldavtest/config/serverinfo.dtd | 43 ++ .../tests/travis/caldavtest/config/serverinfo.xml | 854 +++++++++++++++++++++ .../tests/CardDAV/current-user-principal.xml | 150 ++++ apps/dav/tests/travis/carddavtester.sh | 28 + 4 files changed, 1075 insertions(+) create mode 100644 apps/dav/tests/travis/caldavtest/config/serverinfo.dtd create mode 100644 apps/dav/tests/travis/caldavtest/config/serverinfo.xml create mode 100644 apps/dav/tests/travis/caldavtest/tests/CardDAV/current-user-principal.xml create mode 100644 apps/dav/tests/travis/carddavtester.sh (limited to 'apps') diff --git a/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd b/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd new file mode 100644 index 00000000000..d642f4f90cd --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/dav/tests/travis/caldavtest/config/serverinfo.xml b/apps/dav/tests/travis/caldavtest/config/serverinfo.xml new file mode 100644 index 00000000000..b85a8639e4e --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/config/serverinfo.xml @@ -0,0 +1,854 @@ + + + + + + + + localhost + 8888 + basic + + + 120 + 0.25 + 30 + + + + COPY Method + MOVE Method + Extended MKCOL + + + ACL Method + acl-principal-prop-set REPORT + principal-match REPORT + principal-property-search REPORT + principal-search-property-set REPORT + calendarserver-principal-search REPORT + + add-member + + brief + bulk-post + ctag + current-user-principal + directory listing + extended-principal-search + expand-property + only-proxy-groups + limits + own-root + prefer + prefer-minimal + prefer-representation + prefer-noroot + quota + + resource-id + sync-report + + sync-report-home + sync-report-config-token + well-known + + + + + json-data + + + control-api + + + caldav + attachments-collection + auto-accept + auto-accept-modes + client-fix-TRANSP + + default-alarms + EMAIL parameter + extended-freebusy + freebusy-url + group-attendee-expansion + implicit-scheduling + location-resource-tracking + managed-attachments + maskuid + no-duplicate-uids + partstat-timestamp + + private-comments + private-events + proxy + + recurrence-splitting + remove-duplicate-alarms + query-extended + shared-calendars + share-calendars-to-groups + schedule-changes + split-calendars + supported-component-sets + supported-component-sets-one + timerange-low-limit + timerange-high-limit + timezones-by-reference + timezone-service + timezone-std-service + + travel-time-busy + vavailability + + webcal + + + carddav + default-addressbook + shared-addressbooks + shared-addressbook-groups + directory-gateway + + + + + + + $multistatus-response-prefix: + /{DAV:}multistatus/{DAV:}response + + + $multistatus-href-prefix: + /{DAV:}multistatus/{DAV:}response/{DAV:}href + + + $verify-response-prefix: + {DAV:}response/{DAV:}propstat/{DAV:}prop + + + $verify-property-prefix: + /{DAV:}multistatus/{DAV:}response/{DAV:}propstat/{DAV:}prop + + + $verify-bad-response: + /{DAV:}multistatus/{DAV:}response/{DAV:}status + + + $verify-error-response: + /{DAV:}multistatus/{DAV:}response/{DAV:}error + + + $CALDAV: + urn:ietf:params:xml:ns:caldav + + + $CARDDAV: + urn:ietf:params:xml:ns:carddav + + + $CS: + http://calendarserver.org/ns/ + + + + + + + + $root: + /remote.php/dav/ + + + + + $principalcollection: + $root:principals/ + + + + + $uidstype: + __uids__ + + + $userstype: + users + + + $groupstype: + groups + + + $locationstype: + locations + + + $resourcestype: + resources + + + + + $principals_uids: + $principalcollection:$uidstype:/ + + + $principals_users: + $principalcollection:$userstype:/ + + + $principals_groups: + $principalcollection:$groupstype:/ + + + $principals_resources: + $principalcollection:$resourcestype:/ + + + $principals_locations: + $principalcollection:$locationstype:/ + + + + + $calendars: + $root:calendars/ + + + + + $calendars_uids: + $calendars:$uidstype:/ + + + $calendars_users: + $calendars:$userstype:/ + + + $calendars_resources: + $calendars:$resourcestype:/ + + + $calendars_locations: + $calendars:$locationstype:/ + + + + + $calendar: + calendar + + + + + $tasks: + tasks + + + + + $polls: + polls + + + + + $inbox: + inbox + + + + + $outbox: + outbox + + + + + $dropbox: + dropbox + + + + + $attachments: + dropbox + + + + + $notification: + notification + + + + + $freebusy: + freebusy + + + + + $calendar_home_items_initial_sync: + [-,$calendar:/,$tasks:/,$inbox:/,$outbox:/,$freebusy:,$notification:/] + + + + + $calendar_sync_extra_items: + [-] + + + + + $calendar_sync_extra_count: + 1 + + + + + $servertoserver: + $root:inbox + + + + + $timezoneservice: + $root:timezones + + + + + $timezonestdservice: + $root:stdtimezones + + + + + $addressbooks: + $root:addressbooks/ + + + + + $addressbooks_uids: + $addressbooks:$uidstype:/ + + + $addressbooks_users: + $addressbooks:$userstype:/ + + + + + $addressbook: + addressbook + + + + + $directory: + $root:directory/ + + + + + $add-member: + ;add-member + + + + + $useradmin: + admin + + + + $useradminguid: + 0C8BDE62-E600-4696-83D3-8B5ECABDFD2E + + + + $pswdadmin: + admin + + + + + $principal_admin: + $principals_users:$useradmin:/ + + + $principaluri_admin: + $principals_uids:$useradminguid:/ + + + + + $userapprentice: + apprentice + + + + $userapprenticeguid: + 29B6C503-11DF-43EC-8CCA-40C7003149CE + + + + $pswdapprentice: + apprentice + + + + + $principal_apprentice: + $principals_users:$userapprentice:/ + + + $principaluri_apprentice: + $principals_uids:$userapprenticeguid:/ + + + + + $userproxy: + superuser + + + + $pswdproxy: + superuser + + + + + + + $userid%d: + user%02d + + + + $userguid%d: + 10000000-0000-0000-0000-000000000%03d + + + + $username%d: + User %02d + + + + $username-encoded%d: + User%%20%02d + + + + $firstname%d: + User + + + + $lastname%d: + %02d + + + + $pswd%d: + user%02d + + + + $principal%d: + $principals_users:$userid%d:/ + + + $principaluri%d: + $principalcollection:$userid%d:/ + + + $principal%dnoslash: + $principals_users:$userid%d: + + + + + $calendarhome%d: + $calendars_uids:$userguid%d: + + + + $calendarhomealt%d: + $calendars_users:$userid%d: + + + + $calendarpath%d: + $calendarhome%d:/$calendar: + + + + $calendarpathalt%d: + $calendarhomealt%d:/$calendar: + + + + $taskspath%d: + $calendarhome%d:/$tasks: + + + + $pollspath%d: + $calendarhome%d:/$polls: + + + + $inboxpath%d: + $calendarhome%d:/$inbox: + + + + $outboxpath%d: + $calendarhome%d:/$outbox: + + + + $dropboxpath%d: + $calendarhome%d:/$dropbox: + + + + $notificationpath%d: + $calendarhome%d:/$notification: + + + + $freebusypath%d: + $calendarhome%d:/$freebusy: + + + $email%d: + $userid%d:@example.com + + + + $cuaddr%d: + mailto:$email%d: + + + $cuaddralt%d: + $cuaddr%d: + + + $cuaddraltnoslash%d: + $cuaddr%d: + + + $cuaddrurn%d: + urn:x-uid:$userguid%d: + + + + + $addressbookhome%d: + $addressbooks_uids:$userguid%d: + + + + $addressbookpath%d: + $addressbookhome%d:/$addressbook: + + + + + + + + $publicuserid%d: + public%02d + + + + $publicuserguid%d: + 50000000-0000-0000-0000-0000000000%02d + + + + $publicusername%d: + Public %02d + + + + $publicpswd%d: + public%02d + + + + $publicprincipal%d: + $principals_users:$publicuserid%d:/ + + + $publicprincipaluri%d: + $principals_uids:$publicuserguid%d:/ + + + + $publiccalendarhome%d: + $calendars_uids:$publicuserguid%d: + + + + $publiccalendarpath%d: + $calendars_uids:$publicuserguid%d:/$calendar: + + + $publicemail%d: + $publicuserid%d:@example.com + + + + $publiccuaddr%d: + mailto:$publicemail%d: + + + $publiccuaddralt%d: + $publiccuaddr%d: + + + $publiccuaddrurn%d: + urn:x-uid:$publicuserguid%d: + + + + + + + $resourceid%d: + resource%02d + + + + $resourceguid%d: + 40000000-0000-0000-0000-000000000%03d + + + + $resourcename%d: + Resource %02d + + + + $rcalendarhome%d: + $calendars_uids:$resourceguid%d: + + + + $rcalendarpath%d: + $calendars_uids:$resourceguid%d:/$calendar: + + + + $rinboxpath%d: + $calendars_uids:$resourceguid%d:/$inbox: + + + + $routboxpath%d: + $calendars_uids:$resourceguid%d:/$outbox: + + + + $rprincipal%d: + $principals_resources:$resourceid%d:/ + + + $rprincipaluri%d: + $principals_uids:$resourceguid%d:/ + + + $rcuaddralt%d: + $rcuaddrurn%d: + + + $rcuaddrurn%d: + urn:x-uid:$resourceguid%d: + + + + + + + $locationid%d: + location%02d + + + + $locationguid%d: + 30000000-0000-0000-0000-000000000%03d + + + + $locationname%d: + Location %02d + + + + $lcalendarhome%d: + $calendars_uids:$locationguid%d: + + + + $lcalendarpath%d: + $calendars_uids:$locationguid%d:/$calendar: + + + + $linboxpath%d: + $calendars_uids:$locationguid%d:/$inbox: + + + + $loutboxpath%d: + $calendars_uids:$locationguid%d:/$outbox: + + + + $lprincipal%d: + $principals_resources:$locationid%d:/ + + + $lprincipaluri%d: + $principals_uids:$locationguid%d:/ + + + $lcuaddralt%d: + $lprincipaluri%d: + + + $lcuaddrurn%d: + urn:x-uid:$locationguid%d: + + + + + + + + $groupid%d: + group%02d + + + + $groupguid%d: + 20000000-0000-0000-0000-000000000%03d + + + + $groupname%d: + Group %02d + + + + $gprincipal%d: + $principals_resources:$groupid%d:/ + + + $gprincipaluri%d: + $principals_uids:$groupguid%d:/ + + + $gemail%d: + $groupid%d:@example.com + + + $gcuaddralt%d: + $gprincipaluri%d: + + + $gcuaddrurn%d: + urn:x-uid:$groupguid%d: + + + + + + $i18nid: + i18nuser + + + + $i18nguid: + 860B3EE9-6D7C-4296-9639-E6B998074A78 + + + + $i18nname: + まだ + + + + $i18npswd: + i18nuser + + + + $i18ncalendarpath: + $calendars_uids:$i18nguid:/$calendar: + + + $i18nemail: + $i18nid:@example.com + + + + $i18ncuaddr: + mailto:$i18nemail: + + + $i18ncuaddrurn: + urn:x-uid:$i18nguid: + + + + + $principaldisabled: + $principals_groups:disabledgroup/ + + + $principaluridisabled: + $principals_uids:disabledgroup/ + + + + $cuaddrdisabled: + $principals_uids:disabledgroup/ + + + + + + + $cuaddr2: + MAILTO:$email2: + + + + diff --git a/apps/dav/tests/travis/caldavtest/tests/CardDAV/current-user-principal.xml b/apps/dav/tests/travis/caldavtest/tests/CardDAV/current-user-principal.xml new file mode 100644 index 00000000000..dd206bbcfb8 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/tests/CardDAV/current-user-principal.xml @@ -0,0 +1,150 @@ + + + + + + + + Test DAV:current-user-principal support + + + carddav + + + + + + + own-root + + + Check for authenticated property on / + + PROPFIND + $root: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vcurrent-user-principal/1.xml + + + propfindItems + + okprops + $principaluri1:]]> + + +
+
+ + Check for authenticated property on / (user02) + + PROPFIND + $root: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vcurrent-user-principal/1.xml + + + propfindItems + + okprops + $principaluri2:]]> + + +
+
+
+ + + + Check for authenticated property on / + + PROPFIND + $principalcollection: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vcurrent-user-principal/1.xml + + + propfindItems + + okprops + $principaluri1:]]> + + +
+
+ + Check for unauthenticated property on / + + PROPFIND + $principalcollection: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vcurrent-user-principal/1.xml + + + statusCode + + status + 401 + + +
+
+ + Check for authenticated property on / (user02) + + PROPFIND + $principalcollection: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vcurrent-user-principal/1.xml + + + propfindItems + + okprops + $principaluri2:]]> + + +
+
+
+ + +
diff --git a/apps/dav/tests/travis/carddavtester.sh b/apps/dav/tests/travis/carddavtester.sh new file mode 100644 index 00000000000..a128872f42a --- /dev/null +++ b/apps/dav/tests/travis/carddavtester.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & + + +if [ ! -f CalDAVTester/run.py ]; then + cd "$SCRIPTPATH" + git clone https://github.com/DeepDiver1975/CalDAVTester.git + cd "$SCRIPTPATH/CalDAVTester" + python run.py -s + cd "$SCRIPTPATH" +fi + +# create test user +cd "$SCRIPTPATH/../../../../" +OC_PASS=user01 php occ user:add --password-from-env user01 +OC_PASS=user02 php occ user:add --password-from-env user02 +cd "$SCRIPTPATH/../../../../" + +# run the tests +cd "$SCRIPTPATH/CalDAVTester" +PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/caldavtest/config/serverinfo.xml" -o cdt.txt \ + "$SCRIPTPATH/caldavtest/tests/CardDAV/current-user-principal.xml" + -- cgit v1.2.3