Fix relative path in context and endpoint being overwritten with a partial path
-
@context relative reference → absolute URL resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld declared one of its @context entries as a bare relative filename ("ngsi-ld-test-suite.jsonld") instead of a fully-qualified URL. Brokers that don't perform relative-IRI resolution on nested/imported JSON-LD contexts (confirmed with Scorpio) fail to resolve it and reject any request carrying this context with LdContextNotAvailable (503). Fixed by making the entry an absolute URL.
-
context_source_url vs endpoint when creating CSourceRegistrations Distributed-operations tests previously built the registration endpoint inline at each call site (endpoint=${context_source_url}/broker1), duplicated across every test file. Centralized this so tests pass only the relative suffix (endpoint=/broker1) and the base URL is resolved in one place. Prevents drift between tests and makes it possible to point the whole suite at a different reachable host (e.g. host.docker.internal when the broker under test runs in Docker and needs to reach the stub server on the host) via a single variable instead of editing every test.
-
Mock stub-matching fixes (HttpCtrl/http_stub.py) The vendored mock library's stub matcher had a loose fallback for GET requests whose query string doesn't exactly match a registered stub (needed because brokers forward distributed retrieveEntity/query operations with extra query parameters, e.g. ?sysAttrs=true or ?id=...&type=...). The fallback only checked that entity-id fragments appeared somewhere in the request URL — it never checked the request's base path/prefix. As a result, a stub registered for one Context Source (/broker1/...) could silently satisfy a request actually sent to a different Context Source (/broker2/...), since both reference the same entity id. This made multi-source redirect tests (two overlapping mode: redirect registrations for the same entity) pass through only one of the two registered stubs and never exercise the second, hiding real distributed-operations behavior — including cases where the entity broker actually does correctly query both sources.
Fixed the matcher to require the request's base path to match the stub's own path, handling both URL shapes seen across broker implementations:
id kept in the path, extra query params appended (e.g. .../entities/{id}?sysAttrs=true) id moved out of the path into a query parameter (e.g. .../entities?id=...&type=...) Verified against two broker implementations with different redirect URL shapes (Scorpio and Coraine/Seamware with --distributed) — both now correctly attribute each forwarded request to the Context Source that actually made it, and multi-source responses merge as expected.