test: consolidate mstsgu test binary - #1743
Conversation
There was a problem hiding this comment.
Pull request overview
Consolidates MSTSGU integration tests into one binary to reduce relinking while retaining native-TLS coverage.
Changes:
- Registers a unified integration-test harness.
- Moves native-TLS gating to the
http_authmodule. - Updates xtask commands for the new target.
No material findings identified; protocol review was unnecessary because protocol behavior is unchanged.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
xtask/src/check.rs |
Targets the consolidated test binary. |
crates/ironrdp-mstsgu/Cargo.toml |
Disables test autodiscovery and registers one harness. |
crates/ironrdp-mstsgu/tests/main.rs |
Declares the test modules and feature gate. |
crates/ironrdp-mstsgu/tests/http_auth.rs |
Removes the now-centralized lint allowance. |
crates/ironrdp-mstsgu/tests/http_control.rs |
Removes the now-centralized lint allowance. |
crates/ironrdp-mstsgu/tests/rpc_pdu.rs |
Removes the now-centralized lint allowance. |
crates/ironrdp-mstsgu/tests/udp.rs |
Removes the now-centralized lint allowance. |
ecbf2a1 to
07910d5
Compare
07910d5 to
6b9742a
Compare
6b9742a to
bdf4a10
Compare
bdf4a10 to
f9f7a02
Compare
c8c0389 to
569972a
Compare
569972a to
080a5a7
Compare
080a5a7 to
d57abdc
Compare
Use one test harness to preserve feature-gated coverage while avoiding repeated relinking. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move Mstsgu coverage to the shared extra test harness. Keep native-TLS coverage in the same centralized binary. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Nest the Mstsgu integration modules beneath the extra test harness. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain upstream Mstsgu coverage in the centralized harness after rebasing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep native TLS smart-card coverage in the extra test harness. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the Mstsgu integration coverage to the extra suite's sole test binary. This leaves ironrdp-mstsgu with no Cargo test targets. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The crate has no test targets, so this import no longer has a supporting dependency. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep Mstsgu integration coverage in the extra-suite harness so the package exposes no Cargo test target. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the updated RPCH v2 coverage in the extra-suite harness. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep RPC stub coverage in the extra-suite harness with its test-only dependency. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Load shared Mstsgu private sources once in the extra integration harness so the RPCH session coverage remains available without duplicate test modules. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
177eff0 to
204bfa3
Compare
Expose opaque protocol packet constructors and accessors through the existing test-support feature so centralized tests do not compile production sources a second time. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document that the centralized harness still imports private HTTP and RPC sources for RPCH session coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run the centralized Mstsgu suite with Rustls and retain shared protocol and transport coverage without test-suite feature flags. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pure test/build reorganization: mstsgu integration tests move into ironrdp-testsuite-extra, four private proto structs get test-support-gated pub visibility (mirroring the existing test_support pattern), and check.rs drops now-unneeded per-binary invocations. No Encode/Decode/wire-format logic changed. However, the reorg silently drops CI coverage for the smartcard feature's authentication-error tests (no longer exercised anywhere), and leaves one renamed test module (rpc_tsgu_stubs.rs) as an empty no-op stub.
Protocol analysis: accepted — Independently reviewed the diff: HandshakeRespPkt, TunnelReqPkt, ExtendedAuthPkt, and TunnelAuthRespPkt only gain pub visibility gated by #[cfg_attr(not(feature="test-support"), expect(unreachable_pub))], matching the pre-existing test_support.rs pattern used for other packet/config types in this crate. Field layouts, Encode/Decode bodies, and constants are untouched. The handoff's 'none' protocol relevance is correct; I found an additional test-coverage regression, but it is unrelated to wire compatibility.
| # process default, which fails every TLS test in this binary. | ||
| tokio-rustls = { version = "0.26", default-features = false } | ||
| uuid = { version = "1", features = ["v4"] } | ||
| ironrdp-mstsgu = { path = "../ironrdp-mstsgu", features = ["rustls", "test-support"] } |
There was a problem hiding this comment.
blocking / high: Before this PR, xtask/src/check.rs ran `cargo test -p ironrdp-mstsgu --test http_auth --features native-tls,smartcard --locked` (compile and run) as a dedicated CI step, which is the only place in the repo that ever enabled the `smartcard` cargo feature. This PR deletes that step and merges http_auth.rs into ironrdp-testsuite-extra's single test binary, whose only ironrdp-mstsgu dependency features are `rustls` and `test-support` (this line) — `smartcard` is not requested anywhere else in the workspace (verified via grep across all crate Cargo.toml files). The four #[cfg(feature = "smartcard")]-gated tests in http_auth.rs (smart_card_requires_username, smart_card_requires_negotiate, smart_card_rejects_malformed_negotiate_token, smart_card_recognizes_combined_negotiate_challenge) therefore never compile or run in CI going forward, silently losing coverage of the Kerberos PKINIT smart-card authentication error paths (malformed Negotiate tokens, missing username, wrong auth scheme) with no equivalent replacement and no mention in the PR description, which only says 'without test-suite feature flags.'
| @@ -0,0 +1 @@ | |||
|
|
|||
There was a problem hiding this comment.
non_blocking / low: The old crates/ironrdp-mstsgu/tests/rpc_tsgu_stubs.rs compiled rpc.rs against a deliberately minimal two-variant GwErrorKind (Connect, Custom) as its own separate test binary, as a smoke check that rpc.rs doesn't leak dependencies on more error variants than it directly constructs. The renamed file is now a single blank line, and its former purpose is superseded by main.rs's #[path] mod rpc;, which instead compiles rpc.rs against the full, rich GwErrorKind reused from rpch_http.rs. The empty file and its mod rpc_tsgu_stubs; declaration in mstsgu/mod.rs are vestigial — worth deleting rather than kept as a no-op placeholder that could be mistaken for still providing a check.
Run the centralized Mstsgu suite with Rustls and retain shared protocol and transport coverage without test-suite feature flags.