From: Thomas Müller Date: Tue, 12 Jan 2016 12:23:50 +0000 (+0100) Subject: Test ownCloud CardDAV sharing using CalDAVTester X-Git-Tag: v9.0beta1~249^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45baf03a2acbecc46310611f9bd6670b1e93eb00;p=nextcloud-server.git Test ownCloud CardDAV sharing using CalDAVTester --- diff --git a/apps/dav/lib/carddav/addressbook.php b/apps/dav/lib/carddav/addressbook.php index 3e3e751828e..34b580827c1 100644 --- a/apps/dav/lib/carddav/addressbook.php +++ b/apps/dav/lib/carddav/addressbook.php @@ -68,7 +68,7 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareableAddres function getShares() { /** @var CardDavBackend $carddavBackend */ $carddavBackend = $this->carddavBackend; - $carddavBackend->getShares($this->getName()); + return $carddavBackend->getShares($this->getBookId()); } function getACL() { @@ -81,7 +81,26 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareableAddres ]; } - return $acl; + // add the current user + if (isset($this->addressBookInfo['{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal'])) { + $owner = $this->addressBookInfo['{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal']; + $acl[] = [ + 'privilege' => '{DAV:}read', + 'principal' => $owner, + 'protected' => true, + ]; + if ($this->addressBookInfo['{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only']) { + $acl[] = [ + 'privilege' => '{DAV:}write', + 'principal' => $owner, + 'protected' => true, + ]; + } + } + + /** @var CardDavBackend $carddavBackend */ + $carddavBackend = $this->carddavBackend; + return $carddavBackend->applyShareAcl($this->getBookId(), $acl); } function getChildACL() { @@ -94,7 +113,9 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareableAddres ]; } - return $acl; + /** @var CardDavBackend $carddavBackend */ + $carddavBackend = $this->carddavBackend; + return $carddavBackend->applyShareAcl($this->getBookId(), $acl); } function getChild($name) { @@ -105,4 +126,8 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareableAddres return new Card($this->carddavBackend, $this->addressBookInfo, $obj); } + private function getBookId() { + return $this->addressBookInfo['id']; + } + } diff --git a/apps/dav/lib/carddav/card.php b/apps/dav/lib/carddav/card.php index 5ec9a7e93a9..d848f2e28ec 100644 --- a/apps/dav/lib/carddav/card.php +++ b/apps/dav/lib/carddav/card.php @@ -33,7 +33,13 @@ class Card extends \Sabre\CardDAV\Card { ]; } - return $acl; + /** @var CardDavBackend $carddavBackend */ + $carddavBackend = $this->carddavBackend; + return $carddavBackend->applyShareAcl($this->getBookId(), $acl); + } + + private function getBookId() { + return $this->addressBookInfo['id']; } } diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php index e8a5a776646..3a98fd6e810 100644 --- a/apps/dav/lib/carddav/carddavbackend.php +++ b/apps/dav/lib/carddav/carddavbackend.php @@ -53,6 +53,10 @@ class CardDavBackend implements BackendInterface, SyncSupport { 'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME', 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD'); + const ACCESS_OWNER = 1; + const ACCESS_READ_WRITE = 2; + const ACCESS_READ = 3; + /** * CardDavBackend constructor. * @@ -109,14 +113,11 @@ class CardDavBackend implements BackendInterface, SyncSupport { $principals[]= $principalUri; $query = $this->db->getQueryBuilder(); - $query2 = $this->db->getQueryBuilder(); - $query2->select(['resourceid']) - ->from('dav_shares') - ->where($query2->expr()->in('principaluri', $query2->createParameter('principaluri'))) - ->andWhere($query2->expr()->eq('type', $query2->createParameter('type'))); - $result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken']) - ->from('addressbooks') - ->where($query->expr()->in('id', $query->createFunction($query2->getSQL()))) + $result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.uri', 's.access']) + ->from('dav_shares', 's') + ->join('s', 'addressbooks', 'a', 's.resourceid = a.id') + ->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri'))) + ->andWhere($query->expr()->eq('s.type', $query->createParameter('type'))) ->setParameter('type', 'addressbook') ->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY) ->execute(); @@ -125,11 +126,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { $addressBooks[] = [ 'id' => $row['id'], 'uri' => $row['uri'], - 'principaluri' => $row['principaluri'], + 'principaluri' => $principalUri, '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'], + '{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => $row['access'] === self::ACCESS_READ, ]; } $result->closeCursor(); @@ -782,12 +785,14 @@ class CardDavBackend implements BackendInterface, SyncSupport { // remove the share if it already exists $this->unshare($addressBookUri, $element['href']); + $access = $element['readOnly'] ? self::ACCESS_READ : self::ACCESS_READ_WRITE; + $newUri = sha1($addressBookUri . $addressBook['principaluri']); $query = $this->db->getQueryBuilder(); $query->insert('dav_shares') ->values([ 'principaluri' => $query->createNamedParameter($parts[1]), - 'uri' => $query->createNamedParameter($addressBookUri), + 'uri' => $query->createNamedParameter($newUri), 'type' => $query->createNamedParameter('addressbook'), 'access' => $query->createNamedParameter(0), 'resourceid' => $query->createNamedParameter($addressBook['id']) @@ -835,11 +840,11 @@ class CardDavBackend implements BackendInterface, SyncSupport { * * @return array */ - public function getShares($addressBookUri) { + public function getShares($addressBookId) { $query = $this->db->getQueryBuilder(); $result = $query->select(['principaluri', 'access']) ->from('dav_shares') - ->where($query->expr()->eq('uri', $query->createNamedParameter($addressBookUri))) + ->where($query->expr()->eq('resourceid', $query->createNamedParameter($addressBookId))) ->andWhere($query->expr()->eq('type', $query->createNamedParameter('addressbook'))) ->execute(); @@ -850,7 +855,8 @@ class CardDavBackend implements BackendInterface, SyncSupport { 'href' => "principal:${p['uri']}", 'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '', 'status' => 1, - 'readOnly' => ($row['access'] === 1) + 'readOnly' => ($row['access'] === self::ACCESS_READ), + '{'.\OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD.'}principal' => $p['uri'] ]; } @@ -945,4 +951,29 @@ class CardDavBackend implements BackendInterface, SyncSupport { return (int)$cardIds['id']; } + + /** + * @param $addressBookId + * @param $acl + * @return array + */ + public function applyShareAcl($addressBookId, $acl) { + + $shares = $this->getShares($addressBookId); + foreach ($shares as $share) { + $acl[] = [ + 'privilege' => '{DAV:}read', + 'principal' => $share['{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'], + 'protected' => true, + ]; + if (!$share['readOnly']) { + $acl[] = [ + 'privilege' => '{DAV:}write', + 'principal' => $share['{' . \OCA\DAV\CardDAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'], + 'protected' => true, + ]; + } + } + return $acl; + } } diff --git a/apps/dav/lib/carddav/sharing/plugin.php b/apps/dav/lib/carddav/sharing/plugin.php index 7ad3f43dca8..d25b84d01f3 100644 --- a/apps/dav/lib/carddav/sharing/plugin.php +++ b/apps/dav/lib/carddav/sharing/plugin.php @@ -34,6 +34,8 @@ use Sabre\HTTP\ResponseInterface; class Plugin extends ServerPlugin { + const NS_OWNCLOUD = 'http://owncloud.org/ns'; + /** @var Auth */ private $auth; @@ -100,7 +102,7 @@ class Plugin extends ServerPlugin { function initialize(Server $server) { $this->server = $server; $server->resourceTypeMapping['OCA\\DAV\CardDAV\\ISharedAddressbook'] = '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}shared'; - $this->server->xml->elementMap['{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}share'] = 'OCA\\DAV\\CardDAV\\Sharing\\Xml\\ShareRequest'; + $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = 'OCA\\DAV\\CardDAV\\Sharing\\Xml\\ShareRequest'; $this->server->on('method:POST', [$this, 'httpPost']); } @@ -148,7 +150,7 @@ class Plugin extends ServerPlugin { // Dealing with the 'share' document, which modified invitees on a // calendar. - case '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}share' : + case '{' . self::NS_OWNCLOUD . '}share' : // We can only deal with IShareableCalendar objects if (!$node instanceof IShareableAddressBook) { diff --git a/apps/dav/lib/carddav/sharing/xml/sharerequest.php b/apps/dav/lib/carddav/sharing/xml/sharerequest.php index 6be6bd795a1..bd55dd4073e 100644 --- a/apps/dav/lib/carddav/sharing/xml/sharerequest.php +++ b/apps/dav/lib/carddav/sharing/xml/sharerequest.php @@ -20,6 +20,7 @@ */ namespace OCA\DAV\CardDAV\Sharing\Xml; +use OCA\DAV\CardDAV\Sharing\Plugin; use Sabre\Xml\Reader; use Sabre\Xml\XmlDeserializable; @@ -44,32 +45,32 @@ class ShareRequest implements XmlDeserializable { static function xmlDeserialize(Reader $reader) { - $elems = $reader->parseInnerTree([ - '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV. '}set' => 'Sabre\\Xml\\Element\\KeyValue', - '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', + $elements = $reader->parseInnerTree([ + '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', + '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', ]); $set = []; $remove = []; - foreach ($elems as $elem) { + foreach ($elements as $elem) { switch ($elem['name']) { - case '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}set' : + case '{' . Plugin::NS_OWNCLOUD . '}set' : $sharee = $elem['value']; - $sumElem = '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}summary'; - $commonName = '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}common-name'; + $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; + $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; $set[] = [ 'href' => $sharee['{DAV:}href'], 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, - 'readOnly' => !array_key_exists('{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}read-write', $sharee), + 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), ]; break; - case '{' . \Sabre\CardDAV\Plugin::NS_CARDDAV . '}remove' : + case '{' . Plugin::NS_OWNCLOUD . '}remove' : $remove[] = $elem['value']['{DAV:}href']; break; diff --git a/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd b/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd deleted file mode 100644 index d642f4f90cd..00000000000 --- a/apps/dav/tests/travis/caldavtest/config/serverinfo.dtd +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/dav/tests/travis/caldavtest/config/serverinfo.xml b/apps/dav/tests/travis/caldavtest/config/serverinfo.xml deleted file mode 100644 index c80e47f9481..00000000000 --- a/apps/dav/tests/travis/caldavtest/config/serverinfo.xml +++ /dev/null @@ -1,854 +0,0 @@ - - - - - - - - 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/users/ - - - - - $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:users/$userid%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/data/Resource/CardDAV/sharing/read-write/1.xml b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/1.xml new file mode 100644 index 00000000000..20d2ebf4cfc --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/1.xml @@ -0,0 +1,8 @@ + + + + principal:principals/users/user02 + My Shared Calendar + + + diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/4.xml b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/4.xml new file mode 100644 index 00000000000..fd0f248bb31 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/4.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/6.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/6.vcf new file mode 100644 index 00000000000..6b53f8ba3bf --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/6.vcf @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:3.0 +N:Thompson;Default;;; +FN:Default Thompson +EMAIL;TYPE=INTERNET,WORK,pref:lthompson@example.com +TEL;TYPE=WORK,pref:1-555-555-5555 +TEL;TYPE=CELL:1-555-555-5555 +ITEM1.ADR;TYPE=WORK,pref:;;2 Lag;Elk Forest;California;99999;USA +ITEM1.X-ABADR:us +UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/7.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/7.vcf new file mode 100644 index 00000000000..27fdb9fae5f --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/7.vcf @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:3.0 +N:Thompson;Default;;; +FN:Default Thompson +EMAIL;TYPE=INTERNET,WORK,pref:lthompson@example.net +TEL;TYPE=WORK,pref:1-555-555-5555 +TEL;TYPE=CELL:1-555-555-6666 +ITEM1.ADR;TYPE=WORK,pref:;;2 Lag;Elk Forest;California;99999;USA +ITEM1.X-ABADR:us +UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/8.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/8.vcf new file mode 100644 index 00000000000..9188fdd913c --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/8.vcf @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:3.0 +N:Miller;Default;;; +FN:Default Miller +EMAIL;TYPE=INTERNET,WORK,pref:lthompson@example.com +TEL;TYPE=WORK,pref:1-555-555-5555 +TEL;TYPE=CELL:1-555-555-5555 +ITEM1.ADR;TYPE=WORK,pref:;;2 Lag;Elk Forest;California;99999;USA +ITEM1.X-ABADR:us +UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/9.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/9.vcf new file mode 100644 index 00000000000..1ca0a36ca4c --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/sharing/read-write/9.vcf @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:3.0 +N:Smith;Default;;; +FN:Default Smith +EMAIL;TYPE=INTERNET,WORK,pref:lthompson@example.com +TEL;TYPE=WORK,pref:1-555-555-5555 +TEL;TYPE=CELL:1-555-555-5555 +ITEM1.ADR;TYPE=WORK,pref:;;2 Lag;Elk Forest;California;99999;USA +ITEM1.X-ABADR:us +UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vcurrent-user-principal/1.xml b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vcurrent-user-principal/1.xml new file mode 100644 index 00000000000..dffedc6880d --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vcurrent-user-principal/1.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/1.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/1.vcf new file mode 100644 index 00000000000..2121c65f1f4 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/1.vcf @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:3.0 +N:Thompson;Default;;; +FN:Default Thompson +EMAIL;type=INTERNET;type=WORK;type=pref:lthompson@example.com +TEL;type=WORK;type=pref:1-555-555-5555 +TEL;type=CELL:1-555-555-5555 +item1.ADR;type=WORK;type=pref:;;2 Lag;Elk Forest;California;99999;USA +item1.X-ABADR:us +UID:ED7A5AEC-AB19-4CE0-AD6A-2923A3E5C4E1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/2.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/2.vcf new file mode 100644 index 00000000000..390a3d8ae69 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/2.vcf @@ -0,0 +1,17 @@ +BEGIN:VCARD +VERSION:3.0 +N:Contact;Mulberry;;; +FN:Mulberry Contact +NICKNAME:mulberry +ORG:Apple Inc.; +EMAIL;type=INTERNET;type=WORK;type=pref:mulberry_contact@example.com +TEL;type=HOME;type=pref:555-555-5555 +TEL;type=WORK:555-555-5555 +TEL;type=WORK;type=FAX:555-555-5555 +item1.ADR;type=WORK;type=pref:;;1 Infinite Circle;Exampletino\, CA 99999;USA;; +item1.X-ABADR:us +NOTE:This is a contact created in Mulberry. +item2.URL;type=pref:http://www.example.com/~magic +item2.X-ABLabel:_$!!$_ +UID:782DAAF92CB1ED1BC155CDB3@D76FAF7B10D9E8D2D41F779D +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/3.vcf b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/3.vcf new file mode 100644 index 00000000000..37c3b81bdcf --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/put/3.vcf @@ -0,0 +1,12 @@ +BEGIN:VCARD +VERSION:3.0 +N:Kawado;Saeko;;; +FN:Snow Leopard +ORG:Snow Leopard; +EMAIL;type=INTERNET;type=WORK;type=pref:snowleopard_apple@example.com +TEL;type=WORK;type=pref:555-555-5555 +item1.ADR;type=WORK;type=pref:;;2 Fidel Ave. Suite 1;Mountain Top;CA;99999;USA +item1.X-ABADR:us +X-ABShowAs:COMPANY +UID:FCBA0FA3-00B2-4C95-B4EC-4CCC4843F8B1:ABPerson +END:VCARD diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/1.xml b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/1.xml new file mode 100644 index 00000000000..7f454b38900 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/1.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/2.xml b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/2.xml new file mode 100644 index 00000000000..99ee3dbb0e0 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/data/Resource/CardDAV/vreports/sync/2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/dav/tests/travis/caldavtest/serverinfo.dtd b/apps/dav/tests/travis/caldavtest/serverinfo.dtd new file mode 100644 index 00000000000..d642f4f90cd --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/serverinfo.dtd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/dav/tests/travis/caldavtest/serverinfo.xml b/apps/dav/tests/travis/caldavtest/serverinfo.xml new file mode 100644 index 00000000000..dea8f5af0f3 --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/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/users/ + + + + + $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:users/$userid%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/sharing-addressbooks.xml b/apps/dav/tests/travis/caldavtest/tests/CardDAV/sharing-addressbooks.xml new file mode 100644 index 00000000000..046c3d59dbd --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/tests/CardDAV/sharing-addressbooks.xml @@ -0,0 +1,246 @@ + + + + + + Test addressbook sharing + + + carddav + + + + + + + + POST invitation + + POST + $addressbookpath1: + + text/xml; charset=utf-8 + Resource/CardDAV/sharing/read-write/1.xml + + + statusCode + + + + + Shared addressbook exists + + PROPFIND + $addressbookpath1:/ +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/sharing/read-write/4.xml + + + xmlElementMatch + + exists + $verify-property-prefix:/{DAV:}owner/{DAV:}href[=$principaluri1:] + $verify-property-prefix:/{DAV:}resourcetype/{DAV:}collection + $verify-property-prefix:/{DAV:}resourcetype/{urn:ietf:params:xml:ns:carddav}addressbook + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}read + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}write + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}bind + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}unbind + + + notexists + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}admin + $verify-property-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}all + + +
+
+ + + Shared calendar exists Depth:1 + + PROPFIND + $addressbookhome2:/ +
+ Depth + 1 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/sharing/read-write/4.xml + + + xmlElementMatch + + parent + $multistatus-response-prefix:[^{DAV:}href=$addressbookhome2:/ade1a55d408167e8ff77611c0eebe8f80579b549/] + + + exists + + $verify-response-prefix:/{DAV:}resourcetype/{DAV:}collection + $verify-response-prefix:/{DAV:}resourcetype/{urn:ietf:params:xml:ns:carddav}addressbook + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}read + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}write + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}bind + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}unbind + + + notexists + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}admin + $verify-response-prefix:/{DAV:}current-user-privilege-set/{DAV:}privilege/{DAV:}all + + +
+
+ + + Original calendar unchanged + + PROPFIND + $addressbookpath1: +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/sharing/read-write/4.xml + + + xmlElementMatch + + exists + $verify-property-prefix:/{DAV:}owner/{DAV:}href[=$principaluri1:] + + +
+
+ + + Sharee creates contact + + PUT + $addressbookpath1:/1.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/sharing/read-write/6.vcf + + + statusCode + + + + + + Sharer sees contact + + GET + $addressbookpath1:/1.vcf + + addressDataMatch + + filepath + Resource/CardDAV/sharing/read-write/6.vcf + + + + + + + Sharer changes contact + + PUT + $addressbookpath1:/1.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/sharing/read-write/7.vcf + + + statusCode + + + + + + Sharee sees changed contact + + GET + $addressbookpath1:/1.vcf + + addressDataMatch + + filepath + Resource/CardDAV/sharing/read-write/7.vcf + + + + + + + Sharer creates event + + PUT + $addressbookpath1:/2.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/sharing/read-write/8.vcf + + + statusCode + + + + + Sharee sees new event + + GET + $addressbookpath1:/2.vcf + + addressDataMatch + + filepath + Resource/CardDAV/sharing/read-write/8.vcf + + + + + + Sharee changes event + + PUT + $addressbookpath1:/2.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/sharing/read-write/9.vcf + + + statusCode + + + + + Sharer sees changed event + + GET + $addressbookpath1:/2.vcf + + addressDataMatch + + filepath + Resource/CardDAV/sharing/read-write/9.vcf + + + + +
+ + + + +
diff --git a/apps/dav/tests/travis/carddav/script.sh b/apps/dav/tests/travis/carddav/script.sh index 46a6a98e273..a8bd9f11b38 100644 --- a/apps/dav/tests/travis/carddav/script.sh +++ b/apps/dav/tests/travis/carddav/script.sh @@ -9,9 +9,12 @@ sleep 30 # 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" \ - "$SCRIPTPATH/../caldavtest/tests/CardDAV/sync-report.xml" +PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail --basedir "$SCRIPTPATH/../caldavtest/" -o cdt.txt \ + "CardDAV/current-user-principal.xml" \ + "CardDAV/sync-report.xml" \ + "CardDAV/sharing-addressbooks.xml" + + RESULT=$? tail "$/../../../../../data-autotest/owncloud.log"