]> git.feebdaed.xyz Git - 0xmirror/msquic.git/commit
Implement a generic test ioctl for kernel mode tests (#5650) main
authorGuillaume Hetier <guhetier@microsoft.com>
Sun, 21 Dec 2025 23:14:42 +0000 (15:14 -0800)
committerGitHub <noreply@github.com>
Sun, 21 Dec 2025 23:14:42 +0000 (15:14 -0800)
commit639e92f4f8c9bccf84cbfa3df96d303c3712a767
tree79a1af80ab72a4af0621c93b3aacda3e254b2117
parent9639f53d7358e4990000dd70bfd61d771d242bef
Implement a generic test ioctl for kernel mode tests (#5650)

## Description

Adding system tests to MsQuic is convoluted because they must run in
both user-mode and kernel mode.

Before this PR, to add a system test, 5 code locations must be edited:
- define a new IOCTL
- IOCTL use sequential numbers: the new test will be at the end of the
list, even if it would better to group it with related tests
- handle the IOCTL from the test driver
- define a type for the IOCTL parameters
- add the parameter size type to the size array
- populate the IOCTL parameter struct from the google test parameters
- invoke the IOCTL

With this PR, only two file locations must be edited, with trivial
changes:
- register the test in kernel mode (1 line)
- invoke the test from user mode, forwarding the gtest parameters
directly (no additional parameter type, 1 line)

This PR introduces some constraint over the test function: they must
accept a single parameter by constant reference. This isn't a
limitation: test don't need non-constant parameters; multiple parameters
can be packaged in a struct (and generally already are when provided by
gtest); and this will encourage multiple small test with few parameters
rather than complex test functions trying to handle multiple scenarios.

Exisiting test will be converted to this schema in follow up PRs.

## Testing

CI

## Documentation

Code comments
src/test/MsQuicTests.h
src/test/bin/quic_gtest.cpp
src/test/bin/quic_gtest.h
src/test/bin/winkernel/control.cpp
src/test/lib/DataTest.cpp