2.0 KiB
2.0 KiB
Тестирование
Уровни
- Unit: URI, policy, version, renderer, redaction и metadata.
- Failure injection: candidate rejection, restart failure, URI/config restore, unmanaged config, corrupted/legacy last-good.
- Packaging: MPL-2.0, exact dependency, upgrade rejection и postinst guard.
- Real binary: официальный sing-box 1.14.0 для Gecko и Salamander configs.
- Privileged Linux: TUN, systemd, nftables, routing и DNS.
- HY2XS acceptance: Gecko TCP/UDP/DNS, failures, reconnect и reboot.
Unit tests
На Linux:
make check
На Windows с isolated Python:
E:\python-31312\python.exe -c "import sys,unittest; sys.path[:0]=[r'F:\projects\singbox_glue',r'F:\projects\singbox_glue\src']; s=unittest.defaultTestLoader.discover('tests',top_level_dir='.'); r=unittest.TextTestRunner(verbosity=2).run(s); raise SystemExit(not r.wasSuccessful())"
Real binary
SING_BOX_1_14_0=/usr/bin/sing-box make test
Тест сначала проверяет exact version/tags. На Linux выполняется check; на
Windows — schema decoding через format, поскольку Windows binary не может
создать Linux auto-redirect.
Privileged Debian acceptance
В disposable Incus/VM с двумя NIC проверить:
- чистую установку и отказ in-place upgrade;
- Gecko config и отсутствие last-good после первого apply;
- table 2022, rule 9000/32768, marks и NFQUEUE 100;
- bootstrap DNS через
eth0, DoH черезhy2-out; - TCP/UDP/DNS с workload за
eth1; - отсутствие прямого WAN при остановленном sing-box;
- credential failure и same-release rollback;
- отказ legacy/mismatched metadata;
- A-record change и reboot recovery.
Server-side Gecko E2E выполняет владелец HY2XS. Salamander проверяется только на disposable test server и не добавляется в production server configuration.