[![status-badge](https://ci.batsense.net/host-metai/badges/93/status.svg)](https://ci.batsense.net/repos/93) [![status-badge](https://ci.batsense.net/host-metai/badges/90/status.svg)](https://ci.batsense.net/repos/90) --- # [Host Meta](https://www.rfc-editor.org/rfc/rfc6415.html) tests for ForgeFlux/ftest ## TODO - [ ] Write code to upload to ftest server - [ ] Package Docker container - [ ] Upload to Docker Hub ## Environment Variables Please see [`.env_sample`](./.env_sample) | NAME | Purpose | Example | | ------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `FTEST_AUTH` | Authorization token for uploading test results to ftest server | a random-generated string that will be provided by ftest server | | `FTEST_HOST` | The URL of the ftest's instance to which tests results should be uploaded | `http://localhost:5000`, if an ftest implementation is running on localhost at port 5000 | | `FTEST_TARGET_HOST` | The URL of the implementation's instance against which tests will be run | `http://localhost:3000`, if Forgejo or any other ActivityPub implementation is running on localhost at port 3000 | | `FTEST_USER` | address of the actor against which ActivityPub tests will be run | `john@localhost:3000`. User `john` should exist on the instance | ## Usage ```bash cp .env_sample .env # edit and populate .env with the right values source .env python run.py ``` ### Docker ```bash cp .env_sample .env # edit and populate .env with the right values source .env docker run \ -e FTEST_AUTH=$FTEST_AUTH \ -e FTEST_TARGET_HOST=$FTEST_TARGET_HOST \ -e FTEST_HOST=$FTEST_HOST \ -e FTEST_USER=$FTEST_USER forgeflux/host-meta-test ``` ## Demo ### Successful run:
Please open to see logs ```bash 17:22 (venv) atm@lab host-meta ±|master ✗|→ behave 2023-10-02 17:22:23,120 - ap - INFO - Environment: FTEST_AUTH: foobar 2023-10-02 17:22:23,120 - ap - INFO - Environment: FTEST_HOST: http://localhost:9000 2023-10-02 17:22:23,120 - ap - INFO - Environment: FTEST_USER: realaravinth@batsense.net 2023-10-02 17:22:23,120 - ap - INFO - Environment: FTEST_TARGET_HOST: https://gts.batsense.net Feature: Host Meta # features/host_meta.feature:1 As defined in https://www.rfc-editor.org/rfc/rfc6415.html Scenario: # features/host_meta.feature:4 Given A Fediverse server # features/steps/host_meta.py:43 0.000s When Querying /.well-known/host-meta # features/steps/host_meta.py:48 2023-10-02 17:22:23,134 - ap - DEBUG - host-meta response: STATUS: 404 HEADERS: {'Server': 'nginx/1.18.0', 'Date': 'Mon, 02 Oct 2023 11:52:23 GMT', 'Content-Type': 'text/html', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip'} RESPONSE PAYLOAD: b'\r\n404 Not Found\r\n\r\n

404 Not Found

\r\n
nginx/1.18.0
\r\n\r\n\r\n' 2023-10-02 17:22:23,167 - ap - DEBUG - host-meta response: STATUS: 200 HEADERS: {'Server': 'nginx/1.18.0', 'Date': 'Mon, 02 Oct 2023 11:52:23 GMT', 'Content-Type': 'application/xrd+xml', 'Content-Length': '206', 'Connection': 'keep-alive', 'Cache-Control': 'public, max-age=120', 'Content-Encoding': 'gzip', 'Content-Security-Policy': "default-src 'self'; object-src 'none'; img-src 'self' blob:; media-src 'self'", 'Permissions-Policy': 'browsing-topics=(), interest-cohort=()', 'Vary': 'Accept-Encoding', 'X-Ratelimit-Limit': '300', 'X-Ratelimit-Remaining': '296', 'X-Ratelimit-Reset': '1696247748', 'X-Request-Id': 'fhtkqw4a04000cj8v2a0'} RESPONSE PAYLOAD: b'\n 1 feature passed, 0 failed, 0 skipped 1 scenario passed, 0 failed, 0 skipped 11 steps passed, 0 failed, 0 skipped, 0 undefined Took 0m0.056s ```