Refactor: ServiceCollectionExtensions data-driven registration; LeasesCache + FSW; test harness scripts

This commit is contained in:
2026-01-31 09:49:10 +10:00
parent e99b2d0453
commit f5bbe7d608
15 changed files with 376 additions and 99 deletions
+7 -4
View File
@@ -1,8 +1,9 @@
# Run the app with real dnsmasq and a DHCP client so hosts/leases are real.
# Build from repo root: docker compose -f docker-compose.test.yml up --build
# Prepare mount: ./scripts/prepare-test-mount.sh [--prepare-only | --no-build | --recreate | --source DIR | --mount DIR]
# Or set TESTDATA_MOUNT to override the data volume (default: ./testdata-mount).
#
# app builds from Dockerfile.dnsmasq (app + dnsmasq in one container; app is main process).
# ReloadCommand/StatusCommand work because dnsmasq runs in the same container.
# ReloadCommand/StatusCommand use pkill/pgrep (procps in image). cap_add NET_ADMIN for dnsmasq.
#
# Networks: testnet 172.28.0.0/16 so dnsmasq can hand out 172.28.0.10–50.
services:
@@ -12,15 +13,17 @@ services:
dockerfile: Dockerfile.dnsmasq
ports:
- "8080:8080"
cap_add:
- NET_ADMIN
environment:
DNSMASQ_CONF: /data/dnsmasq-test.conf
Dnsmasq__HostsPath: /data/hosts
Dnsmasq__ConfigPath: /data/dnsmasq.d/dhcp.conf
Dnsmasq__LeasesPath: /data/leases
Dnsmasq__ReloadCommand: "killall -HUP dnsmasq"
Dnsmasq__ReloadCommand: "pkill -HUP -x dnsmasq"
Dnsmasq__StatusCommand: "pgrep -x dnsmasq"
volumes:
- ./testdata:/data
- ${TESTDATA_MOUNT:-./testdata-mount}:/data
networks:
testnet:
ipv4_address: 172.28.0.2