From 439ea767adae1c89101ea2e1f799a0a8dbd74b74 Mon Sep 17 00:00:00 2001 From: Deyan Zhekov Date: Tue, 7 Apr 2026 11:58:46 +0300 Subject: [PATCH 1/4] test [OCISDEV-744]: fix apiOcm tests --- .github/workflows/acceptance-tests.yml | 4 +- tests/acceptance/run-cs3api.sh | 50 +++++++++++++++ tests/acceptance/run-e2e.sh | 65 +++++++++++++++++++ tests/acceptance/run-github.py | 89 +++++++++++++++++++++++++- tests/acceptance/run-litmus.sh | 68 ++++++++++++++++++++ tests/config/local/.env-federation | 18 ++++-- 6 files changed, 287 insertions(+), 7 deletions(-) create mode 100644 tests/acceptance/run-cs3api.sh create mode 100755 tests/acceptance/run-e2e.sh create mode 100644 tests/acceptance/run-litmus.sh diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index a73f91d94e1..0b0e10d8a5c 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -132,7 +132,7 @@ jobs: # antivirus (needs ClamAV) - apiAntivirus # federation (needs email + federation ocis) - # - apiOcm + - apiOcm # collaboration (needs WOPI) - apiCollaboration steps: @@ -450,7 +450,7 @@ jobs: run: python3 tests/acceptance/run-wopi.py --type cs3 all-acceptance-tests: - needs: [local-api-tests, cli-tests, wopi-cs3] # [local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests] + needs: [local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests] runs-on: ubuntu-latest if: always() steps: diff --git a/tests/acceptance/run-cs3api.sh b/tests/acceptance/run-cs3api.sh new file mode 100644 index 00000000000..89a74c8b201 --- /dev/null +++ b/tests/acceptance/run-cs3api.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" +WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" +OCIS_URL="https://localhost:9200" +OCIS_CONFIG_DIR="$HOME/.ocis/config" + +# build +make -C "$REPO_ROOT/ocis" build +GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build + +# init + start ocis with gRPC gateway exposed for cs3api-validator +"$OCIS_BIN" init --insecure true +cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" + +OCIS_URL=$OCIS_URL \ +OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ +STORAGE_USERS_DRIVER=ocis \ +PROXY_ENABLE_BASIC_AUTH=true \ +OCIS_EXCLUDE_RUN_SERVICES=idp \ +OCIS_LOG_LEVEL=error \ +IDM_CREATE_DEMO_USERS=true \ +IDM_ADMIN_PASSWORD=admin \ +OCIS_ASYNC_UPLOADS=true \ +OCIS_EVENTS_ENABLE_TLS=false \ +NATS_NATS_HOST=0.0.0.0 \ +NATS_NATS_PORT=9233 \ +OCIS_JWT_SECRET=some-ocis-jwt-secret \ +GATEWAY_GRPC_ADDR=0.0.0.0:9142 \ +OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false \ +WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ + "$WRAPPER_BIN" serve \ + --bin "$OCIS_BIN" \ + --url "$OCIS_URL" \ + --admin-username admin \ + --admin-password admin & +WRAPPER_PID=$! +trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT + +echo "Waiting for ocis..." +timeout 300 bash -c \ + "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ + -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" +echo "ocis ready." + +docker run --rm --network host \ + owncloud/cs3api-validator:0.2.1 \ + /usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=localhost:9142 diff --git a/tests/acceptance/run-e2e.sh b/tests/acceptance/run-e2e.sh new file mode 100755 index 00000000000..3ff8a9cb2dc --- /dev/null +++ b/tests/acceptance/run-e2e.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" +WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" +OCIS_URL="https://localhost:9200" +OCIS_CONFIG_DIR="$HOME/.ocis/config" +WEB_DIR="$REPO_ROOT/webTestRunner" + +: "${E2E_ARGS:?E2E_ARGS is required, e.g. E2E_ARGS='--run-part 1' bash run-e2e.sh}" + +# build ocis + ociswrapper +make -C "$REPO_ROOT/ocis" build +GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build + +# clone owncloud/web (test runner lives there) +if [ ! -d "$WEB_DIR" ]; then + git clone --depth 1 https://github.com/owncloud/web.git "$WEB_DIR" +fi +cd "$WEB_DIR" +npm install -g pnpm +pnpm install + +# init + start ocis +"$OCIS_BIN" init --insecure true +cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" + +OCIS_URL=$OCIS_URL \ +OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ +STORAGE_USERS_DRIVER=ocis \ +PROXY_ENABLE_BASIC_AUTH=true \ +OCIS_EXCLUDE_RUN_SERVICES=idp \ +OCIS_LOG_LEVEL=error \ +IDM_CREATE_DEMO_USERS=true \ +IDM_ADMIN_PASSWORD=admin \ +OCIS_ASYNC_UPLOADS=true \ +OCIS_EVENTS_ENABLE_TLS=false \ +NATS_NATS_HOST=0.0.0.0 \ +NATS_NATS_PORT=9233 \ +OCIS_JWT_SECRET=some-ocis-jwt-secret \ +WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ + "$WRAPPER_BIN" serve \ + --bin "$OCIS_BIN" \ + --url "$OCIS_URL" \ + --admin-username admin \ + --admin-password admin & +WRAPPER_PID=$! +trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT + +echo "Waiting for ocis..." +timeout 300 bash -c \ + "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ + -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" +echo "ocis ready." + +# run playwright e2e tests +cd "$WEB_DIR/tests/e2e" +echo "Running e2e: $E2E_ARGS" +BASE_URL_OCIS=$OCIS_URL \ +HEADLESS=true \ +RETRY=1 \ +SKIP_A11Y_TESTS=true \ +REPORT_TRACING=true \ + bash run-e2e.sh $E2E_ARGS diff --git a/tests/acceptance/run-github.py b/tests/acceptance/run-github.py index 4b6b96b9e88..fa4230a2d2a 100755 --- a/tests/acceptance/run-github.py +++ b/tests/acceptance/run-github.py @@ -119,6 +119,7 @@ "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, "NOTIFICATIONS_SMTP_INSECURE": "true", "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, + "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", }, }, "authApp": { @@ -211,6 +212,7 @@ def base_server_env(repo_root: Path, ocis_url: str, ocis_config_dir: str) -> dic "OCIS_EVENTS_ENABLE_TLS": "false", "NATS_NATS_HOST": "0.0.0.0", "NATS_NATS_PORT": "9233", + "MICRO_REGISTRY_ADDRESS": "127.0.0.1:9233", "OCIS_JWT_SECRET": "some-ocis-jwt-secret", "EVENTHISTORY_STORE": "memory", "OCIS_TRANSLATION_PATH": str(repo_root / "tests/config/translations"), @@ -465,9 +467,94 @@ def main() -> int: "PROXY_HTTP_ADDR": "0.0.0.0:10200", "OCIS_BASE_DATA_PATH": str(fed_data_dir), # use different ports to avoid conflicts with primary + # both instances run on the same host (no container isolation), + # so every port must be unique — offset by +1000 from primary + "OCIS_RUNTIME_PORT": "10250", + "OCIS_EVENTS_ENDPOINT": "127.0.0.1:10233", + "MICRO_REGISTRY_ADDRESS": "127.0.0.1:10233", + "OCIS_LDAP_URI": "ldaps://localhost:10235", + # grpc / http service addresses + "APP_PROVIDER_GRPC_ADDR": "0.0.0.0:10164", + "APP_REGISTRY_GRPC_ADDR": "0.0.0.0:10242", + "AUTH_BASIC_GRPC_ADDR": "0.0.0.0:10146", + "AUTH_MACHINE_GRPC_ADDR": "0.0.0.0:10166", + "AUTH_SERVICE_GRPC_ADDR": "0.0.0.0:10199", + "EVENTHISTORY_GRPC_ADDR": "0.0.0.0:10274", + "FRONTEND_HTTP_ADDR": "0.0.0.0:10140", "GATEWAY_GRPC_ADDR": "0.0.0.0:10142", - "NATS_NATS_PORT": "10233", + "GRAPH_HTTP_ADDR": "0.0.0.0:10120", + "GROUPS_GRPC_ADDR": "0.0.0.0:10160", + "IDM_LDAPS_ADDR": "0.0.0.0:10235", + "IDP_HTTP_ADDR": "0.0.0.0:10130", "NATS_NATS_HOST": "0.0.0.0", + "NATS_NATS_PORT": "10233", + "OCDAV_HTTP_ADDR": "0.0.0.0:10350", + "OCM_HTTP_ADDR": "0.0.0.0:10280", + "OCM_GRPC_ADDR": "0.0.0.0:10282", + "OCM_OCM_STORAGE_DATA_SERVER_URL": "http://localhost:10280/data", + "OCS_HTTP_ADDR": "0.0.0.0:10110", + "SEARCH_GRPC_ADDR": "0.0.0.0:10220", + "SETTINGS_GRPC_ADDR": "0.0.0.0:10185", + "SETTINGS_HTTP_ADDR": "0.0.0.0:10186", + "SHARING_GRPC_ADDR": "0.0.0.0:10150", + "SSE_HTTP_ADDR": "0.0.0.0:10132", + "STORAGE_PUBLICLINK_GRPC_ADDR": "0.0.0.0:10178", + "STORAGE_SHARES_GRPC_ADDR": "0.0.0.0:10154", + "STORAGE_SYSTEM_GRPC_ADDR": "0.0.0.0:10215", + "STORAGE_SYSTEM_HTTP_ADDR": "0.0.0.0:10216", + "STORAGE_SYSTEM_DATA_SERVER_URL": "http://localhost:10216/data", + "STORAGE_USERS_GRPC_ADDR": "0.0.0.0:10157", + "STORAGE_USERS_HTTP_ADDR": "0.0.0.0:10158", + "STORAGE_USERS_DATA_SERVER_URL": "http://localhost:10158/data", + "STORE_GRPC_ADDR": "0.0.0.0:10460", + "THUMBNAILS_GRPC_ADDR": "0.0.0.0:10191", + "THUMBNAILS_HTTP_ADDR": "0.0.0.0:10190", + "THUMBNAILS_DATA_ENDPOINT": "http://localhost:10190/thumbnails/data", + "USERLOG_HTTP_ADDR": "0.0.0.0:10211", + "USERS_GRPC_ADDR": "0.0.0.0:10144", + "WEB_HTTP_ADDR": "0.0.0.0:10100", + "WEBDAV_HTTP_ADDR": "0.0.0.0:10115", + "WEBFINGER_HTTP_ADDR": "0.0.0.0:10275", + "ACTIVITYLOG_HTTP_ADDR": "0.0.0.0:10195", + # debug addresses + "ACTIVITYLOG_DEBUG_ADDR": "0.0.0.0:10261", + "APP_PROVIDER_DEBUG_ADDR": "0.0.0.0:10165", + "APP_REGISTRY_DEBUG_ADDR": "0.0.0.0:10243", + "AUTH_BASIC_DEBUG_ADDR": "0.0.0.0:10147", + "AUTH_MACHINE_DEBUG_ADDR": "0.0.0.0:10167", + "AUTH_SERVICE_DEBUG_ADDR": "0.0.0.0:10169", + "CLIENTLOG_DEBUG_ADDR": "0.0.0.0:10260", + "EVENTHISTORY_DEBUG_ADDR": "0.0.0.0:10270", + "FRONTEND_DEBUG_ADDR": "0.0.0.0:10141", + "GATEWAY_DEBUG_ADDR": "0.0.0.0:10143", + "GRAPH_DEBUG_ADDR": "0.0.0.0:10124", + "GROUPS_DEBUG_ADDR": "0.0.0.0:10161", + "IDM_DEBUG_ADDR": "0.0.0.0:10239", + "IDP_DEBUG_ADDR": "0.0.0.0:10134", + "INVITATIONS_DEBUG_ADDR": "0.0.0.0:10269", + "NATS_DEBUG_ADDR": "0.0.0.0:10234", + "OCDAV_DEBUG_ADDR": "0.0.0.0:10163", + "OCM_DEBUG_ADDR": "0.0.0.0:10281", + "OCS_DEBUG_ADDR": "0.0.0.0:10114", + "POSTPROCESSING_DEBUG_ADDR": "0.0.0.0:10255", + "POSTPROCESSING_SERVICE_DEBUG_ADDR": "0.0.0.0:10255", + "PROXY_DEBUG_ADDR": "0.0.0.0:10205", + "SEARCH_DEBUG_ADDR": "0.0.0.0:10224", + "SETTINGS_DEBUG_ADDR": "0.0.0.0:10189", + "SHARING_DEBUG_ADDR": "0.0.0.0:10151", + "SSE_DEBUG_ADDR": "0.0.0.0:10135", + "STORAGE_PUBLICLINK_DEBUG_ADDR": "0.0.0.0:10179", + "STORAGE_SHARES_DEBUG_ADDR": "0.0.0.0:10156", + "STORAGE_SYSTEM_DEBUG_ADDR": "0.0.0.0:10217", + "STORAGE_USERS_DEBUG_ADDR": "0.0.0.0:10159", + "STORE_DEBUG_ADDR": "0.0.0.0:10464", + "THUMBNAILS_DEBUG_ADDR": "0.0.0.0:10194", + "USERLOG_DEBUG_ADDR": "0.0.0.0:10210", + "USERS_DEBUG_ADDR": "0.0.0.0:10145", + "WEB_DEBUG_ADDR": "0.0.0.0:10104", + "WEBDAV_DEBUG_ADDR": "0.0.0.0:10119", + "WEBFINGER_DEBUG_ADDR": "0.0.0.0:10279", + "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:10174", }) # init federation ocis with separate config diff --git a/tests/acceptance/run-litmus.sh b/tests/acceptance/run-litmus.sh new file mode 100644 index 00000000000..9722c25e651 --- /dev/null +++ b/tests/acceptance/run-litmus.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" +WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" +OCIS_URL="https://localhost:9200" +OCIS_CONFIG_DIR="$HOME/.ocis/config" + +# build +make -C "$REPO_ROOT/ocis" build +GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build + +# init + start ocis +"$OCIS_BIN" init --insecure true +cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" + +OCIS_URL=$OCIS_URL \ +OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ +STORAGE_USERS_DRIVER=ocis \ +PROXY_ENABLE_BASIC_AUTH=true \ +OCIS_EXCLUDE_RUN_SERVICES=idp \ +OCIS_LOG_LEVEL=error \ +IDM_CREATE_DEMO_USERS=true \ +IDM_ADMIN_PASSWORD=admin \ +OCIS_ASYNC_UPLOADS=true \ +OCIS_EVENTS_ENABLE_TLS=false \ +NATS_NATS_HOST=0.0.0.0 \ +NATS_NATS_PORT=9233 \ +OCIS_JWT_SECRET=some-ocis-jwt-secret \ +WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ + "$WRAPPER_BIN" serve \ + --bin "$OCIS_BIN" \ + --url "$OCIS_URL" \ + --admin-username admin \ + --admin-password admin & +WRAPPER_PID=$! +trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT + +echo "Waiting for ocis..." +timeout 300 bash -c \ + "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ + -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" +echo "ocis ready." + +# setup: creates test folder, share, and exports SPACE_ID + PUBLIC_TOKEN to .env +TEST_SERVER_URL=$OCIS_URL bash "$REPO_ROOT/tests/config/drone/setup-for-litmus.sh" +source .env + +# run litmus against each WebDAV endpoint +ENDPOINTS=( + "$OCIS_URL/remote.php/webdav" + "$OCIS_URL/remote.php/dav/files/admin" + "$OCIS_URL/remote.php/dav/files/admin/Shares/new_folder/" + "$OCIS_URL/remote.php/webdav/Shares/new_folder/" + "$OCIS_URL/remote.php/dav/spaces/$SPACE_ID" +) + +for ENDPOINT in "${ENDPOINTS[@]}"; do + echo "Testing endpoint: $ENDPOINT" + docker run --rm --network host \ + -e LITMUS_URL="$ENDPOINT" \ + -e LITMUS_USERNAME=admin \ + -e LITMUS_PASSWORD=admin \ + -e TESTS="basic copymove props http" \ + owncloudci/litmus:latest \ + /usr/local/bin/litmus-wrapper +done diff --git a/tests/config/local/.env-federation b/tests/config/local/.env-federation index 1f35ad0322c..bcd1e7b0ef7 100644 --- a/tests/config/local/.env-federation +++ b/tests/config/local/.env-federation @@ -9,7 +9,7 @@ export OCIS_BASE_DATA_PATH=${HOME}/.ocis-10200 export OCIS_CONFIG_DIR=${HOME}/.ocis-10200/config export OCIS_EVENTS_ENDPOINT=127.0.0.1:10233 export OCIS_LDAP_URI=ldaps://localhost:10235 -export OCIS_RUNTIME_PORT=10250 +export OCIS_RUNTIME_PORT=10200 export OCIS_URL=https://localhost:10200 export OCIS_ADD_RUN_SERVICES=ocm export OCIS_ENABLE_OCM=true @@ -89,14 +89,17 @@ export WEB_DEBUG_ADDR=localhost:10104 export WEB_HTTP_ADDR=localhost:10100 export WEBDAV_DEBUG_ADDR=127.0.0.1:10119 export WEBDAV_HTTP_ADDR=127.0.0.1:10115 +export NOTIFICATIONS_DEBUG_ADDR=127.0.0.1:10174 export WEBFINGER_DEBUG_ADDR=127.0.0.1:10279 export WEBFINGER_HTTP_ADDR=127.0.0.1:10275 -export OCIS_SERVICE_ACCOUNT_ID=serviceaccount -export OCIS_SERVICE_ACCOUNT_SECRET=serviceaccountsecret +export OCIS_SERVICE_ACCOUNT_ID=service-account-id +export OCIS_SERVICE_ACCOUNT_SECRET=service-account-secret export OCIS_DECOMPOSEDFS_PROPAGATOR=async export STORAGE_USERS_ASYNC_PROPAGATOR_PROPAGATION_DELAY=10s export TLS_INSECURE=true export OCIS_INSECURE=true +export LDAP_GROUP_SUBSCRIPTION_FILTER_TYPE=any +export LDAP_USER_SUBSCRIPTION_FILTER_TYPE=any export IDP_ACCESS_TOKEN_EXPIRATION=9000 export GATEWAY_STORAGE_USERS_MOUNT_ID=storage-users-1 export STORAGE_USERS_MOUNT_ID=storage-users-1 @@ -106,6 +109,13 @@ export OCIS_LOG_LEVEL=info export OCIS_LOG_PRETTY=true export OCIS_LOG_COLOR=true export PROXY_ENABLE_BASIC_AUTH=true +export FRONTEND_SEARCH_MIN_LENGTH=2 +export FRONTEND_CONFIGURABLE_NOTIFICATIONS=true +export GRAPH_AVAILABLE_ROLES=b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6,63e64e19-8d43-42ec-a738-2b6af2610efa +export COLLABORATION_WOPIAPP_SECRET=some-wopi-secret +export SEARCH_EXTRACTOR_TYPE=tika +export SEARCH_EXTRACTOR_TIKA_TIKA_URL=http://localhost:9998 +export SEARCH_EXTRACTOR_CS3SOURCE_INSECURE=true export IDM_CREATE_DEMO_USERS=true export OCIS_ADMIN_USER_ID=some-admin-user-id-0000-000000000000 export IDM_ADMIN_PASSWORD=admin @@ -122,4 +132,4 @@ export USERS_LDAP_BIND_PASSWORD=some-ldap-reva-password export AUTH_BASIC_LDAP_BIND_PASSWORD=some-ldap-reva-password export IDM_IDPSVC_PASSWORD=some-ldap-idp-password export IDP_LDAP_BIND_PASSWORD=some-ldap-idp-password -export GRAPH_APPLICATION_ID=application-1export +export GRAPH_APPLICATION_ID=application-1 From a9ed216acaa905b8a29e9189871698ceebdebaf0 Mon Sep 17 00:00:00 2001 From: Deyan Zhekov Date: Tue, 7 Apr 2026 14:36:51 +0300 Subject: [PATCH 2/4] test [OCISDEV-744]: remove redundant .sh files --- tests/acceptance/run-cs3api.sh | 50 ------------------------- tests/acceptance/run-litmus.sh | 68 ---------------------------------- 2 files changed, 118 deletions(-) delete mode 100644 tests/acceptance/run-cs3api.sh delete mode 100644 tests/acceptance/run-litmus.sh diff --git a/tests/acceptance/run-cs3api.sh b/tests/acceptance/run-cs3api.sh deleted file mode 100644 index 89a74c8b201..00000000000 --- a/tests/acceptance/run-cs3api.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" -OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" -WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" -OCIS_URL="https://localhost:9200" -OCIS_CONFIG_DIR="$HOME/.ocis/config" - -# build -make -C "$REPO_ROOT/ocis" build -GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build - -# init + start ocis with gRPC gateway exposed for cs3api-validator -"$OCIS_BIN" init --insecure true -cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" - -OCIS_URL=$OCIS_URL \ -OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ -STORAGE_USERS_DRIVER=ocis \ -PROXY_ENABLE_BASIC_AUTH=true \ -OCIS_EXCLUDE_RUN_SERVICES=idp \ -OCIS_LOG_LEVEL=error \ -IDM_CREATE_DEMO_USERS=true \ -IDM_ADMIN_PASSWORD=admin \ -OCIS_ASYNC_UPLOADS=true \ -OCIS_EVENTS_ENABLE_TLS=false \ -NATS_NATS_HOST=0.0.0.0 \ -NATS_NATS_PORT=9233 \ -OCIS_JWT_SECRET=some-ocis-jwt-secret \ -GATEWAY_GRPC_ADDR=0.0.0.0:9142 \ -OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false \ -WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ - "$WRAPPER_BIN" serve \ - --bin "$OCIS_BIN" \ - --url "$OCIS_URL" \ - --admin-username admin \ - --admin-password admin & -WRAPPER_PID=$! -trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT - -echo "Waiting for ocis..." -timeout 300 bash -c \ - "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ - -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" -echo "ocis ready." - -docker run --rm --network host \ - owncloud/cs3api-validator:0.2.1 \ - /usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=localhost:9142 diff --git a/tests/acceptance/run-litmus.sh b/tests/acceptance/run-litmus.sh deleted file mode 100644 index 9722c25e651..00000000000 --- a/tests/acceptance/run-litmus.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" -OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" -WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" -OCIS_URL="https://localhost:9200" -OCIS_CONFIG_DIR="$HOME/.ocis/config" - -# build -make -C "$REPO_ROOT/ocis" build -GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build - -# init + start ocis -"$OCIS_BIN" init --insecure true -cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" - -OCIS_URL=$OCIS_URL \ -OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ -STORAGE_USERS_DRIVER=ocis \ -PROXY_ENABLE_BASIC_AUTH=true \ -OCIS_EXCLUDE_RUN_SERVICES=idp \ -OCIS_LOG_LEVEL=error \ -IDM_CREATE_DEMO_USERS=true \ -IDM_ADMIN_PASSWORD=admin \ -OCIS_ASYNC_UPLOADS=true \ -OCIS_EVENTS_ENABLE_TLS=false \ -NATS_NATS_HOST=0.0.0.0 \ -NATS_NATS_PORT=9233 \ -OCIS_JWT_SECRET=some-ocis-jwt-secret \ -WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ - "$WRAPPER_BIN" serve \ - --bin "$OCIS_BIN" \ - --url "$OCIS_URL" \ - --admin-username admin \ - --admin-password admin & -WRAPPER_PID=$! -trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT - -echo "Waiting for ocis..." -timeout 300 bash -c \ - "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ - -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" -echo "ocis ready." - -# setup: creates test folder, share, and exports SPACE_ID + PUBLIC_TOKEN to .env -TEST_SERVER_URL=$OCIS_URL bash "$REPO_ROOT/tests/config/drone/setup-for-litmus.sh" -source .env - -# run litmus against each WebDAV endpoint -ENDPOINTS=( - "$OCIS_URL/remote.php/webdav" - "$OCIS_URL/remote.php/dav/files/admin" - "$OCIS_URL/remote.php/dav/files/admin/Shares/new_folder/" - "$OCIS_URL/remote.php/webdav/Shares/new_folder/" - "$OCIS_URL/remote.php/dav/spaces/$SPACE_ID" -) - -for ENDPOINT in "${ENDPOINTS[@]}"; do - echo "Testing endpoint: $ENDPOINT" - docker run --rm --network host \ - -e LITMUS_URL="$ENDPOINT" \ - -e LITMUS_USERNAME=admin \ - -e LITMUS_PASSWORD=admin \ - -e TESTS="basic copymove props http" \ - owncloudci/litmus:latest \ - /usr/local/bin/litmus-wrapper -done From 71630f6eb31d91e99b3158f50cdb0d924f998f48 Mon Sep 17 00:00:00 2001 From: Deyan Zhekov Date: Tue, 7 Apr 2026 15:33:36 +0300 Subject: [PATCH 3/4] test [OCISDEV-744]: remove run-e2e.sh. Fix DRY vialation in run-github.py --- tests/acceptance/run-e2e.sh | 65 ------------------ tests/acceptance/run-github.py | 106 +++++------------------------ tests/config/local/.env-federation | 2 +- 3 files changed, 19 insertions(+), 154 deletions(-) delete mode 100755 tests/acceptance/run-e2e.sh diff --git a/tests/acceptance/run-e2e.sh b/tests/acceptance/run-e2e.sh deleted file mode 100755 index 3ff8a9cb2dc..00000000000 --- a/tests/acceptance/run-e2e.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" -OCIS_BIN="$REPO_ROOT/ocis/bin/ocis" -WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" -OCIS_URL="https://localhost:9200" -OCIS_CONFIG_DIR="$HOME/.ocis/config" -WEB_DIR="$REPO_ROOT/webTestRunner" - -: "${E2E_ARGS:?E2E_ARGS is required, e.g. E2E_ARGS='--run-part 1' bash run-e2e.sh}" - -# build ocis + ociswrapper -make -C "$REPO_ROOT/ocis" build -GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build - -# clone owncloud/web (test runner lives there) -if [ ! -d "$WEB_DIR" ]; then - git clone --depth 1 https://github.com/owncloud/web.git "$WEB_DIR" -fi -cd "$WEB_DIR" -npm install -g pnpm -pnpm install - -# init + start ocis -"$OCIS_BIN" init --insecure true -cp "$REPO_ROOT/tests/config/drone/app-registry.yaml" "$OCIS_CONFIG_DIR/app-registry.yaml" - -OCIS_URL=$OCIS_URL \ -OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ -STORAGE_USERS_DRIVER=ocis \ -PROXY_ENABLE_BASIC_AUTH=true \ -OCIS_EXCLUDE_RUN_SERVICES=idp \ -OCIS_LOG_LEVEL=error \ -IDM_CREATE_DEMO_USERS=true \ -IDM_ADMIN_PASSWORD=admin \ -OCIS_ASYNC_UPLOADS=true \ -OCIS_EVENTS_ENABLE_TLS=false \ -NATS_NATS_HOST=0.0.0.0 \ -NATS_NATS_PORT=9233 \ -OCIS_JWT_SECRET=some-ocis-jwt-secret \ -WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ - "$WRAPPER_BIN" serve \ - --bin "$OCIS_BIN" \ - --url "$OCIS_URL" \ - --admin-username admin \ - --admin-password admin & -WRAPPER_PID=$! -trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT - -echo "Waiting for ocis..." -timeout 300 bash -c \ - "while [ \$(curl -sk -uadmin:admin $OCIS_URL/graph/v1.0/users/admin \ - -w %{http_code} -o /dev/null) != 200 ]; do sleep 1; done" -echo "ocis ready." - -# run playwright e2e tests -cd "$WEB_DIR/tests/e2e" -echo "Running e2e: $E2E_ARGS" -BASE_URL_OCIS=$OCIS_URL \ -HEADLESS=true \ -RETRY=1 \ -SKIP_A11Y_TESTS=true \ -REPORT_TRACING=true \ - bash run-e2e.sh $E2E_ARGS diff --git a/tests/acceptance/run-github.py b/tests/acceptance/run-github.py index fa4230a2d2a..a4b43304c0a 100755 --- a/tests/acceptance/run-github.py +++ b/tests/acceptance/run-github.py @@ -327,6 +327,20 @@ def clamav_healthy() -> bool: +def load_env_file(path: Path) -> dict: + """Parse a bash-style env file (export KEY=value) into a dict.""" + env = {} + for line in path.read_text().splitlines(): + line = line.strip() + if not line or line.startswith("#") or line.startswith("!"): + continue + line = line.removeprefix("export ").strip() + if "=" in line: + k, v = line.split("=", 1) + env[k.strip()] = v.strip() + return env + + def run(cmd: list, env: dict = None, check: bool = True): e = {**os.environ, **(env or {})} return subprocess.run(cmd, env=e, check=check) @@ -462,99 +476,15 @@ def main() -> int: fed_env = {**os.environ} fed_env.update(base_server_env(repo_root, ocis_fed_url, str(fed_config_dir))) fed_env.update(cfg["extraServerEnvironment"]) + # load federation port mappings from canonical env file (single source of truth) + fed_env.update(load_env_file(repo_root / "tests/config/local/.env-federation")) + # CI-specific overrides fed_env.update({ "OCIS_URL": ocis_fed_url, - "PROXY_HTTP_ADDR": "0.0.0.0:10200", "OCIS_BASE_DATA_PATH": str(fed_data_dir), - # use different ports to avoid conflicts with primary - # both instances run on the same host (no container isolation), - # so every port must be unique — offset by +1000 from primary + "OCIS_CONFIG_DIR": str(fed_config_dir), "OCIS_RUNTIME_PORT": "10250", - "OCIS_EVENTS_ENDPOINT": "127.0.0.1:10233", "MICRO_REGISTRY_ADDRESS": "127.0.0.1:10233", - "OCIS_LDAP_URI": "ldaps://localhost:10235", - # grpc / http service addresses - "APP_PROVIDER_GRPC_ADDR": "0.0.0.0:10164", - "APP_REGISTRY_GRPC_ADDR": "0.0.0.0:10242", - "AUTH_BASIC_GRPC_ADDR": "0.0.0.0:10146", - "AUTH_MACHINE_GRPC_ADDR": "0.0.0.0:10166", - "AUTH_SERVICE_GRPC_ADDR": "0.0.0.0:10199", - "EVENTHISTORY_GRPC_ADDR": "0.0.0.0:10274", - "FRONTEND_HTTP_ADDR": "0.0.0.0:10140", - "GATEWAY_GRPC_ADDR": "0.0.0.0:10142", - "GRAPH_HTTP_ADDR": "0.0.0.0:10120", - "GROUPS_GRPC_ADDR": "0.0.0.0:10160", - "IDM_LDAPS_ADDR": "0.0.0.0:10235", - "IDP_HTTP_ADDR": "0.0.0.0:10130", - "NATS_NATS_HOST": "0.0.0.0", - "NATS_NATS_PORT": "10233", - "OCDAV_HTTP_ADDR": "0.0.0.0:10350", - "OCM_HTTP_ADDR": "0.0.0.0:10280", - "OCM_GRPC_ADDR": "0.0.0.0:10282", - "OCM_OCM_STORAGE_DATA_SERVER_URL": "http://localhost:10280/data", - "OCS_HTTP_ADDR": "0.0.0.0:10110", - "SEARCH_GRPC_ADDR": "0.0.0.0:10220", - "SETTINGS_GRPC_ADDR": "0.0.0.0:10185", - "SETTINGS_HTTP_ADDR": "0.0.0.0:10186", - "SHARING_GRPC_ADDR": "0.0.0.0:10150", - "SSE_HTTP_ADDR": "0.0.0.0:10132", - "STORAGE_PUBLICLINK_GRPC_ADDR": "0.0.0.0:10178", - "STORAGE_SHARES_GRPC_ADDR": "0.0.0.0:10154", - "STORAGE_SYSTEM_GRPC_ADDR": "0.0.0.0:10215", - "STORAGE_SYSTEM_HTTP_ADDR": "0.0.0.0:10216", - "STORAGE_SYSTEM_DATA_SERVER_URL": "http://localhost:10216/data", - "STORAGE_USERS_GRPC_ADDR": "0.0.0.0:10157", - "STORAGE_USERS_HTTP_ADDR": "0.0.0.0:10158", - "STORAGE_USERS_DATA_SERVER_URL": "http://localhost:10158/data", - "STORE_GRPC_ADDR": "0.0.0.0:10460", - "THUMBNAILS_GRPC_ADDR": "0.0.0.0:10191", - "THUMBNAILS_HTTP_ADDR": "0.0.0.0:10190", - "THUMBNAILS_DATA_ENDPOINT": "http://localhost:10190/thumbnails/data", - "USERLOG_HTTP_ADDR": "0.0.0.0:10211", - "USERS_GRPC_ADDR": "0.0.0.0:10144", - "WEB_HTTP_ADDR": "0.0.0.0:10100", - "WEBDAV_HTTP_ADDR": "0.0.0.0:10115", - "WEBFINGER_HTTP_ADDR": "0.0.0.0:10275", - "ACTIVITYLOG_HTTP_ADDR": "0.0.0.0:10195", - # debug addresses - "ACTIVITYLOG_DEBUG_ADDR": "0.0.0.0:10261", - "APP_PROVIDER_DEBUG_ADDR": "0.0.0.0:10165", - "APP_REGISTRY_DEBUG_ADDR": "0.0.0.0:10243", - "AUTH_BASIC_DEBUG_ADDR": "0.0.0.0:10147", - "AUTH_MACHINE_DEBUG_ADDR": "0.0.0.0:10167", - "AUTH_SERVICE_DEBUG_ADDR": "0.0.0.0:10169", - "CLIENTLOG_DEBUG_ADDR": "0.0.0.0:10260", - "EVENTHISTORY_DEBUG_ADDR": "0.0.0.0:10270", - "FRONTEND_DEBUG_ADDR": "0.0.0.0:10141", - "GATEWAY_DEBUG_ADDR": "0.0.0.0:10143", - "GRAPH_DEBUG_ADDR": "0.0.0.0:10124", - "GROUPS_DEBUG_ADDR": "0.0.0.0:10161", - "IDM_DEBUG_ADDR": "0.0.0.0:10239", - "IDP_DEBUG_ADDR": "0.0.0.0:10134", - "INVITATIONS_DEBUG_ADDR": "0.0.0.0:10269", - "NATS_DEBUG_ADDR": "0.0.0.0:10234", - "OCDAV_DEBUG_ADDR": "0.0.0.0:10163", - "OCM_DEBUG_ADDR": "0.0.0.0:10281", - "OCS_DEBUG_ADDR": "0.0.0.0:10114", - "POSTPROCESSING_DEBUG_ADDR": "0.0.0.0:10255", - "POSTPROCESSING_SERVICE_DEBUG_ADDR": "0.0.0.0:10255", - "PROXY_DEBUG_ADDR": "0.0.0.0:10205", - "SEARCH_DEBUG_ADDR": "0.0.0.0:10224", - "SETTINGS_DEBUG_ADDR": "0.0.0.0:10189", - "SHARING_DEBUG_ADDR": "0.0.0.0:10151", - "SSE_DEBUG_ADDR": "0.0.0.0:10135", - "STORAGE_PUBLICLINK_DEBUG_ADDR": "0.0.0.0:10179", - "STORAGE_SHARES_DEBUG_ADDR": "0.0.0.0:10156", - "STORAGE_SYSTEM_DEBUG_ADDR": "0.0.0.0:10217", - "STORAGE_USERS_DEBUG_ADDR": "0.0.0.0:10159", - "STORE_DEBUG_ADDR": "0.0.0.0:10464", - "THUMBNAILS_DEBUG_ADDR": "0.0.0.0:10194", - "USERLOG_DEBUG_ADDR": "0.0.0.0:10210", - "USERS_DEBUG_ADDR": "0.0.0.0:10145", - "WEB_DEBUG_ADDR": "0.0.0.0:10104", - "WEBDAV_DEBUG_ADDR": "0.0.0.0:10119", - "WEBFINGER_DEBUG_ADDR": "0.0.0.0:10279", - "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:10174", }) # init federation ocis with separate config diff --git a/tests/config/local/.env-federation b/tests/config/local/.env-federation index bcd1e7b0ef7..fa6596e84df 100644 --- a/tests/config/local/.env-federation +++ b/tests/config/local/.env-federation @@ -9,7 +9,7 @@ export OCIS_BASE_DATA_PATH=${HOME}/.ocis-10200 export OCIS_CONFIG_DIR=${HOME}/.ocis-10200/config export OCIS_EVENTS_ENDPOINT=127.0.0.1:10233 export OCIS_LDAP_URI=ldaps://localhost:10235 -export OCIS_RUNTIME_PORT=10200 +export OCIS_RUNTIME_PORT=10250 export OCIS_URL=https://localhost:10200 export OCIS_ADD_RUN_SERVICES=ocm export OCIS_ENABLE_OCM=true From 86a3b349ff70add861185dddba557a202131f62e Mon Sep 17 00:00:00 2001 From: Deyan Zhekov Date: Tue, 7 Apr 2026 16:34:12 +0300 Subject: [PATCH 4/4] test [OCISDEV-744]: documentation fixes --- docs/ocis/development/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md index dfaad89ec16..2e1523bb43a 100644 --- a/docs/ocis/development/testing.md +++ b/docs/ocis/development/testing.md @@ -549,7 +549,7 @@ From the `Run and Debug` panel of VSCode, select `Fed oCIS Server` and start the source tests/config/local/.env-federation && ocis/bin/ocis init # run oCIS -ocis/bin/ocis server +source tests/config/local/.env-federation && ocis/bin/ocis server ``` The second oCIS instance should be available at: @@ -567,7 +567,7 @@ Run the acceptance test with the following command: ```bash TEST_SERVER_URL="https://localhost:9200" \ TEST_SERVER_FED_URL="https://localhost:10200" \ -BEHAT_FEATURE="tests/acceptance/features/apiOcm/ocm.feature" \ +BEHAT_SUITE=apiOcm \ make test-acceptance-api ```