From 338aff0cb5a07237e5147daecf9872f1edc5922b Mon Sep 17 00:00:00 2001 From: ertopogo Date: Sat, 14 Mar 2026 16:20:58 +0100 Subject: Fix WSL bash scripts line endings (LF) and document CRLF troubleshooting --- tests/README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/README.md (limited to 'tests/README.md') diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..170e1af --- /dev/null +++ b/tests/README.md @@ -0,0 +1,44 @@ +# Tests E2E ACL medias + +## Prerequis +- `curl` +- `jq` +- Acces a `kc.arauco.online` et `media-api.arauco.online` + +## 1) Recuperer un token OIDC +```bash +bash tests/get_token.sh +``` + +Le script genere: +- `tests/.token` +- `tests/.env.test` (si absent) + +### Si erreur `bash\r` ou `pipefail` +Les scripts ont ete modifies pour forcer des fins de ligne Linux (`LF`) via `.gitattributes`. +Sur un clone existant sous WSL, normaliser une fois: +```bash +sed -i 's/\r$//' tests/*.sh +chmod +x tests/*.sh +``` + +## 2) Lancer les tests permissions + presign +```bash +bash tests/e2e_permissions_and_presign.sh +``` + +## Variables a renseigner +Fichier `tests/.env.test`: +- `KC_REALM` +- `KC_CLIENT_ID` +- `KC_CLIENT_SECRET` +- `KC_USER` +- `KC_PASS` +- `MEDIA_API_BASE_URL` +- `TEST_ALLOWED_OBJECT_KEY` +- `TEST_FORBIDDEN_OBJECT_KEY` + +## Resultat attendu +- `GET /v1/permissions` retourne `200` +- `POST /v1/presign` objet autorise retourne `200` +- `POST /v1/presign` objet interdit retourne `403` (ou `404` si la ressource n'existe pas et l'API choisit de masquer) -- cgit v1.2.3