Add make test-integration: full server scenario on a private D-Bus bus

Real MediaDeckServer under aiohttp.test_utils, private session bus,
isolated XDG dirs and PATH, fake MPRIS player and fake gio/pactl/launcher
programs that log their arguments. Covers authentication, player listing
and control, audio, media listing and path escapes, shell-free opening of
a hostile file name, imported launchers and admin changes pushed to
clients. Verified to fail when the hidden-component check, the token check
or the metadata enrichment is removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-30 15:46:17 +01:00
parent 75a7e108d7
commit 64b9b15f19
5 changed files with 414 additions and 2 deletions
+4 -1
View File
@@ -15,7 +15,7 @@ PORT ?= 8765
HTTP_PORT ?=
.DEFAULT_GOAL := help
.PHONY: help deps install config token url qr cert http-on http-off check run dev lint test uinput uinput-remove \
.PHONY: help deps install config token url qr cert http-on http-off check run dev lint test test-integration uinput uinput-remove \
service-install service-uninstall status logs firewall clean distclean
help: ## Affiche cette aide
@@ -81,6 +81,9 @@ lint: $(PYTHON) ## Vérification de types (pyright)
test: $(PYTHON) ## Tests unitaires
$(PYTHON) -m unittest discover -s tests -v
test-integration: $(PYTHON) ## Scénario complet : serveur + bus D-Bus privé + faux lecteur, gio et pactl
$(PYTHON) -m unittest discover -s tests -p 'test_integration.py' -v
uinput: ## Autorise /dev/uinput pour la session active (sudo, règle udev uaccess)
sudo install -m 644 udev/60-mediadeck-uinput.rules $(UDEV_RULE)
sudo modprobe uinput