Skip to content

Commit

Permalink
Temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoguita committed Mar 7, 2023
1 parent fd9911a commit e87f673
Show file tree
Hide file tree
Showing 19 changed files with 1,152 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .drone.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The test runner source for API tests
APITESTS_COMMITID=804d1777051c3583dfeebae467466f1316fa3583
APITESTS_BRANCH=master
APITESTS_REPO_GIT_URL=https://github.com/owncloud/ocis.git
242 changes: 242 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
OC_CI_GOLANG = "owncloudci/golang:1.19"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OSIXIA_OPEN_LDAP = "osixia/openldap:1.3.0"
OC_CI_PHP = "cs3org/behat:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier:latest"

def makeStep():
return {
"name": "build",
"image": OC_CI_GOLANG,
"commands": [
"make revad",
],
}

def cloneApiTestReposStep():
return {
"name": "clone-api-test-repos",
"image": OC_CI_ALPINE,
"commands": [
"source /drone/src/.drone.env",
"git clone -b master --depth=1 https://github.com/owncloud/testing.git /drone/src/tmp/testing",
"git clone -b $APITESTS_BRANCH --single-branch --no-tags $APITESTS_REPO_GIT_URL /drone/src/tmp/testrunner",
"cd /drone/src/tmp/testrunner",
"git checkout $APITESTS_COMMITID",
],
}

# Shared service definitions
def ldapService():
return {
"name": "ldap",
"image": OSIXIA_OPEN_LDAP,
"pull": "always",
"environment": {
"LDAP_DOMAIN": "owncloud.com",
"LDAP_ORGANISATION": "ownCloud",
"LDAP_ADMIN_PASSWORD": "admin",
"LDAP_TLS_VERIFY_CLIENT": "never",
"HOSTNAME": "ldap",
},
}

def cephService():
return {
"name": "ceph",
"image": "ceph/daemon",
"pull": "always",
"environment": {
"CEPH_DAEMON": "demo",
"NETWORK_AUTO_DETECT": "4",
"MON_IP": "0.0.0.0",
"CEPH_PUBLIC_NETWORK": "0.0.0.0/0",
"RGW_CIVETWEB_PORT": "4000 ",
"RGW_NAME": "ceph",
"CEPH_DEMO_UID": "test-user",
"CEPH_DEMO_ACCESS_KEY": "test",
"CEPH_DEMO_SECRET_KEY": "test",
"CEPH_DEMO_BUCKET": "test",
},
}

# Pipeline definitions
def main(ctx):
return [
checkStarlark(),
ocisIntegrationTest(),
] + s3ngIntegrationTests()

