Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Linux Interop Testing #4925

Merged
merged 13 commits into from
Mar 17, 2025
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ jobs:
fail-fast: false
matrix:
vec: [
#{ config: "Release", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", build: "-Test" },
#{ config: "Release", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Release", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Release", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", build: "-Test" },
{ config: "Release", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", build: "-Test" },
{ config: "Release", plat: "windows", os: "windows-2025", arch: "x64", tls: "schannel", build: "-Test" },
{ config: "Release", plat: "windows", os: "WinServerPrerelease", arch: "x64", tls: "schannel", build: "-Test" },
Expand Down
61 changes: 35 additions & 26 deletions src/tools/interop/interop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,38 @@ struct QuicPublicEndpoint {
const char* ServerName;
};

QuicPublicEndpoint PublicEndpoints[] = {
QuicPublicEndpoint PublicEndpoints[] = { // Some are commented out because they aren't currently available.
{ "aioquic", "quic.aiortc.org" },
{ "akamaiquic", "ietf.akaquic.com" },
{ "applequic", "71.202.41.169" },
{ "ats", "quic.ogre.com" },
{ "f5", "f5quic.com" },
{ "gquic", "quic.rocks" },
//{ "akamaiquic", "ietf.akaquic.com" },
//{ "applequic", "71.202.41.169" },
//{ "ats", "quic.ogre.com" },
//{ "f5", "f5quic.com" },
//{ "gquic", "quic.rocks" },
{ "haskell", "mew.org" },
{ "lsquic", "http3-test.litespeedtech.com" },
{ "mvfst", "fb.mvfst.net" },
{ "msquic", "msquic.net" },
//{ "lsquic", "http3-test.litespeedtech.com" },
//{ "mvfst", "fb.mvfst.net" },
//{ "msquic", "msquic.net" },
{ "ngtcp2", "nghttp2.org" },
{ "ngx_quic", "cloudflare-quic.com" },
{ "Pandora", "pandora.cm.in.tum.de" },
//{ "Pandora", "pandora.cm.in.tum.de" },
{ "picoquic", "test.privateoctopus.com" },
{ "quant", "quant.eggert.org" },
{ "quinn", "h3.stammw.eu" },
{ "quic-go", "quic.seemann.io" },
//{ "quant", "quant.eggert.org" },
//{ "quinn", "h3.stammw.eu" },
//{ "quic-go", "quic.seemann.io" },
{ "quiche", "quic.tech" },
{ "quicker", "quicker.edm.uhasselt.be" },
{ "quicly-quic", "quic.examp1e.net" },
//{ "quicker", "quicker.edm.uhasselt.be" },
//{ "quicly-quic", "quic.examp1e.net" },
{ "quicly-h20", "h2o.examp1e.net" },
{ nullptr, nullptr }, // Used for -custom cmd arg
};

const uint32_t PublicEndpointsCount = ARRAYSIZE(PublicEndpoints) - 1;

struct QuicTestResults {
const char* Alpn;
uint32_t QuicVersion;
uint32_t Features;
const char* Alpn {nullptr};
uint32_t QuicVersion {0};
uint32_t Features {0};
~QuicTestResults() { delete [] Alpn; }
};

QuicTestResults TestResults[ARRAYSIZE(PublicEndpoints)];
Expand Down Expand Up @@ -372,7 +373,7 @@ class InteropConnection {
this,
&Connection));
if (VerNeg) {
uint32_t SupportedVersions[] = { RandomReservedVersion, 0x709a50c4U, 0x00000001U, 0xff00001dU };
uint32_t SupportedVersions[] = { RandomReservedVersion, QUIC_VERSION_2_H, QUIC_VERSION_1_H, QUIC_VERSION_DRAFT_29_H };
QUIC_VERSION_SETTINGS Settings = { 0 };
Settings.AcceptableVersions = SupportedVersions;
Settings.AcceptableVersionsLength = ARRAYSIZE(SupportedVersions);
Expand All @@ -387,7 +388,7 @@ class InteropConnection {
sizeof(Settings),
&Settings));
} else if (InitialVersion != 0) {
uint32_t SupportedVersions[] = { InitialVersion, 0x709a50c4U, 0x00000001U, 0xff00001dU };
uint32_t SupportedVersions[] = { InitialVersion, QUIC_VERSION_2_H, QUIC_VERSION_1_H, QUIC_VERSION_DRAFT_29_H };
QUIC_VERSION_SETTINGS Settings = { 0 };
Settings.AcceptableVersions = SupportedVersions;
Settings.AcceptableVersionsLength = ARRAYSIZE(SupportedVersions);
Expand Down Expand Up @@ -600,7 +601,9 @@ class InteropConnection {
}
bool GetNegotiatedAlpn(const char* &Alpn) {
if (NegotiatedAlpn == nullptr) return false;
Alpn = strdup(NegotiatedAlpn);
auto NegotiatedAlpnLength = strlen(NegotiatedAlpn) + 1;
Alpn = new char[NegotiatedAlpnLength];
memcpy((char*)Alpn, NegotiatedAlpn, NegotiatedAlpnLength);
return true;
}
bool GetStatistics(QUIC_STATISTICS_V2& Stats) {
Expand Down Expand Up @@ -677,6 +680,9 @@ class InteropConnection {
}
break;
case QUIC_CONNECTION_EVENT_RESUMPTION_TICKET_RECEIVED:
if (pThis->ResumptionTicket) {
break; // Ignore any additional tickets
}
pThis->ResumptionTicketLength = Event->RESUMPTION_TICKET_RECEIVED.ResumptionTicketLength;
pThis->ResumptionTicket = new uint8_t[pThis->ResumptionTicketLength];
memcpy(
Expand Down Expand Up @@ -791,10 +797,12 @@ RunInteropTest(
&VersionSettings));
}

VERIFY_QUIC_SUCCESS(
if (QUIC_FAILED(
MsQuic->ConfigurationLoadCredential(
Configuration,
&CredConfig));
&CredConfig))) {
goto Error; // Can fail if we try to use features that are unsupported (like ChaCha20).
}

switch (Feature) {
case VersionNegotiation: {
Expand Down Expand Up @@ -972,6 +980,8 @@ RunInteropTest(
}
}

Error:

MsQuic->ConfigurationClose(Configuration); // TODO - Wait on connection

if (CustomUrlPath && !Success) {
Expand Down Expand Up @@ -1021,6 +1031,7 @@ CXPLAT_THREAD_CALLBACK(InteropTestCallback, Context)
}
if (TestResults[TestContext->EndpointIndex].Alpn == nullptr) {
TestResults[TestContext->EndpointIndex].Alpn = Alpn;
Alpn = nullptr;
}
CxPlatLockRelease(&TestResultsLock);
} else {
Expand All @@ -1037,9 +1048,7 @@ CXPLAT_THREAD_CALLBACK(InteropTestCallback, Context)
Alpn,
ThisTestFailed ? "false" : "true");

if (ThisTestFailed) {
free((void*)Alpn);
}
delete [] Alpn;
delete TestContext;

CXPLAT_THREAD_RETURN(0);
Expand Down
Loading