# tests/vpn —— VPN 测试产物目录 每次跑 `scripts/vpn_test.py`(黑盒)会: 1. 把本次报告写到 `runs/<时间>-<主机>.html`; 2. 扫描 `runs/` 内嵌的 meta、**重建 `index.html` 索引页**(列出历次跑的时间/主机/出口/可达/延迟中位数/下载速度,点行进报告)。 `runs/` 与生成的 `index.html` 是**本地工件,不入 git**(见 `.gitignore`)——换机器跑会从零累积。 ## 怎么跑 ```bash # 在「已连 VPN 的机器」上(本机或 ssh 到 cara) python3 scripts/vpn_test.py # 落 tests/vpn/runs/ 并刷新 index.html python3 scripts/vpn_test.py --no-download # 跳过吞吐(快) NODE_IP=103.119.13.48 python3 scripts/vpn_test.py # 远程在 cara 上跑、把整个 runs 目录拉回本地看索引: scp scripts/vpn_test.py cara:/tmp/ ssh cara 'python3 /tmp/vpn_test.py --runs-dir /tmp/pg-runs --index /tmp/pg-runs/index.html' scp -r cara:/tmp/pg-runs/. tests/vpn/runs/ # 再本地重建索引: python3 -c "import importlib.util as u;s=u.spec_from_file_location('v','scripts/vpn_test.py');m=u.module_from_spec(s);s.loader.exec_module(m);m.regenerate_index('tests/vpn/runs','tests/vpn/index.html')" open tests/vpn/index.html # 看索引(可 file:// 直开,数据内嵌无需 server) ``` ## 口径 延迟 = **TLS 握手耗时**(非 IP TTL,非 ping/tcp_connect)。详见 `docs/vpn-test-plan.md`、`docs/vpn-testing-research.md`。 白盒(下钻链路/出站/DNS 走向)见 `scripts/vpn_whitebox.sh`(待补)。