Skip to content

Commit 578cec8

Browse files
[tests-only] provide and document an easy way to run all tests locally (#1073)
1 parent fd3f0b7 commit 578cec8

20 files changed

+466
-3
lines changed

.drone.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ steps:
249249
image: golang:1.13
250250
detach: true
251251
commands:
252-
- cd /drone/src/drone/oc-integration-tests/
252+
- cd /drone/src/tests/oc-integration-tests/drone/
253253
- /drone/src/cmd/revad/revad -c frontend.toml &
254254
- /drone/src/cmd/revad/revad -c gateway.toml &
255255
- /drone/src/cmd/revad/revad -c storage-home.toml &
@@ -289,7 +289,7 @@ steps:
289289
image: golang:1.13
290290
detach: true
291291
commands:
292-
- cd /drone/src/drone/oc-integration-tests/
292+
- cd /drone/src/tests/oc-integration-tests/drone/
293293
- /drone/src/cmd/revad/revad -c frontend.toml &
294294
- /drone/src/cmd/revad/revad -c gateway.toml &
295295
- /drone/src/cmd/revad/revad -c storage-home.toml &
@@ -330,7 +330,7 @@ steps:
330330
image: golang:1.13
331331
detach: true
332332
commands:
333-
- cd /drone/src/drone/oc-integration-tests/
333+
- cd /drone/src/tests/oc-integration-tests/drone/
334334
- /drone/src/cmd/revad/revad -c frontend.toml &
335335
- /drone/src/cmd/revad/revad -c gateway.toml &
336336
- /drone/src/cmd/revad/revad -c shares.toml &

README.md

+80
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,86 @@ $ ../../cmd/revad/revad -dev-dir .
3131

3232
You can also read the [build from sources guide](https://reva.link/docs/getting-started/build-reva/).
3333

34+
## Run tests
35+
36+
### unit tests / GRPC tests
37+
`make test`
38+
39+
### litmus tests
40+
1. start the needed services
41+
```
42+
cd tests/oc-integration-tests/local
43+
../../../cmd/revad/revad -c frontend.toml &
44+
../../../cmd/revad/revad -c gateway.toml &
45+
../../../cmd/revad/revad -c storage-home.toml &
46+
../../../cmd/revad/revad -c storage-oc.toml &
47+
../../../cmd/revad/revad -c users.toml
48+
```
49+
50+
2. run litmus tests:
51+
```
52+
docker run --rm --network=host\
53+
-e LITMUS_URL=http://localhost:20080/remote.php/webdav \
54+
-e LITMUS_USERNAME=einstein \
55+
-e LITMUS_PASSWORD=relativity \
56+
owncloud/litmus:latest
57+
```
58+
59+
- add `TESTS` env. variable to test only a subset of tests e.g `-e TESTS="basic http copymove props"`
60+
- change `LITMUS_URL` for other tests e.g. `-e LITMUS_URL=http://localhost:20080/remote.php/dav/files/einstein` or to a public-share link
61+
62+
### ownCloud legacy integration tests
63+
1. start an LDAP server
64+
```
65+
docker run --rm --hostname ldap.my-company.com \
66+
-e LDAP_TLS_VERIFY_CLIENT=never \
67+
-e LDAP_DOMAIN=owncloud.com \
68+
-e LDAP_ORGANISATION=ownCloud \
69+
-e LDAP_ADMIN_PASSWORD=admin \
70+
--name docker-slapd \
71+
-p 127.0.0.1:389:389 \
72+
-p 636:636 -d osixia/openldap
73+
```
74+
2. start a REDIS server
75+
```
76+
docker run --rm -e REDIS_DATABASES=1 -p 6379:6379 -d webhippie/redis:latest
77+
```
78+
3. start the needed services
79+
```
80+
cd tests/oc-integration-tests/local
81+
../../../cmd/revad/revad -c frontend.toml &
82+
../../../cmd/revad/revad -c gateway.toml &
83+
../../../cmd/revad/revad -c shares.toml &
84+
../../../cmd/revad/revad -c storage-home.toml &
85+
../../../cmd/revad/revad -c storage-oc.toml &
86+
../../../cmd/revad/revad -c storage-publiclink.toml &
87+
../../../cmd/revad/revad -c ldap-users.toml
88+
```
89+
90+
4. clone ownCloud 10
91+
`git clone https://github.com/owncloud/core.git ./testrunner`
92+
93+
5. clone the testing app
94+
`git clone https://github.com/owncloud/testing.git ./testrunner/apps/testing`
95+
96+
6. run the tests
97+
```
98+
cd testrunner
99+
TEST_SERVER_URL='http://localhost:20080' \
100+
OCIS_REVA_DATA_ROOT='/var/tmp/reva/' \
101+
SKELETON_DIR='./apps/testing/data/apiSkeleton' \
102+
TEST_EXTERNAL_USER_BACKENDS='true' \
103+
REVA_LDAP_HOSTNAME='localhost' \
104+
TEST_OCIS='true' \
105+
TEST_REVA='true' \
106+
BEHAT_FILTER_TAGS='~@skipOnOcis&&~@skipOnOcis-OC-Storage' \
107+
make test-acceptance-api
108+
```
109+
110+
This will run all tests that are relevant to reva.
111+
112+
To run a single test add BEHAT_FEATURE=<feature file> and specify the path to the feature file and an optional line number. For example: BEHAT_FEATURE='tests/acceptance/features/apiWebdavUpload1/uploadFile.feature:12'
113+
34114
## Daily releases
35115
On every commit on the master branch (including merged Pull Requests) a new release will be created and
36116
available at [daily releases](https://reva-releases.web.cern.ch/reva-releases).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[shared]
2+
jwt_secret = "Pive-Fumkiu4"
3+
gatewaysvc = "localhost:19000"
4+
5+
# This frontend.toml config file will start a reva service that:
6+
# - serves as the entrypoint for owncloud APIs.
7+
# - serves http endpoints on port 20080
8+
# - / --------------- ocdav
9+
# - /ocs ------------ ocs
10+
# - /oauth2 --------- oidcprovider
11+
# - /.well-known ---- wellknown service to announce openid-configuration
12+
# - TODO(diocas): ocm
13+
# - authenticates requests using oidc bearer auth and basic auth as fallback
14+
# - serves the grpc services on port 20099
15+
[grpc]
16+
address = "0.0.0.0:20099"
17+
18+
[grpc.services.authprovider]
19+
auth_manager = "oidc"
20+
21+
# If you want to use your own openid provider change this config
22+
[grpc.services.authprovider.auth_managers.oidc]
23+
issuer = "http://localhost:20080"
24+
25+
[http]
26+
address = "0.0.0.0:20080"
27+
28+
[http.middlewares.cors]
29+
allow_credentials = true
30+
31+
[http.services.ocdav]
32+
# serve ocdav on the root path
33+
prefix = ""
34+
chunk_folder = "/var/tmp/reva/chunks"
35+
# for user lookups
36+
# prefix the path of requests to /dav/files with this namespace
37+
# While owncloud has only listed usernames at this endpoint CERN has
38+
# been exposing more than just usernames. For owncloud deployments we
39+
# can prefix the path to jail the requests to the correct CS3 namespace.
40+
# In this deployment we mounted the owncloud storage provider at /oc. It
41+
# expects a username as the first path segment.
42+
# currently, only the desktop client will use this endpoint, but only if
43+
# the dav.chunking capability is available
44+
# TODO implement a path wrapper that rewrites `<username>` into the path
45+
# layout for the users home?
46+
# no, use GetHome?
47+
# for eos we need to rewrite the path
48+
# TODO strip the username from the path so the CS3 namespace can be mounted
49+
# at the files/<username> endpoint? what about migration? separate reva instance
50+
files_namespace = "/oc"
51+
52+
# similar to the dav/files endpoint we can configure a prefix for the old webdav endpoint
53+
# we use the old webdav endpoint to present the cs3 namespace
54+
# note: this changes the tree that is rendered at remote.php/webdav from the users home to the cs3 namespace
55+
# use webdav_namespace = "/home" to use the old namespace that only exposes the users files
56+
# this endpoint should not affect the desktop client sync but will present different folders for the other clients:
57+
# - the desktop clients use a hardcoded remote.php/dav/files/<username> if the dav.chunkung capability is present
58+
# - the ios ios uses the core.webdav-root capability which points to remote.php/webdav in oc10
59+
# - the oc js sdk is hardcoded to the remote.php/webdav so it will see the new tree
60+
# - TODO android? no sync ... but will see different tree
61+
webdav_namespace = "/home"
62+
63+
[http.services.ocs]
64+
65+
[http.services.ocs.capabilities.capabilities.core.status]
66+
version = "10.0.11.5"
67+
versionstring = "10.0.11"
68+
69+
[http.services.ocs.capabilities.capabilities.files_sharing]
70+
api_enabled = true
71+
resharing = true
72+
group_sharing = true
73+
auto_accept_share = true
74+
share_with_group_members_only = true
75+
share_with_membership_groups_only = true
76+
default_permissions = 22
77+
search_min_length = 3
78+
79+
[http.services.ocs.capabilities.capabilities.files_sharing.public]
80+
enabled = true
81+
send_mail = true
82+
social_share = true
83+
upload = true
84+
multiple = true
85+
supports_upload_only = true
86+
87+
[http.services.ocs.capabilities.capabilities.files_sharing.public.password]
88+
enforced = true
89+
90+
[http.services.ocs.capabilities.capabilities.files_sharing.public.password.enforced_for]
91+
read_only = true
92+
read_write = true
93+
upload_only = true
94+
95+
[http.services.ocs.capabilities.capabilities.files_sharing.public.expire_date]
96+
enabled = true
97+
98+
[http.services.ocs.capabilities.capabilities.files_sharing.user]
99+
send_mail = true
100+
101+
[http.services.ocs.capabilities.capabilities.files_sharing.user_enumeration]
102+
enabled = true
103+
group_members_only = true
104+
105+
[http.services.ocs.capabilities.capabilities.files_sharing.federation]
106+
outgoing = true
107+
incoming = true
108+
109+
[http.services.ocs.capabilities.capabilities.notifications]
110+
endpoints = ["disable"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[shared]
2+
jwt_secret = "Pive-Fumkiu4"
3+
gatewaysvc = "localhost:19000"
4+
5+
# This gateway.toml config file will start a reva service that:
6+
# - serves as a gateway for all requests
7+
# - looks up the storageprovider using a storageregistry
8+
# - looks up the authprovider using an authregistry
9+
# - serves the gateway on grpc port 19000
10+
# - serves http datagateway on port 19001
11+
# - /data - datagateway: file up and download
12+
[grpc]
13+
address = "0.0.0.0:19000"
14+
15+
[grpc.services.gateway]
16+
# registries
17+
authregistrysvc = "localhost:19000"
18+
storageregistrysvc = "localhost:19000"
19+
# user metadata
20+
preferencessvc = "localhost:18000"
21+
userprovidersvc = "localhost:18000"
22+
# an approvider lives on "localhost:18000" as well, see users.toml
23+
# sharing
24+
usershareprovidersvc = "localhost:17000"
25+
publicshareprovidersvc = "localhost:17000"
26+
# ocm
27+
ocmcoresvc = "localhost:13000"
28+
ocmshareprovidersvc = "localhost:13000"
29+
ocminvitemanagersvc = "localhost:13000"
30+
ocmproviderauthorizersvc = "localhost:13000"
31+
# other
32+
commit_share_to_storage_grant = true
33+
datagateway = "http://localhost:19001/data"
34+
transfer_shared_secret = "replace-me-with-a-transfer-secret" # for direct uploads
35+
transfer_expires = 6 # give it a moment
36+
#disable_home_creation_on_login = true
37+
link_grants_file = "/var/tmp/reva/link_grants_file.json"
38+
39+
[grpc.services.authregistry]
40+
driver = "static"
41+
42+
[grpc.services.authregistry.drivers.static.rules]
43+
publicshares = "localhost:17000" # started with the shares.toml
44+
basic = "localhost:18000" # started with the users.toml
45+
bearer = "localhost:20099" # started with the frontend.toml
46+
47+
[grpc.services.storageregistry]
48+
driver = "static"
49+
50+
[grpc.services.storageregistry.drivers.static]
51+
home_provider = "/home"
52+
53+
[grpc.services.storageregistry.drivers.static.rules]
54+
# mount a home storage provider that uses a context based path wrapper
55+
# to jail users into their home dir
56+
"/home" = "localhost:12000"
57+
58+
# mount a storage provider without a path wrapper for direct access to users.
59+
"/oc" = "localhost:11000"
60+
"123e4567-e89b-12d3-a456-426655440000" = "localhost:11000"
61+
# another mount point might be "/projects/"
62+
63+
"/public" = "localhost:13000"
64+
65+
[http]
66+
address = "0.0.0.0:19001"
67+
68+
[http.services.datagateway]
69+
transfer_shared_secret = "replace-me-with-a-transfer-secret"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[shared]
2+
jwt_secret = "Pive-Fumkiu4"
3+
4+
# This users.toml config file will start a reva service that:
5+
# - handles user metadata and user preferences
6+
# - serves the grpc services on port 18000
7+
[grpc]
8+
address = "0.0.0.0:18000"
9+
10+
[grpc.services.authprovider]
11+
auth_manager = "ldap"
12+
13+
[grpc.services.authprovider.auth_managers.ldap]
14+
hostname="localhost"
15+
port=636
16+
base_dn="dc=owncloud,dc=com"
17+
userfilter="(&(objectclass=posixAccount)(cn=%s*))"
18+
groupfilter="(&(objectclass=posixGroup)(cn=%s*))"
19+
bind_username="cn=admin,dc=owncloud,dc=com"
20+
bind_password="admin"
21+
idp="http://localhost:18000"
22+
[grpc.services.authprovider.auth_managers.ldap.schema]
23+
uid="uid"
24+
displayName="displayName"
25+
dn="dn"
26+
cn="cn"
27+
28+
[grpc.services.userprovider]
29+
driver = "ldap"
30+
31+
[grpc.services.userprovider.drivers.ldap]
32+
hostname="localhost"
33+
port=636
34+
base_dn="dc=owncloud,dc=com"
35+
userfilter="(&(objectclass=posixAccount)(cn=%s*))"
36+
groupfilter="(&(objectclass=posixGroup)(cn=%s*))"
37+
bind_username="cn=admin,dc=owncloud,dc=com"
38+
bind_password="admin"
39+
idp="http://localhost:18000"
40+
41+
[grpc.services.userprovider.drivers.ldap.schema]
42+
uid="uid"
43+
displayName="displayName"
44+
dn="dn"
45+
cn="cn"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[shared]
2+
jwt_secret = "Pive-Fumkiu4"
3+
4+
# GRPC:
5+
# - serves user and public link shares
6+
[grpc]
7+
address = "0.0.0.0:17000"
8+
9+
[grpc.services.usershareprovider]
10+
driver = "memory"
11+
12+
[grpc.services.authprovider]
13+
auth_manager = "publicshares"
14+
15+
[grpc.services.authprovider.auth_managers.publicshares]
16+
gateway_addr = "0.0.0.0:19000"
17+
18+
[grpc.services.publicshareprovider.drivers.json]
19+
file = "/var/tmp/reva/publicshares.json"

0 commit comments

Comments
 (0)