Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4738c98
docs(plan): e2e 测试实施计划 T00-T08
maxyu Jul 8, 2026
7c75099
feat(e2e): T00 增加 MESH_TEST_TLS 开关支持自签证书
maxyu Jul 8, 2026
f5bca59
fix(e2e): T00 code review 修复
maxyu Jul 8, 2026
4d25e24
feat(e2e): T01 Docker 镜像与 compose 编排
maxyu Jul 8, 2026
c29b9a3
fix(e2e): T01 code review 修复
maxyu Jul 8, 2026
59809d7
feat(e2e): T02 helpers.sh 与 metrics.sh
maxyu Jul 8, 2026
dd971df
fix(e2e): T02 rtt_stats 取 avg 而非 min
maxyu Jul 8, 2026
7403980
feat(e2e): T03 netem 预设封装(clean/baseline/wan/bad/satellite)
maxyu Jul 8, 2026
56a0a19
fix(mesh): 修复 Linux TUN 写入 invalid offset 导致数据平面不通
maxyu Jul 8, 2026
b241e5c
fix(e2e): entrypoint-client 幂等支持容器重启
maxyu Jul 8, 2026
f7af571
feat(e2e): T04 场景 01 连通性与路由
maxyu Jul 8, 2026
e4ffc6a
fix(e2e): T04 收尾 fping 兜底 + ignore results 产物
maxyu Jul 8, 2026
5391c19
feat(e2e): T05 场景 02 性能与抖动
maxyu Jul 8, 2026
edf8917
docs(bug): B00 记录 Linux TUN IFF_VNET_HDR 导致 TCP checksum 损坏
maxyu Jul 8, 2026
1ef2482
feat(e2e): T06 场景 03 故障/重连/优雅退出
maxyu Jul 8, 2026
9bf5a13
docs(bug): B01 记录 TunnelClient main loop 卡 tun.Read
maxyu Jul 8, 2026
fe5993b
feat(e2e): T07 run.sh 一键入口与结果聚合
maxyu Jul 8, 2026
cff0ed7
ci(e2e): T08 GitHub Actions e2e workflow
maxyu Jul 8, 2026
4c020d5
docs(e2e): final review 收尾 metrics sed-E + README e2e 说明
maxyu Jul 8, 2026
4b4a943
fix(mesh): B00 自开 TUN 不带 IFF_VNET_HDR 修复 Linux TCP checksum
maxyu Jul 8, 2026
a3868b8
fix(mesh): B01 持久 tunReadLoop 解耦 tun.Read,响应 ctx cancel
maxyu Jul 8, 2026
15e6c52
docs(bug): B00/B01 标记已修复 + 实施记录
maxyu Jul 8, 2026
06acfb3
fix(e2e): PR#2 CodeRabbit 反馈修复
maxyu Jul 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Docker build context 排除(T01 code review I-3)
# 两个 Dockerfile 都用 context: ../..(仓库根),这里裁掉无关内容
# 必须保留进 context:internal/ cmd/ go.mod go.sum tests/e2e/fixtures/
.git/
bin/
docs/
.firecrawl/
graphify-out/
*.md
.DS_Store
.claude/
31 changes: 31 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: e2e

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- name: Run e2e (quick mode)
run: bash tests/e2e/run.sh --quick

- name: Collect report
if: always()
run: |
mkdir -p e2e-report
cp -r tests/e2e/results ./e2e-report/ 2>/dev/null || true

- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-report
path: e2e-report/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
bin/

# e2e 测试产物
tests/e2e/results/
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,30 @@ mesh leave # 注销并清理
| 服务器 | 10.100.0.1 |
| 客户端(自动分配) | 10.100.0.2 ~ 10.100.0.254 |

## e2e 测试

基于 Docker 的端到端测试(3 容器:1 server + 2 client),验证连通性、性能、故障恢复。

```bash
# 快速模式(连通性 + 性能,约 2-3 分钟)
bash tests/e2e/run.sh --quick

# 全量(含故障场景)
bash tests/e2e/run.sh --all

# 单个场景
bash tests/e2e/run.sh --scenario 01

# 性能硬门槛(release 用)
STRICT=1 bash tests/e2e/run.sh --quick
```

结果输出到 `tests/e2e/results/<timestamp>/`,含各场景 JSON 指标和 `summary.txt`。

> 注:macOS 本机若 docker 走 colima,需先 `export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock`;CI(ubuntu-latest)无需。

详见 `docs/superpowers/specs/2026-07-08-e2e-docker-design.md`。

## 技术栈

- Go 1.22+
Expand Down
4 changes: 3 additions & 1 deletion cmd/mesh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ func main() {

func joinCmd() *cobra.Command {
var tok string
var insecure bool
cmd := &cobra.Command{
Use: "join <domain>",
Args: cobra.ExactArgs(1),
Short: "向服务器注册并加入 mesh 网络(无需 root)",
RunE: func(c *cobra.Command, args []string) error {
if err := client.Join(args[0], tok); err != nil {
if err := client.Join(args[0], tok, insecure); err != nil {
return err
}
fmt.Println("Now run 'sudo mesh up' to start the tunnel.")
return nil
},
}
cmd.Flags().StringVar(&tok, "token", "", "注册令牌(由服务器管理员提供)")
cmd.Flags().BoolVar(&insecure, "insecure", false, "跳过 TLS 证书校验(仅用于 e2e 测试)")
_ = cmd.MarkFlagRequired("token")
return cmd
}
Expand Down
Loading
Loading