From 01842c59c6162130d5aeb7dfada32d17817a29c6 Mon Sep 17 00:00:00 2001 From: Yangxt Date: Mon, 21 Sep 2026 16:00:26 +0800 Subject: [PATCH] 11 --- tests/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..e6a5ecc --- /dev/null +++ b/tests/README.md @@ -0,0 +1,27 @@ +# Tests + +## Go package tests + +```bat +go test ./... +``` + +- `internal/config` — YAML load/save, listen bind rules, URL redaction +- `internal/logger` — token/password redaction +- `internal/tunnel` — HTTP client + Navicat magic-header sniff +- `internal/navicat` — GetBlock/header parser, actn=C/Q client, mock `ntunnel_mysql.php` +- `internal/mysqlserver` — handshake, mysql_native_password, COM_QUERY/PING/QUIT, ResultSet; official Go MySQL driver against the local server + +Go tests do **not** hit the live tunnel. + +## Python: 与影刀同一用法 + +[`rpa_tunnel.py`](rpa_tunnel.py) 即影刀流程写法(硬编码,不读 yaml),`main` 返回 `args["conn"]`。 + +```bat +python tests\rpa_tunnel.py +``` + +须先启动 `mysql-tunnel.exe`,`listen` / `local_auth` 与脚本里 host/port/user/password 一致。 + +完整探测(读 `config.yaml`、多条 SQL、可选 `--direct`)见 [`http_tunnel.py`](http_tunnel.py)。