From: Thomas Müller Date: Mon, 23 Nov 2015 12:53:57 +0000 (+0100) Subject: Adding sync support - including dav tests X-Git-Tag: v9.0beta1~677^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d28390a6499135dfd30c925d2d0735cb15eced34;p=nextcloud-server.git Adding sync support - including dav tests --- diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php index 44afcf23df6..587c0091e23 100644 --- a/apps/dav/lib/server.php +++ b/apps/dav/lib/server.php @@ -39,6 +39,7 @@ class Server { $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ListenerPlugin($dispatcher)); + $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin()); // calendar plugins $this->server->addPlugin(new \Sabre\CalDAV\Plugin()); diff --git a/apps/dav/tests/travis/caldavtest/config/serverinfo.xml b/apps/dav/tests/travis/caldavtest/config/serverinfo.xml index b85a8639e4e..24d63d4a3ae 100644 --- a/apps/dav/tests/travis/caldavtest/config/serverinfo.xml +++ b/apps/dav/tests/travis/caldavtest/config/serverinfo.xml @@ -569,7 +569,7 @@ $addressbookhome%d: - $addressbooks_uids:$userguid%d: + $addressbooks:$userid%d: diff --git a/apps/dav/tests/travis/caldavtest/tests/CardDAV/sync-report.xml b/apps/dav/tests/travis/caldavtest/tests/CardDAV/sync-report.xml new file mode 100644 index 00000000000..0321e61edbc --- /dev/null +++ b/apps/dav/tests/travis/caldavtest/tests/CardDAV/sync-report.xml @@ -0,0 +1,1602 @@ + + + + + + + + + carddav + sync-report + + + + + PUT + $addressbookpath1:/1.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/vreports/put/1.vcf + + + + PUT + $addressbookpath1:/2.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/vreports/put/2.vcf + + + + + + + Not on addressbooks + + PROPFIND + $addressbooks:/ +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vreports/sync/1.xml + + + xmlElementMatch + + notexists + $verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection + + + + propfindItems + + okprops + {DAV:}supported-report-set + + + badprops + {DAV:}sync-token + + +
+
+ + + On addressbook + + PROPFIND + $addressbookpath1:/ +
+ Depth + 0 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vreports/sync/1.xml + + + xmlElementMatch + + exists + $verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection + + + + + + propfindItems + + okprops + {DAV:}supported-report-set + {DAV:}sync-token + + +
+
+
+ + + + initial query - addressbook depth:1 + + REPORT + $addressbookpath1:/ +
+ Depth + 1 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vreports/sync/2.xml + + + multistatusItems + + okhrefs + + + 1.vcf + 2.vcf + + +
+
+ + + add new resource + + PUT + $addressbookpath1:/3.vcf + + text/vcard; charset=utf-8 + Resource/CardDAV/vreports/put/3.vcf + + + statusCode + + + + + new resource - addressbook depth:1 + + REPORT + $addressbookpath1:/ +
+ Depth + 1 +
+ + text/xml; charset=utf-8 + Resource/CardDAV/vreports/sync/2.xml + + + multistatusItems + + okhrefs + + + 1.vcf + 2.vcf + 3.vcf + + +
+
+ +
+ + + + + + DELETEALL + $addressbookhome1:/ + $addressbookhome2:/ + $notificationpath1:/ + $notificationpath2:/ + + + +
diff --git a/apps/dav/tests/travis/carddavtester.sh b/apps/dav/tests/travis/carddavtester.sh index a128872f42a..fee4d0d74af 100644 --- a/apps/dav/tests/travis/carddavtester.sh +++ b/apps/dav/tests/travis/carddavtester.sh @@ -18,11 +18,14 @@ fi # create test user cd "$SCRIPTPATH/../../../../" OC_PASS=user01 php occ user:add --password-from-env user01 +php occ dav:create-addressbook user01 addressbook OC_PASS=user02 php occ user:add --password-from-env user02 +php occ dav:create-addressbook user02 addressbook 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" + "$SCRIPTPATH/caldavtest/tests/CardDAV/current-user-principal.xml" \ + "$SCRIPTPATH/caldavtest/tests/CardDAV/sync-report.xml"