diff --git a/Makefile b/Makefile index f8afe9d..3902edc 100644 --- a/Makefile +++ b/Makefile @@ -184,6 +184,8 @@ test-http-client: /workdir/customer_support.http \ /workdir/power_on.http \ /workdir/get_bmx_services.http \ + /workdir/get_bmx_services_availability.http \ + /workdir/get_ced_index.http \ /workdir/get_sourceproviders.http \ /workdir/get_software_update.http \ /workdir/get_soundtouch_updates.http \ diff --git a/tests/integration/http-client/COVERAGE.md b/tests/integration/http-client/COVERAGE.md index 4308794..a927dc8 100644 --- a/tests/integration/http-client/COVERAGE.md +++ b/tests/integration/http-client/COVERAGE.md @@ -16,6 +16,9 @@ Recordings are used as a **reference for route + request/response shape only**; no raw recorded bodies (which carry real ids/IPs/MACs/tokens) are committed. Authored flows use the RFC-5737 / placeholder values from `http-client.env.json`. +TuneIn upstream (radiotime.com) is served by `mock-tunein` in CI (see +`TUNEIN-MOCK-MISSING.md`), so the suite has no live external dependency. + Variable path segments are templated: `{stationID}`, `{episodeID}`, `{hash}`, `{encodedURL}`, `{provider}/{file}`. @@ -23,76 +26,76 @@ Legend: ✅ covered · ⬜ gap · 〰️ partial (some status/variant uncovered) ## Frozen speaker routes -| Method | Route | Status(es) observed | Covered by | State | -|-------------|----------------------------------------------------|---------------------|--------------------------------------------------------------|----------------------------------------------------| -| GET | `/streaming/account/{a}/full` | 200, 304 | `get_full_account.http`, `get_full_account_conditional.http` | ✅ | -| GET | `/streaming/account/{a}/devices` | 200 | `get_account_devices.http` | ✅ | -| GET | `/streaming/account/{a}/sources` | 200 | `get_account_sources.http` | ✅ | -| GET | `/streaming/account/{a}/presets/all` | 200 | `get_account_presets.http` | ✅ | -| GET | `/streaming/account/{a}/provider_settings` | 200 | `get_provider_settings.http` | ✅ | -| POST | `/streaming/account` (+ `/login`) | 201/200 | `create_account.http` | ✅ | -| POST | `/streaming/account/{a}/device/` | 201 | `register_device.http` | ✅ | -| PUT | `/streaming/account/{a}/device/{d}` | 200, 401 | `rename_device.http` | 〰️ (401 gap) | -| DELETE | `/streaming/account/{a}/device/{d}` | 200 | `unregister_device.http` | ✅ | -| GET | `/streaming/account/{a}/device/{d}/group/` | 200 | `get_group.http` | ✅ | -| GET | `/streaming/account/{a}/device/{d}/presets` | 200, 304 | `get_presets.http`, `get_presets_conditional.http` | ✅ | -| PUT | `/streaming/account/{a}/device/{d}/preset/{n}` | 200 | `set_preset_5/6.http` | ✅ | -| DELETE | `/streaming/account/{a}/device/{d}/preset/{n}` | 200 | `delete_preset_6.http` | ✅ | -| POST | `/streaming/account/{a}/device/{d}/recent` | 201 | `post_recent.http` | ✅ | -| GET | `/streaming/account/{a}/device/{d}/recents` | 200 | `get_recents.http` | ✅ | -| POST | `/streaming/account/{a}/source` | 200 | `set_preset_5.http` | ✅ | -| POST | `/streaming/account/{a}/group/` | 201 | `create_group.http` | ✅ | -| DELETE | `/streaming/account/{a}/group/` | 200 | `delete_group.http` | ✅ (account-level teardown) | -| DELETE | `/streaming/account/{a}/group/{id}` | 200 | `delete_group.http` | ✅ | -| GET | `/streaming/device/{d}/streaming_token` | 200 | `get_streaming_token.http` | ✅ | -| GET | `/streaming/software/update/account/{a}` | 200 | `get_software_update.http` | ✅ | -| GET | `/streaming/sourceproviders` | 200 | `get_sourceproviders.http` | ✅ | -| GET | `/streaming/resources/api_versions.xml` | 200 | `get_api_versions.http` | ✅ | -| POST | `/streaming/support/power_on` | 200 | `power_on.http` | ✅ | -| POST | `/streaming/support/customersupport` | 200 | `customer_support.http` | ✅ | -| POST | `/streaming/music/musicprovider/{id}/is_eligible` | 200 | `post_musicprovider_is_eligible.http` | ✅ | -| POST | `/accounts/{a}/devices` | 201 | `register_device.http` | ✅ | -| DELETE | `/accounts/{a}/devices/{d}` | 200 | `unregister_device.http` | ✅ | -| GET | `/updates/soundtouch` | 200 | `get_soundtouch_updates.http` | ✅ | -| GET | `/v1/auth` | 200, 403, 404 | — | ⬜ (Go unit: `auth_probe_test.go`) | -| POST | `/v1/scmudc/{d}` | 200 | — | ⬜ | -| GET | `/v1/blacklist/{d}` | 405 | — | ⬜ (edge) | -| POST | `/alexa/certificate` | 501 (rare 200) | — | ⬜ (edge) | -| GET | `/bmx/registry/v1/services` | 200 | `get_bmx_services.http` | ✅ | -| POST | `/bmx/tunein/v1/token` | 200 | `tunein_playback_station.http` | ✅ | -| GET | `/bmx/tunein/v1/playback/station/{stationID}` | 200, 401 | `tunein_playback_station.http` | ✅ (offline via mock-tunein) | -| GET | `/bmx/tunein/v1/playback/episode(s)/{episodeID}` | 200 | — | ⬜ (needs mock fixture, see TUNEIN-MOCK-MISSING.md) | -| POST | `/bmx/tunein/v1/report` | 200 | `post_tunein_report.http` | ✅ | -| POST/DELETE | `/bmx/tunein/v1/favorite/{stationID}` | 202 | `tunein_favorite.http` | ✅ (local-only) | -| GET | `/core02/svc-bmx-adapter-orion/prod/orion/station` | 200 | — | ⬜ | -| GET | `/custom/v1/playback/{encodedURL}` | 200 | — | ⬜ | -| GET | `/media/aftertouch-ding.wav` | 200 (binary) | — | ⬜ | -| GET | `/media/bmx-icons/{provider}/{file}` | 200 (binary) | — | ⬜ | -| GET | `/media/tts/{hash}.mp3` | 200, 404 (binary) | — | ⬜ (depends on prior TTS) | -| GET | `/ced/utilities/audio/take5.mp3` | 404 | — | ⬜ (edge: CED static miss) | -| POST | `/oauth/device/{d}/.../15/token/cs3` | 200 | `post_oauth_token.http` | ✅ | -| POST | `/oauth/device/{d}/.../20/token/cs1` | 200 | `post_oauth_token_amazon.http` | ✅ | +| Method | Route | Status(es) observed | Covered by | State | +|--------|-------|---------------------|------------|-------| +| GET | `/streaming/account/{a}/full` | 200, 304 | `get_full_account.http`, `get_full_account_conditional.http` | ✅ | +| GET | `/streaming/account/{a}/devices` | 200 | `get_account_devices.http` | ✅ | +| GET | `/streaming/account/{a}/sources` | 200 | `get_account_sources.http` | ✅ | +| GET | `/streaming/account/{a}/presets/all` | 200 | `get_account_presets.http` | ✅ | +| GET | `/streaming/account/{a}/provider_settings` | 200 | `get_provider_settings.http` | ✅ | +| POST | `/streaming/account` (+ `/login`) | 201/200 | `create_account.http` | ✅ | +| POST | `/streaming/account/{a}/device/` | 201 | `register_device.http` | ✅ | +| PUT | `/streaming/account/{a}/device/{d}` | 200, 401 | `rename_device.http` | 〰️ (401 gap) | +| DELETE | `/streaming/account/{a}/device/{d}` | 200 | `unregister_device.http` | ✅ | +| GET | `/streaming/account/{a}/device/{d}/group/` | 200 | `get_group.http` | ✅ | +| GET | `/streaming/account/{a}/device/{d}/presets` | 200, 304 | `get_presets.http`, `get_presets_conditional.http` | ✅ | +| PUT | `/streaming/account/{a}/device/{d}/preset/{n}` | 200 | `set_preset_5/6.http` | ✅ | +| DELETE | `/streaming/account/{a}/device/{d}/preset/{n}` | 200 | `delete_preset_6.http` | ✅ | +| POST | `/streaming/account/{a}/device/{d}/recent` | 201 | `post_recent.http` | ✅ | +| GET | `/streaming/account/{a}/device/{d}/recents` | 200 | `get_recents.http` | ✅ | +| POST | `/streaming/account/{a}/source` | 200 | `set_preset_5.http` | ✅ | +| POST | `/streaming/account/{a}/group/` | 201 | `create_group.http` | ✅ | +| DELETE | `/streaming/account/{a}/group/` | 200 | `delete_group.http` | ✅ (account-level teardown) | +| DELETE | `/streaming/account/{a}/group/{id}` | 200 | `delete_group.http` | ✅ | +| GET | `/streaming/device/{d}/streaming_token` | 200 | `get_streaming_token.http` | ✅ | +| GET | `/streaming/software/update/account/{a}` | 200 | `get_software_update.http` | ✅ | +| GET | `/streaming/sourceproviders` | 200 | `get_sourceproviders.http` | ✅ | +| GET | `/streaming/resources/api_versions.xml` | 200 | `get_api_versions.http` | ✅ | +| POST | `/streaming/support/power_on` | 200 | `power_on.http` | ✅ | +| POST | `/streaming/support/customersupport` | 200 | `customer_support.http` | ✅ | +| POST | `/streaming/music/musicprovider/{id}/is_eligible` | 200 | `post_musicprovider_is_eligible.http` | ✅ | +| POST | `/accounts/{a}/devices` | 201 | `register_device.http` | ✅ | +| DELETE | `/accounts/{a}/devices/{d}` | 200 | `unregister_device.http` | ✅ | +| GET | `/updates/soundtouch` | 200 | `get_soundtouch_updates.http` | ✅ | +| GET | `/v1/auth` | 200, 403, 404 | `get_speaker_auth.http` | ✅ (200; 403/404 probe/edge) | +| POST | `/v1/scmudc/{d}` | 200 | `post_scmudc_event.http` | ✅ | +| GET | `/v1/blacklist/{d}` | 405 | — | ⬜ (edge) | +| POST | `/alexa/certificate` | 501 (rare 200) | — | ⬜ (edge) | +| GET | `/bmx/registry/v1/services` | 200 | `get_bmx_services.http` | ✅ | +| GET | `/bmx/registry/v1/servicesAvailability` | 200 | `get_bmx_services_availability.http` | ✅ | +| POST | `/bmx/tunein/v1/token` | 200 | `tunein_playback_station.http` | ✅ | +| GET | `/bmx/tunein/v1/playback/station/{stationID}` | 200, 401 | `tunein_playback_station.http` | ✅ (offline via mock-tunein) | +| GET | `/bmx/tunein/v1/playback/episode(s)/{episodeID}` | 200 | — | ⬜ (needs mock fixture, see TUNEIN-MOCK-MISSING.md) | +| POST | `/bmx/tunein/v1/report` | 200 | `post_tunein_report.http` | ✅ | +| POST/DELETE | `/bmx/tunein/v1/favorite/{stationID}` | 202 | `tunein_favorite.http` | ✅ (local-only) | +| GET | `/core02/svc-bmx-adapter-orion/prod/orion/station` | 200 | `get_orion_station.http` | ✅ | +| GET | `/custom/v1/playback/{encodedURL}` | 200 | `get_custom_playback.http` | ✅ | +| GET | `/media/aftertouch-ding.wav` | 200 (binary) | `get_media_ding.http` | ✅ | +| GET | `/media/bmx-icons/{provider}/{file}` | 200 (binary) | `get_bmx_icon.http` | ✅ | +| GET | `/media/tts/{hash}.mp3` | 200, 404 (binary) | — | ⬜ (depends on prior TTS) | +| GET | `/ced/soundtouch/.../index.xml` | 200 | `get_ced_index.http` | ✅ (absent paths 404) | +| POST | `/oauth/device/{d}/.../15/token/cs3` | 200 | `post_oauth_token.http` | ✅ | +| POST | `/oauth/device/{d}/.../20/token/cs1` | 200 | `post_oauth_token_amazon.http` | ✅ | ## Not observed from the speaker (lower priority / different audience) - `/bmx/tunein/v1/navigate`, `/search`, `/search/next` — registered (frozen), but in the corpus the speaker uses `/playback/*`; the search/navigate layer is driven by the app/UI (`/api/tunein/*`), not the speaker. Covered conceptually, - no speaker recording to replay. + no speaker recording to replay (and no upstream fixture yet, see + TUNEIN-MOCK-MISSING.md). - `/core02/svc-bmx-adapter-siriusxm-*` — registered, but not present in this corpus (no SiriusXM device). Left as a known blank. - App / provisioning surface (`/customer/account*`, account profile/password, `/streaming/account/login` beyond create) — app-called, not the speaker data-plane; out of scope for the speaker-contract net. -## Gap-fill priority +## Remaining gaps -1. **High (pure service, no external dep):** `/v1/auth`, `/v1/scmudc/{d}`, - `/core02/.../orion/station`, `/custom/v1/playback/{encodedURL}`, - `/bmx/tunein/v1/report`, `/media/aftertouch-ding.wav`, - `/media/bmx-icons/{...}`, group delete lifecycle. -2. **Medium (TuneIn live dep, like the existing playback test):** - `/bmx/tunein/v1/playback/episode(s)/{id}`, `/bmx/tunein/v1/favorite/{id}`. -3. **Low / edge (still open):** PUT-device 401, `/v1/blacklist` 405, - `/ced/*` 404, `/alexa/certificate` 501, `/media/tts/{hash}`. Quirky-status - pins; add on demand. +- `/bmx/tunein/v1/playback/episode(s)/{id}` — needs a captured radiotime + profile-contents fixture for the mock (see TUNEIN-MOCK-MISSING.md). +- `/media/tts/{hash}.mp3` — returns 200 only after a TTS has been generated + (otherwise a 404 miss). Needs a prior `/setup/tts/speak` step to be a + deterministic 200. +- Edge statuses (quirky-status pins, add on demand): PUT-device `401`, + `/v1/blacklist` `405`, `/alexa/certificate` `501`. diff --git a/tests/integration/http-client/get_bmx_services_availability.http b/tests/integration/http-client/get_bmx_services_availability.http new file mode 100644 index 0000000..cf81ee7 --- /dev/null +++ b/tests/integration/http-client/get_bmx_services_availability.http @@ -0,0 +1,17 @@ +### GET /bmx/registry/v1/servicesAvailability (BMX service availability registry) +### +### Frozen BMX route, sibling of /bmx/registry/v1/services. The speaker queries +### which BMX services are available; the service returns the embedded registry +### JSON (HandleBMXServicesAvailability). Static, no upstream call. +GET {{host}}/bmx/registry/v1/servicesAvailability +User-Agent: Bose_Lisa/27.0.6 +Accept: */* +X-Bmx-Api-Key: {{bmxApiKey}} + +> {% + client.test("Availability registry served as JSON 200", function() { + client.assert(response.status === 200, "Response status is not 200, got " + response.status); + client.assert(response.contentType.mimeType === "application/json", + "Expected application/json, got '" + response.contentType.mimeType + "'"); + }); +%} diff --git a/tests/integration/http-client/get_ced_index.http b/tests/integration/http-client/get_ced_index.http new file mode 100644 index 0000000..365aeaf --- /dev/null +++ b/tests/integration/http-client/get_ced_index.http @@ -0,0 +1,17 @@ +### GET /ced/soundtouch/mr4_22097fe2/index.xml (CED firmware-update config) +### +### Frozen route mirroring downloads.bose.com/ced/soundtouch/...; the speaker +### fetches its CED update index from this static base (HandleCedStatic serves the +### embedded file tree). A present file returns 200 XML; absent paths 404 (the +### recorded take5.mp3 was such a miss). Static, no upstream call. +GET {{host}}/ced/soundtouch/mr4_22097fe2/index.xml +User-Agent: Bose_Lisa/27.0.6 +Accept: */* + +> {% + client.test("CED index served as XML 200", function() { + client.assert(response.status === 200, "Response status is not 200, got " + response.status); + client.assert(response.contentType.mimeType.indexOf("xml") !== -1, + "Expected an XML content type, got '" + response.contentType.mimeType + "'"); + }); +%}