Skip to content

Commit

Permalink
docs: add README in acceptance level
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Nov 20, 2024
1 parent 79912e6 commit 3b642e3
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 140 deletions.
115 changes: 18 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/cs3org/reva?status.svg)](https://godoc.org/github.com/cs3org/reva)
[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva) [![Build Status](https://drone.cernbox.cern.ch/api/badges/cs3org/reva/status.svg)](https://drone.cernbox.cern.ch/cs3org/reva)
[![Go Report Card](https://goreportcard.com/badge/github.com/cs3org/reva)](https://goreportcard.com/report/github.com/cs3org/reva) [![codecov](https://codecov.io/gh/cs3org/reva/branch/master/graph/badge.svg)](https://codecov.io/gh/cs3org/reva) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B11650%2Fcs3org%2Freva.svg?type=shield)](https://app.fossa.com/projects/custom%2B11650%2Fcs3org%2Freva?ref=badge_shield)
[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva) [![Build Status](https://drone.cernbox.cern.ch/api/badges/cs3org/reva/status.svg)](https://drone.cernbox.cern.ch/cs3org/reva)
[![Go Report Card](https://goreportcard.com/badge/github.com/cs3org/reva)](https://goreportcard.com/report/github.com/cs3org/reva) [![codecov](https://codecov.io/gh/cs3org/reva/branch/master/graph/badge.svg)](https://codecov.io/gh/cs3org/reva) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B11650%2Fcs3org%2Freva.svg?type=shield)](https://app.fossa.com/projects/custom%2B11650%2Fcs3org%2Freva?ref=badge_shield)
================




![REVA Logo](https://raw.githubusercontent.com/cs3org/logos/efd3d2649478193e74f3de5a41247445941026b6/reva/logo.jpg)

REVA is an interoperability platform. It connects storage, sync and share platforms and application providers, and it does it in a vendor and platform neutral way by using the [CS3 APIS](https://github.com/cs3org/cs3apis).

## Installation

Head to [Documentation](https://reva.link) for documentation or [download](https://github.com/cs3org/reva/releases) to get the latest available release.

## Documentation & Support
Read the [getting started guide](https://reva.link/docs/getting-started/) and the other feature guides.

Read the [getting started guide](https://reva.link/docs/getting-started/) and the other feature guides.

## Build and run it yourself
You need to have [Go](https://golang.org/doc/install) (version 1.16 or higher), [git](https://git-scm.com/) and [make](https://en.wikipedia.org/wiki/Make_(software)) installed. Some of these commands may require `sudo`, depending on your system setup.

You need to have [Go](https://golang.org/doc/install) (version 1.16 or higher), [git](https://git-scm.com/) and [make](<https://en.wikipedia.org/wiki/Make_(software)>) installed. Some of these commands may require `sudo`, depending on your system setup.

```
$ git clone https://github.com/cs3org/reva
Expand Down Expand Up @@ -55,12 +54,14 @@ To run all of them you can do `make test`.
If you see `TestGetManagerWithInvalidUser/Nil_in_user` fail, [try removing](https://github.com/cs3org/reva/issues/1736) `/etc/revad/users.json` on your system.

To run a single one of them you can do:

```sh
$ go test `go list ./pkg/utils/...`
ok github.com/cs3org/reva/v2/pkg/utils 0.374s
```

### Integration tests (GRPC)

See [tests/integration](https://github.com/cs3org/reva/tree/master/tests/integration).
This requires Redis.

Expand All @@ -74,9 +75,11 @@ You can get more verbose output with `ginkgo -v -r tests/integration/`.
NB: This will work better on Linux than on MacOS because of issues with static linking (`library not found for -lcrt0.o`).

### Litmus tests (WebDAV)

[Litmus](http://www.webdav.org/neon/litmus/) is a webdav test suite. The litmus tests for Reva's WebDAV interface are run using the [ownCloud's litmus Docker image](https://github.com/owncloud-docker/litmus). The '-old' and '-new' refer to which `LITMUS_URL` environment variable is passed to that Docker image, in other words, which path on the Reva server the litmus tests are run against.

1. start the needed services

```
mkdir -p /var/tmp/reva/einstein
cd tests/oc-integration-tests/local
Expand All @@ -88,6 +91,7 @@ NB: This will work better on Linux than on MacOS because of issues with static l
```

2. run litmus tests:

```
docker run --rm --network=host\
-e LITMUS_URL=http://localhost:20080/remote.php/webdav \
Expand All @@ -101,95 +105,12 @@ NB: This will work better on Linux than on MacOS because of issues with static l
- if on MacOS you see `FAIL (connection refused by '127.0.0.1' port 20080: Connection refused)`, it may be necessary to replace 'localhost' with your host IP address (e.g. `ipconfig getifaddr en0` or `sudo ifconfig | grep 192`)

### Acceptance tests (ownCloud legacy)
See [tests/acceptance](https://github.com/cs3org/reva/tree/edge/tests/acceptance).

This will require some PHP-related tools to run, for instance on Ubuntu you will need `apt install -y php-xml php-curl composer`.

1. start an LDAP server
```
docker run --rm -d \
-e LDAP_TLS_VERIFY_CLIENT=never \
-e LDAP_DOMAIN=owncloud.com \
-e LDAP_ORGANISATION=ownCloud \
-e LDAP_ADMIN_PASSWORD=admin \
--name docker-slapd \
-p 389:389 \
-p 636:636 \
osixia/openldap:1.3.0
```
2. start the needed services
```
cd tests/oc-integration-tests/local
```
```
../../../cmd/revad/revad -c frontend.toml &
../../../cmd/revad/revad -c gateway.toml &
../../../cmd/revad/revad -c shares.toml &
../../../cmd/revad/revad -c storage-shares.toml &
../../../cmd/revad/revad -c storage-users.toml &
../../../cmd/revad/revad -c storage-publiclink.toml &
../../../cmd/revad/revad -c machine-auth.toml &
../../../cmd/revad/revad -c permissions-ocis-ci.toml &
../../../cmd/revad/revad -c ldap-users.toml
```
> [!Note]
>
> Use these commands to stop the services:
>
> Stop the REVA services:
> ```
> pkill revad
> ```
>
> Stop the LDAP server:
>```
>docker stop docker-slapd
>```
3. clone ownCloud Infinite Scale `OCIS`
```
git clone https://github.com/owncloud/ocis.git ./testrunner
```
4. to run the correct version of the testsuite check out the commit id from the `.drone.env` file
```
cd testrunner
git checkout <commit-id>
```
5. create reva data directory
```
sudo mkdir -p /var/tmp/reva
sudo chown -R $USER /var/tmp/reva
```
5. run the tests
```
TEST_SERVER_URL='http://localhost:20080' \
OCIS_REVA_DATA_ROOT='/var/tmp/reva/' \
DELETE_USER_DATA_CMD="rm -rf /var/tmp/reva/data/nodes/root/* /var/tmp/reva/data/nodes/*-*-*-* /var/tmp/reva/data/blobs/*" \
SKELETON_DIR='./apps/testing/data/apiSkeleton' \
TEST_WITH_LDAP='true' \
REVA_LDAP_HOSTNAME='localhost' \
TEST_REVA='true' \
BEHAT_FILTER_TAGS='~@skip&&~@skipOnReva' \
EXPECTED_FAILURES_FILE=<path-to-reva>/tests/acceptance/expected-failures-on-OCIS-storage.md \
DIVIDE_INTO_NUM_PARTS=1 \
RUN_PART=1 \
ACCEPTANCE_TEST_TYPE=core-api \
make test-acceptance-api
```
This will run all tests that are relevant to reva.
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/coreApiWebdavUpload/uploadFile.feature:20'`
Make sure to double check the paths if you are changing the `OCIS_REVA_DATA_ROOT`. The `DELETE_USER_DATA_CMD` needs to clean up the correct folders.

See [Running Acceptance Tests](https://github.com/cs3org/reva/tree/edge/tests/acceptance).

## Daily releases
On every commit on the master branch (including merged Pull Requests) a new release will be created and

On every commit on the master branch (including merged Pull Requests) a new release will be created and
available at [daily releases](https://reva-releases.web.cern.ch/reva-releases).

## Major versions
Expand All @@ -198,11 +119,11 @@ There are currently two major versions in active development.

### 1.x versions

The ``master`` branch is the stable development branch. Releases from master are tagged as 1.x.x versions following [semver](https://semver.org/).
The `master` branch is the stable development branch. Releases from master are tagged as 1.x.x versions following [semver](https://semver.org/).

### 2.x versions

The ``edge`` branch is used to develop the next version of this project. The edge branch is based on a new concept named "Spaces" and a new set of the CS3APIs are being implemented, making it **not compatible** with `master` branch. Releases from `edge` are tagged as *2.x.x* versions following [semver](https://semver.org/).
The `edge` branch is used to develop the next version of this project. The edge branch is based on a new concept named "Spaces" and a new set of the CS3APIs are being implemented, making it **not compatible** with `master` branch. Releases from `edge` are tagged as _2.x.x_ versions following [semver](https://semver.org/).

## Run it using Docker

Expand All @@ -226,8 +147,8 @@ portability of the applications and service extensions.
REVA is distributed under [Apache 2.0 license](https://github.com/cs3org/reva/blob/master/LICENSE).

## Logo
REVA logo's have been designed and contributed to the project by Eamon Maguire.

REVA logo's have been designed and contributed to the project by Eamon Maguire.

## Disclaimer

Expand Down
75 changes: 56 additions & 19 deletions tests/acceptance/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
.PHONY: help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@echo " reva Start reva with ocis storage"
@echo " reva-posix Start reva with posixfs storage"
@echo " reva-s3ng Start reva with s3ng storage"

CURR_DIR:=$(dir $(abspath $(firstword $(MAKEFILE_LIST))))
REVA_CMD:=$(abspath $(CURR_DIR)/../../cmd/revad/revad)
CONFIG_DIR:=$(abspath $(CURR_DIR)/../oc-integration-tests/local)

.PHONY: test
test:
@echo "$(REVA_CMD)"

.PHONY: ldap
ldap:
@docker run --rm -d \
-e LDAP_TLS_VERIFY_CLIENT=never \
-e LDAP_DOMAIN=owncloud.com \
-e LDAP_ORGANISATION=ownCloud \
-e LDAP_ADMIN_PASSWORD=admin \
--name docker-slapd \
-p 389:389 \
-p 636:636 \
osixia/openldap:1.3.0
@docker run --rm -d \
--name docker-slapd \
-e LDAP_TLS_VERIFY_CLIENT=never \
-e LDAP_DOMAIN=owncloud.com \
-e LDAP_ORGANISATION=ownCloud \
-e LDAP_ADMIN_PASSWORD=admin \
-p 389:389 \
-p 636:636 \
osixia/openldap:1.3.0

.PHONY: redis
redis:
Expand All @@ -31,16 +30,54 @@ redis:
-p 6379:6379 \
redis:6-alpine

.PHONY: reva-ocis
reva-ocis: ldap
@echo "Running reva with ocis storage"
@sleep 5
.PHONY: ceph
ceph:
@docker run --rm -d \
--name ceph \
-e CEPH_DAEMON=demo \
-e NETWORK_AUTO_DETECT=1 \
-e MON_IP=0.0.0.0 \
-e CEPH_PUBLIC_NETWORK=0.0.0.0/0 \
-e RGW_NAME=localhost \
-e CEPH_DEMO_UID=test-user \
-e CEPH_DEMO_ACCESS_KEY=test \
-e CEPH_DEMO_SECRET_KEY=test \
-e CEPH_DEMO_BUCKET=test \
-p 8080:8080 \
ceph/daemon
@echo "Waiting for ceph to be ready..."
@while [ `curl -s http://localhost:8080 -w %{http_code} -o /dev/null` -ne 404 ]; do sleep 1; done

.PHONY: reva-services
reva-services:
@$(REVA_CMD) -c $(CONFIG_DIR)/frontend.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/gateway.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/shares.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-shares.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users-posixfs.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-publiclink.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/machine-auth.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/permissions-ocis-ci.toml &
@$(REVA_CMD) -c $(CONFIG_DIR)/ldap-users.toml &

.PHONY: reva
reva: ldap reva-services
@echo "Running reva with ocis storage"
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users.toml

.PHONY: reva-posix
reva-posix: ldap redis reva-services
@echo "Running reva with posixfs storage"
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users-posixfs.toml

.PHONY: reva-s3ng
reva-s3ng: ldap reva-services
@echo "Running reva with posixfs storage"
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users-s3ng.toml

.PHONY: clean
clean:
@docker ps -q --filter "name=docker-slapd" | xargs -r docker stop
@docker ps -q --filter "name=redis" | xargs -r docker stop
@docker ps -q --filter "name=ceph" | xargs -r docker stop
@pkill revad || true
@rm -rf /tmp/reva
69 changes: 69 additions & 0 deletions tests/acceptance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## Acceptance Tests (ownCloud Legacy)

This will require some PHP-related tools to run, for instance on Ubuntu you will need `apt install -y php-xml php-curl composer`.

1. Start the reva server (with ocis storage driver)

```
make reva-ocis
```

> [!Note]
>
> You can run the reva with other storage drivers.
>
> To run reva with `posix` storage driver:
>
> ```
> make reva-posix
> ```
>
> To run reva with `s3ng` storage driver:
>
> ```
> make reva-s3ng
> ```
2. Get ownCloud Infinite Scale `OCIS`
```
git clone https://github.com/owncloud/ocis.git ./testrunner
```
3. To run the correct version of the testsuite check out the commit id from the `.drone.env` file
```
cd testrunner
git checkout <commit-id>
```
4. run the tests
```
TEST_SERVER_URL='http://localhost:20080' \
TEST_REVA='true' \
TEST_WITH_LDAP='true' \
OCIS_REVA_DATA_ROOT='/tmp/reva/' \
DELETE_USER_DATA_CMD="rm -rf /tmp/reva/data/nodes/root/* /tmp/reva/data/nodes/*-*-*-* /tmp/reva/data/blobs/*" \
SKELETON_DIR='./apps/testing/data/apiSkeleton' \
REVA_LDAP_HOSTNAME='localhost' \
BEHAT_FILTER_TAGS='~@skip&&~@skipOnReva' \
EXPECTED_FAILURES_FILE=<path-to-reva>/tests/acceptance/expected-failures-on-OCIS-storage.md \
DIVIDE_INTO_NUM_PARTS=1 \
RUN_PART=1 \
ACCEPTANCE_TEST_TYPE=core-api \
make test-acceptance-api
```
This will run all tests that are relevant to reva.
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/coreApiWebdavUpload/uploadFile.feature:20'`
Make sure to double check the paths if you are changing the `OCIS_REVA_DATA_ROOT`. The `DELETE_USER_DATA_CMD` needs to clean up the correct folders.
5. Clean the setup
```
make clean
```
1 change: 0 additions & 1 deletion tests/acceptance/run.sh

This file was deleted.

6 changes: 3 additions & 3 deletions tests/oc-integration-tests/local/combined.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ users = "users.demo.json"
#expose_data_server = true

#[grpc.services.storageprovider.drivers.ocis]
#root = "/var/tmp/reva/data"
#root = "/tmp/reva/data"
#enable_home = false
#treetime_accounting = true
#treesize_accounting = true
Expand Down Expand Up @@ -186,9 +186,9 @@ max_chunk_size = 0

[http.services.dataprovider]
driver = "ocis"
temp_folder = "/var/tmp/reva/tmp"
temp_folder = "/tmp/reva/tmp"

[http.services.dataprovider.drivers.ocis]
root = "/var/tmp/reva/data"
root = "/tmp/reva/data"
treetime_accounting = true
treesize_accounting = true
2 changes: 1 addition & 1 deletion tests/oc-integration-tests/local/gateway-virtual.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ datagateway = "http://localhost:19001/data"
transfer_shared_secret = "replace-me-with-a-transfer-secret" # for direct uploads
transfer_expires = 6 # give it a moment
#disable_home_creation_on_login = true
link_grants_file = "/var/tmp/reva/link_grants_file.json"
link_grants_file = "/tmp/reva/link_grants_file.json"


[grpc.services.authregistry]
Expand Down
Loading

0 comments on commit 3b642e3

Please sign in to comment.