test: add HTTP upload test for systemd-report

Add a fake HTTP server (fake-report-server.py) that accepts JSON POST
requests and validates the report structure, and test cases in
TEST-74-AUX-UTILS.report.sh that exercise plain HTTP upload of both
metrics and facts.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-16 21:12:20 +02:00
parent ce400ef2d9
commit 0f3bd778e0
3 changed files with 71 additions and 0 deletions
+14
View File
@@ -65,3 +65,17 @@ systemctl start systemd-report-basic.socket
# Test facts via direct Varlink call on existing socket
varlinkctl --more call /run/systemd/report/io.systemd.Basic io.systemd.Facts.List {}
varlinkctl --more call /run/systemd/report/io.systemd.Basic io.systemd.Facts.Describe {}
# Test HTTP upload (plain http)
at_exit() {
set +e
systemctl stop fake-report-server
}
trap at_exit EXIT
systemd-run -p Type=notify --unit=fake-report-server \
/usr/lib/systemd/tests/integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/fake-report-server.py
systemctl status fake-report-server
"$REPORT" metrics --url=http://localhost:8089/
"$REPORT" facts --url=http://localhost:8089/