|
proxygen
|
#include <proxygen/httpserver/HTTPServer.h>#include <boost/thread.hpp>#include <folly/FileUtil.h>#include <folly/experimental/TestUtil.h>#include <folly/io/async/AsyncSSLSocket.h>#include <folly/io/async/AsyncServerSocket.h>#include <folly/io/async/EventBaseManager.h>#include <folly/portability/GTest.h>#include <folly/ssl/OpenSSLCertUtils.h>#include <proxygen/httpclient/samples/curl/CurlClient.h>#include <proxygen/httpserver/ResponseBuilder.h>#include <proxygen/httpserver/ScopedHTTPServer.h>#include <proxygen/lib/http/HTTPConnector.h>#include <proxygen/lib/utils/TestUtils.h>#include <wangle/client/ssl/SSLSession.h>Go to the source code of this file.
Classes | |
| class | ServerThread |
| class | Cb |
| class | DummyFilterFactory |
| class | DummyFilterFactory::DummyFilter |
| class | TestHandlerFactory |
| class | TestHandlerFactory::TestHandler |
| class | ScopedServerTest |
| class | ConnectionFilterTest |
Functions | |
| TEST (MultiBind, HandlesListenFailures) | |
| TEST (HttpServerStartStop, TestRepeatStopCalls) | |
| TEST (SSL, SSLTest) | |
| std::pair< std::unique_ptr< HTTPServer >, std::unique_ptr< ServerThread > > | setupServer (bool allowInsecureConnectionsOnSecureServer=false, folly::Optional< wangle::TLSTicketKeySeeds > seeds=folly::none) |
| TEST (SSL, TestAllowInsecureOnSecureServer) | |
| TEST (SSL, DisallowInsecureOnSecureServer) | |
| TEST (SSL, TestResumptionWithTickets) | |
| TEST (SSL, TestResumptionAfterUpdateFails) | |
| TEST (SSL, TestUpdateTLSCredentials) | |
| TEST (GetListenSocket, TestNoBootstrap) | |
| TEST (GetListenSocket, TestBootstrapWithNoBinding) | |
| TEST (GetListenSocket, TestBootstrapWithBinding) | |
| TEST (UseExistingSocket, TestWithExistingAsyncServerSocket) | |
| TEST (UseExistingSocket, TestWithSocketFd) | |
| TEST (UseExistingSocket, TestWithMultipleSocketFds) | |
| TEST_F (ScopedServerTest, Start) | |
| TEST_F (ScopedServerTest, StartStrictSSL) | |
| TEST_F (ScopedServerTest, StartNotStrictSSL) | |
| TEST_F (ScopedServerTest, StartSSLWithInsecure) | |
| TEST_F (ConnectionFilterTest, Test) | |
| std::pair<std::unique_ptr<HTTPServer>, std::unique_ptr<ServerThread> > setupServer | ( | bool | allowInsecureConnectionsOnSecureServer = false, |
| folly::Optional< wangle::TLSTicketKeySeeds > | seeds = folly::none |
||
| ) |
Definition at line 241 of file HTTPServerTest.cpp.
References proxygen::RequestHandlerChain::addThen(), EXPECT_TRUE, proxygen::HTTPServerOptions::handlerFactories, wangle::SSLContextConfig::isDefault, folly::gen::move, wangle::SSLContextConfig::setCertificate(), and proxygen::HTTPServerOptions::threads.
Referenced by TEST().
| TEST | ( | MultiBind | , |
| HandlesListenFailures | |||
| ) |
Definition at line 76 of file HTTPServerTest.cpp.
References addr, EXPECT_FALSE, folly::EventBaseManager::get(), folly::EventBaseManager::getEventBase(), folly::SocketAddress::getPort(), folly::gen::move, folly::netops::socket(), and proxygen::HTTPServerOptions::threads.
| TEST | ( | HttpServerStartStop | , |
| TestRepeatStopCalls | |||
| ) |
| TEST | ( | SSL | , |
| SSLTest | |||
| ) |
Definition at line 154 of file HTTPServerTest.cpp.
References EXPECT_TRUE, wangle::SSLContextConfig::isDefault, folly::gen::move, wangle::SSLContextConfig::setCertificate(), and proxygen::HTTPServerOptions::threads.
| TEST | ( | SSL | , |
| TestAllowInsecureOnSecureServer | |||
| ) |
Definition at line 269 of file HTTPServerTest.cpp.
References proxygen::HTTPServer::addresses(), proxygen::HTTPConnector::connect(), folly::HHWheelTimer::DEFAULT_TICK_INTERVAL, EXPECT_EQ, CurlService::CurlClient::getResponse(), folly::EventBase::loop(), folly::TimeoutManager::NORMAL, CurlService::CurlClient::setFlowControlSettings(), CurlService::CurlClient::setLogging(), and setupServer().
| TEST | ( | SSL | , |
| DisallowInsecureOnSecureServer | |||
| ) |
Definition at line 295 of file HTTPServerTest.cpp.
References proxygen::HTTPServer::addresses(), proxygen::HTTPConnector::connect(), folly::HHWheelTimer::DEFAULT_TICK_INTERVAL, EXPECT_EQ, CurlService::CurlClient::getResponse(), folly::EventBase::loop(), folly::TimeoutManager::NORMAL, CurlService::CurlClient::setFlowControlSettings(), CurlService::CurlClient::setLogging(), and setupServer().
| TEST | ( | SSL | , |
| TestResumptionWithTickets | |||
| ) |
Definition at line 321 of file HTTPServerTest.cpp.
References proxygen::HTTPServer::addresses(), ASSERT_FALSE, ASSERT_NE, ASSERT_TRUE, wangle::TLSTicketKeySeeds::currentSeeds, folly::hexlify(), folly::EventBase::loop(), and setupServer().
| TEST | ( | SSL | , |
| TestResumptionAfterUpdateFails | |||
| ) |
Definition at line 348 of file HTTPServerTest.cpp.
References proxygen::HTTPServer::addresses(), ASSERT_FALSE, ASSERT_NE, ASSERT_TRUE, wangle::TLSTicketKeySeeds::currentSeeds, folly::hexlify(), folly::EventBase::loop(), setupServer(), and proxygen::HTTPServer::updateTicketSeeds().
| TEST | ( | SSL | , |
| TestUpdateTLSCredentials | |||
| ) |
Definition at line 388 of file HTTPServerTest.cpp.
References EXPECT_EQ, EXPECT_NE, EXPECT_TRUE, wangle::SSLContextConfig::isDefault, folly::gen::move, folly::test::TemporaryFile::path(), folly::readFile(), wangle::SSLContextConfig::setCertificate(), string, proxygen::HTTPServerOptions::threads, folly::writeFile(), and x.
| TEST | ( | GetListenSocket | , |
| TestNoBootstrap | |||
| ) |
Definition at line 469 of file HTTPServerTest.cpp.
References ASSERT_EQ, EXPECT_TRUE, and folly::gen::move.
| TEST | ( | GetListenSocket | , |
| TestBootstrapWithNoBinding | |||
| ) |
Definition at line 479 of file HTTPServerTest.cpp.
References ASSERT_EQ, wangle::TLSTicketKeySeeds::currentSeeds, proxygen::HTTPServer::getListenSocket(), folly::hexlify(), setupServer(), and proxygen::HTTPServer::stopListening().
| TEST | ( | GetListenSocket | , |
| TestBootstrapWithBinding | |||
| ) |
Definition at line 493 of file HTTPServerTest.cpp.
References ASSERT_NE, wangle::TLSTicketKeySeeds::currentSeeds, proxygen::HTTPServer::getListenSocket(), folly::hexlify(), and setupServer().
| TEST | ( | UseExistingSocket | , |
| TestWithExistingAsyncServerSocket | |||
| ) |
Definition at line 504 of file HTTPServerTest.cpp.
References proxygen::RequestHandlerChain::addThen(), ASSERT_EQ, EXPECT_TRUE, proxygen::HTTPServerOptions::handlerFactories, folly::gen::move, and proxygen::HTTPServerOptions::useExistingSocket().
| TEST | ( | UseExistingSocket | , |
| TestWithSocketFd | |||
| ) |
Definition at line 529 of file HTTPServerTest.cpp.
References proxygen::RequestHandlerChain::addThen(), ASSERT_EQ, EXPECT_TRUE, proxygen::HTTPServerOptions::handlerFactories, folly::gen::move, and proxygen::HTTPServerOptions::useExistingSocket().
| TEST | ( | UseExistingSocket | , |
| TestWithMultipleSocketFds | |||
| ) |
Definition at line 554 of file HTTPServerTest.cpp.
References proxygen::RequestHandlerChain::addThen(), ASSERT_EQ, EXPECT_TRUE, proxygen::HTTPServerOptions::handlerFactories, folly::gen::move, and proxygen::HTTPServerOptions::useExistingSockets().
| TEST_F | ( | ScopedServerTest | , |
| Start | |||
| ) |
| TEST_F | ( | ScopedServerTest | , |
| StartStrictSSL | |||
| ) |
Definition at line 665 of file HTTPServerTest.cpp.
References EXPECT_THROW, wangle::SSLContextConfig::isDefault, and wangle::SSLContextConfig::setCertificate().
| TEST_F | ( | ScopedServerTest | , |
| StartNotStrictSSL | |||
| ) |
Definition at line 676 of file HTTPServerTest.cpp.
References EXPECT_EQ, wangle::SSLContextConfig::isDefault, and wangle::SSLContextConfig::setCertificate().
| TEST_F | ( | ScopedServerTest | , |
| StartSSLWithInsecure | |||
| ) |
Definition at line 691 of file HTTPServerTest.cpp.
References EXPECT_EQ, wangle::SSLContextConfig::isDefault, and wangle::SSLContextConfig::setCertificate().
| TEST_F | ( | ConnectionFilterTest | , |
| Test | |||
| ) |
Definition at line 737 of file HTTPServerTest.cpp.
References wangle::SSLContextConfig::clientCAFile, wangle::SSLContextConfig::clientVerification, EXPECT_EQ, wangle::SSLContextConfig::isDefault, and wangle::SSLContextConfig::setCertificate().