mirror of https://github.com/jackwener/wx-cli.git
2.3 KiB
2.3 KiB
S02: TCP server support — UAT
Milestone: M001 Written: 2026-05-13T06:16:06.049Z
S02: TCP server support — UAT
Milestone: M001 Written: 2025-05-13
UAT Type
- UAT mode: artifact-driven
- Why this mode is sufficient: TCP transport is verified through compilation checks and unit tests; end-to-end network testing requires a running daemon (covered in S04)
Preconditions
- Project compiles:
cargo checkpasses --tcpflag is available on all commands
Smoke Test
cargo run -- --help | grep tcp
Expected: --tcp <TCP> appears in output with description about connecting via TCP.
Test Cases
1. Global --tcp flag availability
- Run
cargo run -- --help - Expected:
--tcp <TCP>listed as a global option (not on a subcommand)
2. TCP transport function existence
- Verify
send_tcpandis_alive_tcpexist insrc/cli/transport.rs - Expected: Both functions found via grep
3. Daemon status reports TCP
- In daemon_cmd.rs, verify status command checks
is_alive_tcpwhen tcp_addr is set - Expected: Status output distinguishes TCP vs local transport
4. Daemon stop warns for TCP
- In daemon_cmd.rs, verify stop command warns when tcp_addr is set
- Expected: Warning that TCP daemon must be stopped manually
Edge Cases
TCP bind failure (port in use)
- This slice handles the client side; bind errors are handled by the server (S01)
- Expected: Server produces clear error message with address and errno
TCP connect failure
- Attempt
wx sessions --tcp 127.0.0.1:9999with nothing listening on port 9999 - Expected: Hard error with address and errno (not silent fallback to local transport)
Failure Signals
cargo checkfails — TCP code has compilation errors--tcpflag not in help — flag not wired correctly- Unit tests fail — transport routing broken
Not Proven By This UAT
- Actual TCP data exchange (requires running daemon — S04 covers this)
- TLS encryption (R020 deferred)
- Authentication tokens (R021 deferred)
- Connection keepalive (R022 deferred)
- Network-level access control (R030 out of scope)
Notes for Tester
- Windows cross-compile requires MSVC toolchain installed (lib.exe available)
- TCP timeouts: 15s connect, 120s read/write
- ensure_daemon() will NOT auto-start when --tcp is specified — this is intentional