diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index fcd7fcfe1fd..95d630287fe 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -5,112 +5,113 @@ on: workflow_dispatch: jobs: - coding-standard: - name: coding-standard - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 - with: - php-version: "8.4" - extensions: curl, xml, mbstring, zip - tools: composer - - name: PHP code style - run: | - make vendor-bin-codestyle - make vendor-bin-codesniffer - make test-php-style - - name: Check env var annotations - run: make check-env-var-annotations +# UNCOMMEMENT AT THE END + # coding-standard: + # name: coding-standard + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 + # with: + # php-version: "8.4" + # extensions: curl, xml, mbstring, zip + # tools: composer + # - name: PHP code style + # run: | + # make vendor-bin-codestyle + # make vendor-bin-codesniffer + # make test-php-style + # - name: Check env var annotations + # run: make check-env-var-annotations - check-gherkin-standard: - name: check-gherkin-standard - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version: "24" - - name: Lint feature files - run: | - npm install -g @gherlint/gherlint@1.1.0 - make test-gherkin-lint + # check-gherkin-standard: + # name: check-gherkin-standard + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + # with: + # node-version: "24" + # - name: Lint feature files + # run: | + # npm install -g @gherlint/gherlint@1.1.0 + # make test-gherkin-lint - check-suites-in-expected-failures: - name: check-suites-in-expected-failures - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Check suites - run: bash tests/acceptance/check-deleted-suites-in-expected-failure.sh + # check-suites-in-expected-failures: + # name: check-suites-in-expected-failures + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - name: Check suites + # run: bash tests/acceptance/check-deleted-suites-in-expected-failure.sh - build-and-test: - name: build-and-test - needs: [coding-standard, check-gherkin-standard, check-suites-in-expected-failures] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 - with: - go-version-file: go.mod - cache: true + # build-and-test: + # name: build-and-test + # needs: [coding-standard, check-gherkin-standard, check-suites-in-expected-failures] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 + # with: + # go-version-file: go.mod + # cache: true - - name: Build ocis - run: make -C ocis build + # - name: Build ocis + # run: make -C ocis build - - name: Unit tests - run: make test + # - name: Unit tests + # run: make test local-api-tests: name: ${{ matrix.suite }} - needs: [build-and-test] + needs: [] # UNCOMMEMENT AT THE END [build-and-test] runs-on: ubuntu-latest strategy: fail-fast: false matrix: suite: - # contract & locks - - apiContract - - apiLocks - # settings & notifications (needs email) - - apiSettings - - apiNotification - - apiCors - # graph - - apiGraphUser - - apiGraph - - apiGraphGroup - # spaces & dav - - apiSpaces - - apiSpacesShares - - apiSpacesDavOperation - - apiDownloads - - apiAsyncUpload - - apiDepthInfinity - - apiArchiver - - apiActivities - # search - - apiSearch1 - # - apiSearch2 - - apiSearchContent # needs Tika - # sharing - - apiSharingNgShares - - apiReshare - - apiSharingNgPermissions - - apiSharingNgAdditionalShareRole - - apiSharingNgDriveInvitation - - apiSharingNgItemInvitation - - apiSharingNgDriveLinkShare - - apiSharingNgItemLinkShare - - apiSharingNgLinkShareManagement - # auth - - apiAuthApp - # antivirus (needs ClamAV) - - apiAntivirus - # federation (needs email + federation ocis) - # - apiOcm - # collaboration (needs WOPI) - - apiCollaboration + # # contract & locks + # - apiContract + # - apiLocks + # # settings & notifications (needs email) + # - apiSettings + # - apiNotification + # - apiCors + # # graph + # - apiGraphUser + # - apiGraph + # - apiGraphGroup + # # spaces & dav + # - apiSpaces + # - apiSpacesShares + # - apiSpacesDavOperation + # - apiDownloads + # - apiAsyncUpload + # - apiDepthInfinity + # - apiArchiver + # - apiActivities + # # search + # - apiSearch1 + # # - apiSearch2 + # - apiSearchContent # needs Tika + # # sharing + # - apiSharingNgShares + # - apiReshare + # - apiSharingNgPermissions + # - apiSharingNgAdditionalShareRole + # - apiSharingNgDriveInvitation + # - apiSharingNgItemInvitation + # - apiSharingNgDriveLinkShare + # - apiSharingNgItemLinkShare + # - apiSharingNgLinkShareManagement + # # auth + # - apiAuthApp + # # antivirus (needs ClamAV) + # - apiAntivirus + # # federation (needs email + federation ocis) + - apiOcm + # # collaboration (needs WOPI) + # - apiCollaboration steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 @@ -156,108 +157,110 @@ jobs: - name: Run ${{ matrix.suite }} run: BEHAT_SUITES=${{ matrix.suite }} python3 tests/acceptance/run-github.py - cli-tests: - needs: [build-and-test] - name: ${{ matrix.suite }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - suite: - - cliCommands,apiServiceAvailability # grouped like drone; needs ClamAV + email - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 - with: - go-version-file: go.mod - cache: true +# UNCOMMEMENT AT THE END + # cli-tests: + # needs: [build-and-test] + # name: ${{ matrix.suite }} + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # suite: + # - cliCommands,apiServiceAvailability # grouped like drone; needs ClamAV + email + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 + # with: + # go-version-file: go.mod + # cache: true - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version: "24" + # - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + # with: + # node-version: "24" - - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate + # - name: Enable pnpm + # run: corepack enable && corepack prepare pnpm@10.28.1 --activate - - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 - with: - php-version: "8.4" - extensions: curl, xml, mbstring, zip - tools: composer + # - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 + # with: + # php-version: "8.4" + # extensions: curl, xml, mbstring, zip + # tools: composer - - name: Run ${{ matrix.suite }} - run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py + # - name: Run ${{ matrix.suite }} + # run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py - core-api-tests: - name: ${{ matrix.suite }} - needs: [build-and-test] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - suite: - - "coreApiShareManagementBasicToShares,coreApiShareManagementToShares" - - "coreApiSharees,coreApiSharePublicLink2" - - "coreApiShareOperationsToShares1,coreApiShareOperationsToShares2,coreApiSharePublicLink1,coreApiShareCreateSpecialToShares1,coreApiShareCreateSpecialToShares2,coreApiShareUpdateToShares" - - "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2" - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 - with: - go-version-file: go.mod - cache: true +# UNCOMMEMENT AT THE END + # core-api-tests: + # name: ${{ matrix.suite }} + # needs: [build-and-test] + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # suite: + # - "coreApiShareManagementBasicToShares,coreApiShareManagementToShares" + # - "coreApiSharees,coreApiSharePublicLink2" + # - "coreApiShareOperationsToShares1,coreApiShareOperationsToShares2,coreApiSharePublicLink1,coreApiShareCreateSpecialToShares1,coreApiShareCreateSpecialToShares2,coreApiShareUpdateToShares" + # - "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2" + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 + # with: + # go-version-file: go.mod + # cache: true - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version: "24" + # - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + # with: + # node-version: "24" - - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate + # - name: Enable pnpm + # run: corepack enable && corepack prepare pnpm@10.28.1 --activate - - name: Install libcurl 8.12.0 from source - run: | - sudo apt-get update -qq - sudo apt-get install -y libssl-dev libnghttp2-dev libpsl-dev libldap-dev libssh-dev zlib1g-dev libvips-dev - cd /tmp - curl -sLO https://curl.se/download/curl-8.12.0.tar.gz - tar xzf curl-8.12.0.tar.gz - cd curl-8.12.0 - ./configure --with-ssl --with-zlib --with-nghttp2 --prefix=/usr/local --enable-versioned-symbols --silent - make -j$(nproc) --silent - sudo make install --silent - sudo ldconfig - curl --version | head -1 - php -r ' - $v = curl_version()["version"]; - echo "PHP curl: $v\n"; - if (version_compare($v, "8.12.0", "<")) { - fwrite(STDERR, "FATAL: PHP sees libcurl $v, need >= 8.12.0\n"); - exit(1); - } - ' + # - name: Install libcurl 8.12.0 from source + # run: | + # sudo apt-get update -qq + # sudo apt-get install -y libssl-dev libnghttp2-dev libpsl-dev libldap-dev libssh-dev zlib1g-dev libvips-dev + # cd /tmp + # curl -sLO https://curl.se/download/curl-8.12.0.tar.gz + # tar xzf curl-8.12.0.tar.gz + # cd curl-8.12.0 + # ./configure --with-ssl --with-zlib --with-nghttp2 --prefix=/usr/local --enable-versioned-symbols --silent + # make -j$(nproc) --silent + # sudo make install --silent + # sudo ldconfig + # curl --version | head -1 + # php -r ' + # $v = curl_version()["version"]; + # echo "PHP curl: $v\n"; + # if (version_compare($v, "8.12.0", "<")) { + # fwrite(STDERR, "FATAL: PHP sees libcurl $v, need >= 8.12.0\n"); + # exit(1); + # } + # ' - - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 - with: - php-version: "8.4" - extensions: curl, xml, mbstring, zip - tools: composer + # - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 + # with: + # php-version: "8.4" + # extensions: curl, xml, mbstring, zip + # tools: composer - - name: Run ${{ matrix.suite }} - run: > - BEHAT_SUITES="${{ matrix.suite }}" - ACCEPTANCE_TEST_TYPE=core-api - EXPECTED_FAILURES_FILE=tests/acceptance/expected-failures-API-on-OCIS-storage.md - python3 tests/acceptance/run-github.py + # - name: Run ${{ matrix.suite }} + # run: > + # BEHAT_SUITES="${{ matrix.suite }}" + # ACCEPTANCE_TEST_TYPE=core-api + # EXPECTED_FAILURES_FILE=tests/acceptance/expected-failures-API-on-OCIS-storage.md + # python3 tests/acceptance/run-github.py - - name: Upload test logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: test-logs-${{ matrix.suite }} - path: tests/acceptance/output/ + # - name: Upload test logs + # if: failure() + # uses: actions/upload-artifact@v4 + # with: + # name: test-logs-${{ matrix.suite }} + # path: tests/acceptance/output/ all-acceptance-tests: - needs: [local-api-tests, cli-tests, core-api-tests] + needs: [local-api-tests] # UNCOMMEMENT AT THE END [local-api-tests, cli-tests, core-api-tests] runs-on: ubuntu-latest if: always() steps: diff --git a/tests/acceptance/run-github.sh b/tests/acceptance/run-cs3api.sh old mode 100755 new mode 100644 similarity index 63% rename from tests/acceptance/run-github.sh rename to tests/acceptance/run-cs3api.sh index 469fd5bb12e..89a74c8b201 --- a/tests/acceptance/run-github.sh +++ b/tests/acceptance/run-cs3api.sh @@ -7,23 +7,14 @@ WRAPPER_BIN="$REPO_ROOT/tests/ociswrapper/bin/ociswrapper" OCIS_URL="https://localhost:9200" OCIS_CONFIG_DIR="$HOME/.ocis/config" -# suite(s) to run — set via env or passed from CI matrix -: "${BEHAT_SUITES:?BEHAT_SUITES is required, e.g. BEHAT_SUITES=apiGraph bash run-graph.sh}" - # build make -C "$REPO_ROOT/ocis" build GOWORK=off make -C "$REPO_ROOT/tests/ociswrapper" build -# php deps -cd "$REPO_ROOT" -composer install --no-progress -composer bin behat install --no-progress - -# init ocis config +# 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" -# start ociswrapper in background, kill on exit OCIS_URL=$OCIS_URL \ OCIS_CONFIG_DIR=$OCIS_CONFIG_DIR \ STORAGE_USERS_DRIVER=ocis \ @@ -37,6 +28,8 @@ 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" \ @@ -46,19 +39,12 @@ WEB_UI_CONFIG_FILE="$REPO_ROOT/tests/config/drone/ocis-config.json" \ WRAPPER_PID=$! trap "kill $WRAPPER_PID 2>/dev/null || true" EXIT -# wait for ocis graph API to be ready 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 acceptance tests for declared suites -echo "Running suites: $BEHAT_SUITES" -TEST_SERVER_URL=$OCIS_URL \ -OCIS_WRAPPER_URL=http://localhost:5200 \ -BEHAT_SUITES=$BEHAT_SUITES \ -BEHAT_FILTER_TAGS="~@skip&&~@skipOnGraph&&~@skipOnOcis-OCIS-Storage" \ -EXPECTED_FAILURES_FILE="$REPO_ROOT/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md" \ -STORAGE_DRIVER=ocis \ - make -C "$REPO_ROOT" test-acceptance-api +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 16654bd52b7..d781bcc01dd 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": { @@ -463,9 +464,93 @@ 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": "0.0.0.0: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..fa6596e84df 100644 --- a/tests/config/local/.env-federation +++ b/tests/config/local/.env-federation @@ -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