pdsinterop / test-suites

Test suites for protocols a Personal Data Store may support
https://pdsinterop.org/test-suites/
MIT License
2 stars 11 forks source link

Initial Open Cloud Mesh tests #19

Closed michielbdejong closed 4 years ago

michielbdejong commented 4 years ago

From https://github.com/nextcloud/server/pull/9345 it seems I need to enable the cloud_federation_api app in nextcloud-server for the https://server/ocm-provider/ end point to appear, but I can't get it working yet

michielbdejong commented 4 years ago

Hm, tried this:

docker build -t nextcloud-server ./servers/nextcloud-server
docker run -p 443:443 -d --rm --name=server nextcloud-server
echo sleeping
sleep 10
echo slept
docker logs server
docker exec -u www-data -it server sh /init.sh

But the output said:

Nextcloud was successfully installed
  - installed: true
  - version: 19.0.0.12
  - versionstring: 19.0.0
  - edition: 
pdsinterop enabled
cloud_federation_api already enabled

So apparently cloud_federation_api is enabled by default. I can now log in on https://localhost/ with alice / nextcloud123.

I can also:

curl -k https://localhost/ocm-provider/
{"enabled":true,"apiVersion":"1.0-proposal1","endPoint":"https:\/\/localhost\/ocm","resourceTypes":[{"name":"file","shareTypes":["user","group"],"protocols":{"webdav":"\/public.php\/webdav\/"}}]}
michielbdejong commented 4 years ago

The following also works:

docker build -t nextcloud-server ./servers/nextcloud-server
docker run -p 443:443 -d --rm --name=server nextcloud-server
echo sleeping
sleep 10
echo slept
docker logs server
docker exec -u www-data -it server sh /init.sh
cd testers/open-cloud-mesh/tester/
npm run local

But for some reason, it doesn't work when I try it with ./runTesterAgainstServer.sh open-cloud-mesh nextcloud-server.

michielbdejong commented 4 years ago

I can't get it working in my Docker testnet but on localhost it works so I'll merge this and create follow-up issues for that, and for:


cd ./testers/open-cloud-mesh/tester
npm install
SERVER_ROOT=https://demo.owncloud.org npm run jest

> open-cloud-mesh-tests@1.0.0 jest /Users/michiel/gh/pdsinterop/test-suites/testers/open-cloud-mesh/tester
> jest

 FAIL  test/surface/discovery.test.ts
  ● Discovery at /ocm-provider/ › contains service description

    expect(received).toEqual(expected) // deep equality

    - Expected  - 6
    + Received  + 2

      Object {
        "apiVersion": "1.0-proposal1",
        "enabled": true,
    -   "endPoint": "https://localhost/ocm",
    -   "resourceTypes": Array [
    +   "endPoint": "https://demo.owncloud.org/apps/federatedfilesharing",
    +   "shareTypes": Array [
          Object {
            "name": "file",
            "protocols": Object {
              "webdav": "/public.php/webdav/",
            },
    -       "shareTypes": Array [
    -         "user",
    -         "group",
    -       ],
          },
        ],
      }