1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-25 15:43:13 +03:00

Use ALPN in QUIC tests.

Summary: This is in preparation for enforcing ALPN requirement in the QUIC layer.

Reviewed By: mjoras

Differential Revision: D51285567

fbshipit-source-id: 3cc3c2fbde169ec9603b3309d0abda74aa698602
This commit is contained in:
Kyle Nekritz
2024-01-26 10:55:13 -08:00
committed by Facebook GitHub Bot
parent a32eb0de7c
commit 364942346a
7 changed files with 23 additions and 15 deletions

View File

@@ -75,10 +75,11 @@ class ServerHandshakeTest : public Test {
void SetUp() override {
folly::ssl::init();
clientCtx = std::make_shared<fizz::client::FizzClientContext>();
// This client context is used outside the context of QUIC in this test, so
// we have to manually configure the QUIC record customizations.
clientCtx = quic::test::createClientCtx();
clientCtx->setOmitEarlyRecordLayer(true);
clientCtx->setFactory(std::make_shared<QuicFizzFactory>());
clientCtx->setClock(std::make_shared<fizz::test::MockClock>());
serverCtx = quic::test::createServerCtx();
setupClientAndServerContext();
auto fizzServerContext = FizzServerQuicHandshakeContext::Builder()
@@ -380,7 +381,7 @@ TEST_F(ServerHandshakeTest, TestHandshakeSuccess) {
std::rethrow_exception(ex);
}
expectOneRttCipher(true);
EXPECT_EQ(handshake->getApplicationProtocol(), folly::none);
EXPECT_EQ(handshake->getApplicationProtocol(), "quic_test");
EXPECT_TRUE(handshakeSuccess);
}
@@ -401,7 +402,7 @@ TEST_F(ServerHandshakeTest, TestHandshakeSuccessIgnoreNonHandshake) {
std::rethrow_exception(ex);
}
expectOneRttCipher(true);
EXPECT_EQ(handshake->getApplicationProtocol(), folly::none);
EXPECT_EQ(handshake->getApplicationProtocol(), "quic_test");
EXPECT_TRUE(handshakeSuccess);
}