Skip to content

Commit

Permalink
Add Kernel test mode integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianpick committed Jan 5, 2024
1 parent 42c2089 commit 11b4cbb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/test/MsQuicTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,17 @@ typedef struct {
#define IOCTL_QUIC_RUN_CONN_CLOSE_BEFORE_STREAM_CLOSE \
QUIC_CTL_CODE(117, METHOD_BUFFERED, FILE_WRITE_DATA)

#define QUIC_MAX_IOCTL_FUNC_CODE 117
#pragma pack(push)
#pragma pack(1)

typedef struct {
bool DropPackets;
} QUIC_RUN_CANCEL_ON_LOSS_PARAMS;

#pragma pack(pop)

#define IOCTL_QUIC_RUN_CANCEL_ON_LOSS \
QUIC_CTL_CODE(118, METHOD_BUFFERED, FILE_WRITE_DATA)
// QUIC_RUN_CANCEL_ON_LOSS_PARAMS

#define QUIC_MAX_IOCTL_FUNC_CODE 118
5 changes: 4 additions & 1 deletion src/test/bin/quic_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,10 @@ TEST_P(WithAbortiveArgs, AbortiveShutdown) {
TEST_P(WithCancelOnLossArgs, CancelOnLossSend) {
TestLoggerT<ParamType> Logger("QuicCancelOnLossSend", GetParam());
if (TestingKernelMode) {
// TODO
QUIC_RUN_CANCEL_ON_LOSS_PARAMS Params = {
GetParam().DropPackets
};
ASSERT_TRUE(DriverClient.Run(IOCTL_QUIC_RUN_CANCEL_ON_LOSS, Params));
} else {
QuicCancelOnLossSend(GetParam().DropPackets);
}
Expand Down
7 changes: 7 additions & 0 deletions src/test/bin/winkernel/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,13 @@ QuicTestCtlEvtIoDeviceControl(
QuicTestCtlRun(QuicTestConnectionCloseBeforeStreamClose());
break;

case IOCTL_QUIC_RUN_CANCEL_ON_LOSS:
CXPLAT_FRE_ASSERT(Params != nullptr);
QuicTestCtlRun(
QuicCancelOnLossSend(
Params->DropPackets));
break;

default:
Status = STATUS_NOT_IMPLEMENTED;
break;
Expand Down

0 comments on commit 11b4cbb

Please sign in to comment.