As VPN usage grows and endpoints diversify, a reproducible, automated privacy test suite is essential for both providers and privacy‑minded users. This guide walks you through building a cross‑platform test harness (Windows, macOS, Linux, Android, iOS) that checks for IP/DNS/IPv6 leaks, WebRTC leaks, split‑tunnel misconfigurations, protocol/TLS fingerprinting, QUIC behavior, and "kill‑switch" resilience. It includes capture techniques, headless automation, CI integration, and clear pass/fail rules you can adopt in 2026.
Why you need a dedicated privacy test suite
Public leak pages and ad‑hoc tests are useful but inconsistent. A proper test suite gives you:
- Reproducible test runs across OSes and devices
- Artifacts (pcap, logs, browser captures) for audits and bug reports
- Automated regression checks in CI so releases don't reintroduce leaks
- Measurement of subtle metadata leaks (TLS JA3, packet timing) that web tests miss
Overview: What the suite should test
Design tests to cover these classes of failure:
- Network identity leaks: public IP(s) pre/post‑connect, IPv6 leaks
- DNS leaks: plain DNS, DoH/DoT/DoQ bypasses, resolver provenance
- Application leaks: WebRTC, browser plugins, system APIs
- Routing leaks: split tunneling, policy exceptions, local LAN access
- Protocol/fingerprint leaks: TLS JA3, QUIC/HTTP/3 metadata, WireGuard keys exposure
- Resilience: kill‑switch, reconnect behavior, race conditions during network changes
Components and tools
Choose open, well‑maintained tools so your suite is maintainable.
- Packet capture: tcpdump, tshark (Wireshark CLI)
- HTTP/S inspection: mitmproxy (for TLS interception where appropriate); use only with test certificates
- Browser automation: Playwright or Puppeteer (supports headless Chromium, WebKit, Firefox)
- Mobile automation: adb (Android), rvictl + tcpdump (iOS device capture), and Firebase Test Lab or real device farms for CI
- TLS/QUIC analysis: Wireshark (GUI) or tshark with QUIC dissector; ja3/ja3s tools for fingerprinting
- DNS testing: bind9/dig for controlled servers, Dockerizable DNS leak servers, and traceroute/tracepath
- CI runners: GitHub Actions/GitLab CI with self‑hosted runners for network access, or dedicated lab machines
Architecture: how tests are organized
Structure tests in three layers:
- Device/OS adapters: scripts to start/stop the VPN client, set system proxies, capture interfaces
- Test cases: independent tests (DNS leak, IPv6, WebRTC) that produce standard artifacts
- Orchestration/CI: runner that prepares environment, runs tests, collects and uploads artifacts, and evaluates pass/fail rules
Step-by-step build
1) Prepare an isolated lab network
Use a small VLAN or isolated physical network to avoid contaminating your corporate LAN and to guarantee predictable upstreams. Provide a controlled upstream NAT or router you control so public IPs seen in captures are stable and reproducible.
2) Baseline captures (no VPN)
Run initial captures to record expected behavior.
- On Linux/macOS: sudo tcpdump -i any -s 0 -w baseline.pcap
- On Windows: install Npcap, then use tshark -i
- For Android (device): adb root or use tcpdump binary: adb shell tcpdump -i any -s 0 -w /sdcard/baseline.pcap; adb pull /sdcard/baseline.pcap
- iOS (real device): on macOS run rvictl -s
Record baseline DNS server IPs, IPv6 state, and browser WebRTC candidate behavior.
3) Test DNS handling
DNS leaks are the most frequent privacy problem. Test these vectors:
- Plain DNS queries to port 53 (UDP/TCP)
- Encrypted DNS: DoH (HTTPS), DoT (TLS port 853), DoQ (QUIC/UDP)
- System resolver fallbacks (OS resolver, mDNS)
Method: run a local authoritative DNS server (Dockerized bind9) that responds with unique, per‑test markers and capture whether queries go to that server or to other resolvers.
Example pass criteria: no non‑VPN resolver IPs appear in pcap, and DNS over VPN path is used for all queries. For DoH/DoQ check that encrypted flows terminate at your configured resolver and that no plaintext DNS leaves the interface.
4) IP and IPv6 leakage checks
Verify the public IPv4 and IPv6 addresses visible to the world by both web and raw packet observation.
- Browser check (automated): use Playwright to hit a small server under your control that echoes source IP
- Packet check: scan for packets with source IP equal to your real WAN IP in network captures
- IPv6: enable and test IPv6 specifically — many failures occur when IPv6 is left enabled while only IPv4 is routed via VPN
5) WebRTC and application-level leaks
Automate Playwright to open a simple WebRTC page that prints STUN server candidates and ICE candidates. Extract the candidates and assert they contain only VPN IPs or no public interface candidates.
Example Playwright snippet (pseudo): open page, await window.getRTCCandidates(), assert candidates.filter(isPublicIP).length === 0.
6) Split-tunnel and route policy tests
Intentionally configure split‑tunnel rules and verify that traffic destined for excluded subnets/routes actually takes the unencrypted path. Use traceroute/traceroute6 to destinations and verify next‑hop changes. Check policy order: ensure "exclude" rules are explicit and do not leak other application traffic.
7) Kill‑switch and network‑change resilience
Simulate link drop (disable interface, unplug Wi‑Fi, or block VPN server IP via local firewall) and verify that all expected traffic halts or is routed through the fallback. Use a watchdog test that attempts connections repeatedly and fails the build if any plaintext connection reaches the internet during the disruption window.
8) Protocol and fingerprint checks
Collect TLS JA3 fingerprints and QUIC metadata. For TLS, run tshark with TLS dissector and extract JA3/J A3s using available plugins or scripts. Look for consistent, undesired fingerprints that could tie traffic to a provider. For WireGuard, ensure public keys are never leaked in clear and control plane metadata doesn't reappear in logs.
9) Deep packet inspection / traffic shaping tests
Use traffic generation (iperf, tcpreplay) and compare behavior with and without obfuscation (obfs4, TLS tunneling). Validate that obfuscation modes actually change observable features: packet sizes, inter‑arrival timing, and handshake differences.
10) Produce standardized artifacts and assertions
For every test run collect:
- pcap file(s) with timestamped filenames
- test logs (stdout/stderr), system journal logs
- browser traces (HAR files) and Playwright screenshots
- a JSON summary with pass/fail boolean and failure reason codes
Automation and CI integration
Automation is where the suite earns its value.
- Use Docker for reproducible test runners on Linux; use self‑hosted runners (macOS/Windows) for OS‑specific flows
- Run device tests on a small device farm (selected physical devices) and capture via adb/rvictl; for scale use Firebase Test Lab or commercial farms and pull artifacts back for analysis
- Set hard timeouts and isolate each test run in a throwaway VM or snapshot to prevent state leakage between runs
- Fail the pipeline on high‑severity privacy regressions, and create searchable builds with artifacts for triage
Interpretation: pass/fail rules and severity levels
Create a tiered severity model:
- Critical: clear public IP or plaintext DNS observed during active VPN session
- High: WebRTC candidates leak public address or IPv6 bypasses VPN
- Medium: TLS fingerprint reveals identifiable, static client fingerprint; QUIC handshake contains identifying metadata
- Low: Non‑critical telemetry or logs that do not expose user identity but may affect privacy posture
Define remediation timelines and required mitigations for each severity in your release policy.
Real-world considerations and pitfalls (2026)
- QUIC and DoQ prevalence: more DNS and HTTP/3 traffic now runs over QUIC. You cannot MITM QUIC easily; verify resolver usage by endpoint IPs and certificate validation rather than relying solely on proxy interception.
- OS network stacks are increasingly aggressive in privacy workarounds — e.g., platform fallback resolvers and system proxies that bypass VPN. Keep your device adapters updated for the latest OS behaviors.
- App sandboxing and VPN APIs (especially on iOS/macOS) can change with OS updates; periodic revalidation on new OS betas is essential.
Reporting and triage
When a test fails:
- Attach full artifacts (pcap, logs, HAR, device info)
- Reproduce locally with a snapshot and minimal steps
- Classify severity and assign to engineering with reproduction steps
- Track fix, include regression test, and require a full run before release
Example checklist to start with (first 30 days)
- Set up isolated test network and baseline captures
- Automate DNS leak tests (Dockerized authoritative server)
- Implement IP/IPv6 leak checks via Playwright + server echo
- Implement WebRTC candidate test in Playwright
- Automate kill‑switch test (link drop simulation)
- Collect pcap & logs into artifact storage and implement JSON pass/fail output
- Integrate into CI with a self‑hosted runner and require a green run before staging
Wrap up
A cross‑platform VPN privacy test suite is an investment that pays back by catching privacy regressions before customers encounter them. Focus on reproducibility, clear artifacts, and automation. In 2026 the edge cases include QUIC‑based protocols and OS resolver tricks; incorporate them early. Start with the 30‑day checklist above and evolve your suite into a living part of your engineering lifecycle.
Further reading and resources (tools referenced): tcpdump, tshark/Wireshark, Playwright, mitmproxy, ja3/ja3s extractors, adb/rvictl, Docker, Firebase Test Lab, GitHub Actions self‑hosted runners.