From 352bb6bb9e0e55fc09a7e1e44be6da651fcb78db Mon Sep 17 00:00:00 2001 From: Dmitrii Iurco Date: Sat, 6 Jun 2026 08:06:29 -0400 Subject: [PATCH] Fix: use api_base fixture instead of hardcoded pic0 IP in WG domain access tests test_peer_services_* functions hardcoded 'http://192.168.31.51:3000' as the fallback for PIC_API_BASE, causing failures when tests run on any other host (including pic1 itself). Use the api_base fixture, which reads PIC_HOST and PIC_API_PORT from the environment. Co-Authored-By: Claude Sonnet 4.6 --- tests/e2e/wg/test_wg_domain_access.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/e2e/wg/test_wg_domain_access.py b/tests/e2e/wg/test_wg_domain_access.py index 2a6bcb0..c4d6fcb 100644 --- a/tests/e2e/wg/test_wg_domain_access.py +++ b/tests/e2e/wg/test_wg_domain_access.py @@ -153,13 +153,12 @@ def test_http_api_domain_reaches_api(connected_peer, admin_client): # ── Scenario 33: Config DNS field ───────────────────────────────────────────── -def test_peer_services_config_has_coredns_not_vpn_gateway(admin_client, make_peer): +def test_peer_services_config_has_coredns_not_vpn_gateway(admin_client, make_peer, api_base): """WireGuard config in /api/peer/services must use CoreDNS IP, not 10.0.0.1.""" from helpers.api_client import PicAPIClient - import os peer = make_peer('e2etest-dns-config', password='DnsTest123!') - peer_client = PicAPIClient(os.environ.get('PIC_API_BASE', 'http://192.168.31.51:3000')) + peer_client = PicAPIClient(api_base) peer_client.login(peer['name'], 'DnsTest123!') r = peer_client.get('/api/peer/services') @@ -188,14 +187,13 @@ def test_peer_services_config_has_coredns_not_vpn_gateway(admin_client, make_pee break -def test_peer_services_caldav_url_uses_configured_domain(admin_client, make_peer): +def test_peer_services_caldav_url_uses_configured_domain(admin_client, make_peer, api_base): """CalDAV URL must use the configured domain, not hardcode 'radicale.dev:5232'.""" from helpers.api_client import PicAPIClient - import os dom = _domain(admin_client) peer = make_peer('e2etest-caldav-url', password='CaldavTest123!') - peer_client = PicAPIClient(os.environ.get('PIC_API_BASE', 'http://192.168.31.51:3000')) + peer_client = PicAPIClient(api_base) peer_client.login(peer['name'], 'CaldavTest123!') r = peer_client.get('/api/peer/services')