925058a5ae
- lftpd:net_inet_ntoa 段序改 MSB 首 + 新增 net_getpeername,FTP 日志打印 真实对端地址(真机实证 192.168.1.2:55524,登记 TRAP-NET-21) - E6:NET_U15_PROBE 命中=0(含压测)→ 阶段 3 项 4 不立项,U15 登记观察项; 插桩留仓(宏=0 零成本),soak 驱动 test/host/e6_soak.py 入库 - 编号:全库 Trap NN → TRAP-NET-<nn> 迁移并重排连续 01~21(单调映射, 沿革见 CH395F_Trap_Records.md 头注);死号 12/13/19/21 引用全部清除; GD5F 域引用补正为 TRAP-GD5F-NN - 陷阱文档全新化:索引 21 行行行真陷阱;删误判存档/发现时间/git 考古/ FTP 附录;台架纪律教训沉淀第六章方法论 - RAM:Code 211348→211456(+108 lftpd 修复),RW+ZI 净增 +4B; 优化方案/台账受管区/tsv 同笔同步 - ftp_abort_probe.py 挪 test/host/;引用关系图重生成 - 回归:@build 0/0;@test PASS;ftp_abort 10/10;relisten :7003 20/20; ci_local L0+L0.5 全绿;E6 窗口零复位,7 条 WD stall 登记压测假象备查
65 lines
2.4 KiB
Python
65 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""E6 24h soak driver (U15 mismatch frequency, N34 experiment plan E6).
|
|
|
|
Protocol (docs/网络/N34-自愈审计/实验方案.md §E6):
|
|
24h normal operation + periodic E1 stress injection:
|
|
- every hour : relisten_stress :7003 n=10 gap=100 (UI-like churn)
|
|
- every 4th hour : full E1 (:7003 n=50 gap=0 + :21 n=50 gap=100)
|
|
Device-side confirmed hits are counted by the NET_U15_PROBE firmware and
|
|
appear in the serial log as "U15 probe: sockN rx=... hits=N" (first hit
|
|
immediately, then <=1/hour). Read the verdict from serial.log afterwards.
|
|
|
|
Usage: python e6_soak.py [--hours 24]
|
|
Exit: 0 = soak completed; nonzero = driver error (device untouched).
|
|
"""
|
|
import argparse
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
import time
|
|
|
|
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
STRESS = os.path.join(ROOT, "test", "host", "relisten_stress.py")
|
|
|
|
|
|
def log(msg):
|
|
print("[%s] %s" % (time.strftime("%m-%d %H:%M:%S"), msg), flush=True)
|
|
|
|
|
|
def burst(args_list, tag):
|
|
t0 = time.time()
|
|
try:
|
|
r = subprocess.run([sys.executable, STRESS] + args_list,
|
|
capture_output=True, text=True, timeout=900)
|
|
out = (r.stdout or "") + (r.stderr or "")
|
|
tail = [ln for ln in out.splitlines() if "ok=" in ln or "latency" in ln]
|
|
dt = time.time() - t0
|
|
log("%s rc=%d %.0fs %s" % (tag, r.returncode, dt, " | ".join(tail[-2:])))
|
|
except Exception as e: # driver hiccup must not abort the soak
|
|
log("%s ERROR %r" % (tag, e))
|
|
|
|
|
|
def main():
|
|
ap = argparse.ArgumentParser()
|
|
ap.add_argument("--hours", type=int, default=24)
|
|
a = ap.parse_args()
|
|
|
|
log("E6 soak start: %d h, hourly :7003x10, every-4h E1 full" % a.hours)
|
|
t_start = time.time()
|
|
for h in range(1, a.hours + 1):
|
|
# sleep first: hour boundary cadence
|
|
remain = t_start + h * 3600.0 - time.time()
|
|
if remain > 0:
|
|
time.sleep(remain)
|
|
burst(["--port", "7003", "--n", "10", "--gap-ms", "100"], "hour%02d :7003x10" % h)
|
|
if h % 4 == 0:
|
|
burst(["--port", "7003", "--n", "50", "--gap-ms", "0"], "hour%02d E1 :7003x50g0" % h)
|
|
burst(["--port", "21", "--n", "50", "--gap-ms", "100"], "hour%02d E1 :21x50g100" % h)
|
|
log("E6 soak done: %.1f h elapsed" % ((time.time() - t_start) / 3600.0))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|