Giter VIP home page Giter VIP logo

test-suites's Introduction

Test Suites for Personal Data Servers

Introduction

The goal of these test suites is to test which open source Personal Data Store implementations comply with which protocol specs.

Info on what each test suite tests

So far, there is only one test suite here, namely webid-provider.

Running testers against servers in a Docker testnet

To summarize the test results, we have opted to build them in Docker (this part was copied from Solid's test-suite), and to run them within that. This documents how to run it:

Prerequisites: Docker

Run the following commands in your command line terminal:

docker build -t webid-provider testers/webid-provider
docker build -t solid-crud testers/solid-crud
docker build -t open-cloud-mesh testers/open-cloud-mesh
docker network create testnet
mkdir  -p reports

bash runTests.sh node-solid-server
bash runTests.sh solid-app-kit
bash runTests.sh php-solid-server
bash runTests.sh nextcloud-server

grep Tests reports/*

Expected output

Note that nextcloud-server and php-solid-server do not have webid-provider functionality enabled yet (we are still working on that). Therefore, the final output should look something like:

reports/nextcloud-server-solid-crud.txt:Tests:       73 failed, 73 total
reports/nextcloud-server-webid-provider.txt:Tests:       14 skipped, 35 passed, 49 total
reports/node-solid-server-solid-crud.txt:Tests:       25 failed, 48 passed, 73 total
reports/node-solid-server-webid-provider.txt:Tests:       14 skipped, 35 passed, 49 total
reports/php-solid-server-solid-crud.txt:Tests:       73 failed, 73 total
reports/php-solid-server-webid-provider.txt:Tests:       11 failed, 14 skipped, 24 passed, 49 total
reports/solid-app-kit-solid-crud.txt:Tests:       73 failed, 73 total
reports/solid-app-kit-webid-provider.txt:Tests:       35 failed, 14 skipped, 49 total

To run one tester against one server interactively, you can do for instance:

./runTesterAgainstServer.sh webid-provider node-solid-server
[...]
root@f0c7e54fb1f3:/# npm run jest
root@f0c7e54fb1f3:/# exit
[...]

Running one of the servers and one of the testers interactively:

In one terminal:

./runServer.sh node-solid-server
# DEBUG=* ./bin/solid-test start

In another terminal:

./runTester.sh webid-provider node-solid-server
# ./node_modules/.bin/jest test/surface/token.test.ts

Running one of the testers

Running the tester Docker images on a Mac outside a testnet will not work straight-forwardly due to https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds.

But to run for instance the webid-provider tester against a URL, you can simply run it outside Docker:

cd testers/webid-provider/tester
npm install
NODE_TLS_REJECT_UNAUTHORIZED=0 ALICE_WEBID=https://localhost/profile/card#me SERVER_ROOT=https://localhost ./node_modules/.bin/jest test/surface/*

Running a server on https://localhost

docker run -d -p 443:443 nextcloud-server

YMMV

Caveat 1: the qualities of a software product can of course not be counted with a simple number of passing tests, so this list only gives a rough idea of levels of Solid spec compliance.

Caveat 2: not all servers may have been configured optimally in these test runs; if you know of ways to improve the outcome for any of these servers, please provide a pull request.

Caveat 3: this test suite still incomplete and heavily biased towards LDP Basic container support.

test-suites's People

Contributors

michielbdejong avatar potherca avatar ylebre avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

test-suites's Issues

Run tests in Travis of each open source server

webid-provider-tests

The following three open source Solid server implementations currently implement the webid-provider role:

Solid CRUD

The following four open source Solid server implementations currently implement the storage role with CRUD:

WAC

The following three open source Solid server implementations currently implement the storage role with WAC:

  • NSS
  • PSS
  • Nextcloud
  • CSS

php-solid-server image not working as expected

When I run:

loopy:php-solid-server michiel$ HOST=127.0.0.1 composer serve-dev
> ENVIRONMENT=development php -S "${HOST:-localhost}:${PORT:-8080}" -t web/ web/index.php

on my host machine, then all openid-config tests pass except for one http/https detail:

loopy:webid-provider-tests michiel$ SERVER_ROOT=http://localhost:8080 ./node_modules/.bin/jest test/surface/fetch-openid-config.test.ts 
 FAIL  test/surface/fetch-openid-config.test.ts
  ● The server's openid configuration › has the server root as the issuer

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

    Expected: "http://localhost:8080"
    Received: "https://localhost:8080"

      27 | 
      28 |   test("has the server root as the issuer", async () => {
    > 29 |     expect(configObj.issuer).toEqual(SERVER_ROOT);
         |                              ^
      30 |   });
      31 | 
      32 |   test("announces a jwks_uri", async () => {

      at test/surface/fetch-openid-config.test.ts:29:30
      at step (test/surface/fetch-openid-config.test.ts:33:23)
      at Object.next (test/surface/fetch-openid-config.test.ts:14:53)
      at test/surface/fetch-openid-config.test.ts:8:71
      at __awaiter (test/surface/fetch-openid-config.test.ts:4:12)
      at Object.<anonymous> (test/surface/fetch-openid-config.test.ts:28:45)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 4 skipped, 12 passed, 17 total
Snapshots:   0 total
Time:        1.214 s, estimated 2 s

But I can't get the same result when running the php-solid-server docker image from this repo.
I tried both in the testnet and on https://localhost/. I get the "Hello, World!" message on / but the /.well-known/openid-configuration endpoint is a 404 somehow. I checked the git version in /app inside the container and it's really at the latest dev branch, and all the code is there. But it's somehow not behaving in the same way as on my host machine.

redis-cli weirdness

root@1cbea575891e:/solid-app-kit# cat test9.txt 
SET a " \":1"
root@1cbea575891e:/solid-app-kit# cat test9.txt |  redis-cli --pipe
All data transferred. Waiting for the last reply...
ERR unknown command '2'
ERR unknown command '$4'
ERR wrong number of arguments for 'echo' command
ERR unknown command '$20'
ERR unknown command ''
^C
root@1cbea575891e:/solid-app-kit# cat test9.txt | head | redis-cli --pipe
All data transferred. Waiting for the last reply...
Last reply received from server.
errors: 0, replies: 1
root@1cbea575891e:/solid-app-kit# 

I don't know what's happening here, but something seems to be going wrong with the way characters are escaped when piping data.txt to redis-cli --pipe. This only happens in the solid-app-kit docker image, not on my Mac OS laptop.

To work around it, I'll just | head, unless I can find the way to fix it properly some day.

Nextcloud /ocm-provider/ works on host but in Docker testnet

https://localhost/ocm-provider/ works when I run with -p 443:443.
But https://server/ocm-provider/ does not work when I run with --network=testnet.
Not sure what causes the difference. Does the server decide only to expose the endpoint locally and not on the public interface?
Is there an old instance running on my Docker testnet that's serving the request instead of the system-under-test?
Will look at it with fresh eyes some other day.

Describing the new token flow

I'll dive deeper into the code and try to reverse-engineer how the protocol is supposed to work on paper.

fix token test against NSS

The token test is currently failing against NSS. They used to work, until we changed them to work for Nextcloud-server. :)

obtaining a cookie for nextcloud-server

The code in https://github.com/solid/webid-provider-tests/blob/master/test/surface/authorize-endpoint.test.ts#L8
was only tested on node-solid-server. I should have a version for nextcloud-server, including:

curl -ki https://localhost/login | grep requesttoken
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5524  100  5524    0     0  71740      0 --:--:-- --:--:-- --:--:-- 71740
 data-requesttoken="BAw3N1zas5Z8O8Z3dbH2tYhaHbSE963wtep3iLap+EU=:Vz1YZgS+mOxNS60cRdaRxu4tTuP0wMaE34IQsfTLkyI=">

and 'user' instead of 'username' in https://github.com/solid/webid-provider-tests/blob/master/test/surface/authorize-endpoint.test.ts#L13

Mismatches in /ocm-provider/ contents

There's a slight difference between the /ocm-provider/ JSON from Nextcloud and from ownCloud. This is the one from ownCloud, compared to the one from Nextcloud:

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

> [email protected] 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",
    -       ],
          },
        ],
      }

Webid-oidc test suite

Gathering some information about Solid's new webid-oidc protocol with DPop, as a basis for writing the test suite for that:

I haven't found any automated tests for it so far, although I guess the solid-auth-fetcher examples can be used for manual testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.