def ocisIntegrationTest():
return {
"kind": "pipeline",
"type": "docker",
"name": "ocis-integration-tests-2",
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"event": {
"include": [
"pull_request",
"tag",
],
},
},
"steps": [
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
"detach": True,
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c shares.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
],
},
cloneApiTestReposStep(),
{
"name": "APIAcceptanceTestsOcisStorage",
"image": OC_CI_PHP,
"commands": [
"cd /drone/src/tmp/testrunner",
"make test-acceptance-from-core-api",
],
"environment": {
"TEST_SERVER_URL": "http://revad-services:20080",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/*",
"STORAGE_DRIVER": "OCIS",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_WITH_LDAP": "true",
"REVA_LDAP_HOSTNAME": "ldap",
"TEST_REVA": "true",
"SEND_SCENARIO_LINE_REFERENCES": "true",
"BEHAT_FILTER_TAGS": "~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@provisioning_api-app-required&&~@preview-extension-required&&~@local_storage&&~@skipOnOcis-OCIS-Storage&&~@personalSpace&&~@issue-ocis-3023&&~@skipOnGraph&&~@caldav&&~@carddav&&~@skipOnReva",
"DIVIDE_INTO_NUM_PARTS": 6,
"RUN_PART": 2,
"EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-OCIS-storage.md",
},
},
],
"services": [
ldapService(),
],
}

def s3ngIntegrationTests():
parallelRuns = 12
pipelines = []
for runPart in range(1, parallelRuns + 1):
if runPart in [9]:
continue

pipelines.append(
{
"kind": "pipeline",
"type": "docker",
"name": "s3ng-integration-tests-%s" % runPart,
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"event": {
"include": [
"pull_request",
"tag",
],
},
},
"steps": [
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
"detach": True,
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c shares.toml &",
"/drone/src/cmd/revad/revad -c storage-home-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-users-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
],
},
cloneApiTestReposStep(),
{
"name": "APIAcceptanceTestsS3ngStorage",
"image": OC_CI_PHP,
"commands": [
"cd /drone/src/tmp/testrunner",
"make test-acceptance-from-core-api",
],
"environment": {
"TEST_SERVER_URL": "http://revad-services:20080",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/*",
"STORAGE_DRIVER": "S3NG",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_WITH_LDAP": "true",
"REVA_LDAP_HOSTNAME": "ldap",
"TEST_REVA": "true",
"SEND_SCENARIO_LINE_REFERENCES": "true",
"BEHAT_FILTER_TAGS": "~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@provisioning_api-app-required&&~@preview-extension-required&&~@local_storage&&~@skipOnOcis-OCIS-Storage&&~@personalSpace&&~@issue-ocis-3023&&~&&~@skipOnGraph&&~@caldav&&~@carddav&&~@skipOnReva",
"DIVIDE_INTO_NUM_PARTS": parallelRuns,
"RUN_PART": runPart,
"EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-S3NG-storage.md",
},
},
],
"services": [
ldapService(),
cephService(),
],
},
)

return pipelines

def checkStarlark():
return {
"kind": "pipeline",
"type": "docker",
"name": "check-starlark",
"steps": [
{
"name": "format-check-starlark",
"image": OC_CI_BAZEL_BUILDIFIER,
"commands": [
"buildifier --mode=check .drone.star",
],
},
{
"name": "show-diff",
"image": OC_CI_BAZEL_BUILDIFIER,
"commands": [
"buildifier --mode=fix .drone.star",
"git diff",
],
"when": {
"status": [
"failure",
],
},
},
],
"depends_on": [],
"trigger": {
"ref": [
"refs/pull/**",
],
},
}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4, 5, 6]
part: [1, 3, 4, 5, 6]
uses: ./.github/workflows/compose.yml
with:
test: acceptance-2
Expand All @@ -90,7 +90,7 @@ jobs:
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
part: [9]
uses: ./.github/workflows/compose.yml
with:
test: acceptance-3
Expand Down
114 changes: 114 additions & 0 deletions tests/oc-integration-tests/drone/frontend-global.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# This config file will start a reva service that:
# - serves as the entrypoint for owncloud APIs but with a globally accessible namespace.
# - serves http endpoints on port 20180
# - / --------------- ocdav
# - /ocs ------------ ocs
# - TODO(diocas): ocm

[shared]
jwt_secret = "Pive-Fumkiu4"
gatewaysvc = "localhost:19000"

[http]
address = "0.0.0.0:20180"

[http.middlewares.cors]
allow_credentials = true

[http.services.ocdav]
# serve ocdav on the root path
prefix = ""
chunk_folder = "/drone/src/tmp/reva/chunks"
# for user lookups
# prefix the path of requests to /dav/files with this namespace
# While owncloud has only listed usernames at this endpoint CERN has
# been exposing more than just usernames. For owncloud deployments we
# can prefix the path to jail the requests to the correct CS3 namespace.
# In this deployment we mounted the owncloud storage provider at /users. It
# expects a username as the first path segment.
# currently, only the desktop client will use this endpoint, but only if
# the dav.chunking capability is available
# TODO implement a path wrapper that rewrites `<username>` into the path
# layout for the users home?
# no, use GetHome?
# for eos we need to rewrite the path
# TODO strip the username from the path so the CS3 namespace can be mounted
# at the files/<username> endpoint? what about migration? separate reva instance
files_namespace = "/"

# similar to the dav/files endpoint we can configure a prefix for the old webdav endpoint
# we use the old webdav endpoint to present the cs3 namespace
# note: this changes the tree that is rendered at remote.php/webdav from the users home to the cs3 namespace
# use webdav_namespace = "/home" to use the old namespace that only exposes the users files
# this endpoint should not affect the desktop client sync but will present different folders for the other clients:
# - the desktop clients use a hardcoded remote.php/dav/files/<username> if the dav.chunkung capability is present
# - the ios ios uses the core.webdav-root capability which points to remote.php/webdav in oc10
# - the oc js sdk is hardcoded to the remote.php/webdav so it will see the new tree
# - TODO android? no sync ... but will see different tree
webdav_namespace = "/"

[http.services.ocs]

[http.services.ocs.capabilities.capabilities.core.status]
version = "10.0.11.5"
versionstring = "10.0.11"

[http.services.ocs.capabilities.capabilities.files_sharing]
api_enabled = true
resharing = true
group_sharing = true
auto_accept_share = true
share_with_group_members_only = true
share_with_membership_groups_only = true
default_permissions = 22
search_min_length = 3

[http.services.ocs.capabilities.capabilities.files_sharing.public]
enabled = true
send_mail = true
social_share = true
upload = true
multiple = true
supports_upload_only = true

[http.services.ocs.capabilities.capabilities.files_sharing.public.password]
enforced = true

[http.services.ocs.capabilities.capabilities.files_sharing.public.password.enforced_for]
read_only = true
read_write = true
upload_only = true

[http.services.ocs.capabilities.capabilities.files_sharing.public.expire_date]
enabled = true

[http.services.ocs.capabilities.capabilities.files_sharing.user]
send_mail = true

[http.services.ocs.capabilities.capabilities.files_sharing.user_enumeration]
enabled = true
group_members_only = true

[http.services.ocs.capabilities.capabilities.files_sharing.federation]
outgoing = true
incoming = true

[http.services.ocs.capabilities.capabilities.notifications]
endpoints = []

[http.services.ocs.capabilities.capabilities.files.tus_support]
version = "1.0.0"
resumable = "1.0.0"
extension = "creation,creation-with-upload"
http_method_override = ""
max_chunk_size = 0

# serve /ocm
[http.services.ocmd]
prefix = "ocm"

[http.middlewares.providerauthorizer]
driver = "json"

[http.middlewares.providerauthorizer.drivers.json]
providers = "providers.demo.json"
Loading

0 comments on commit e87f673

Please sign in to comment.