forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_protocol_integration.cc
31 lines (26 loc) · 1.32 KB
/
http_protocol_integration.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "test/integration/http_protocol_integration.h"
#include "absl/strings/str_cat.h"
namespace Envoy {
std::vector<HttpProtocolTestParams> HttpProtocolIntegrationTest::getProtocolTestParams(
const std::vector<Http::CodecClient::Type>& downstream_protocols,
const std::vector<FakeHttpConnection::Type>& upstream_protocols) {
std::vector<HttpProtocolTestParams> ret;
for (auto ip_version : TestEnvironment::getIpVersionsForTest()) {
for (auto downstream_protocol : downstream_protocols) {
for (auto upstream_protocol : upstream_protocols) {
ret.push_back(HttpProtocolTestParams{ip_version, downstream_protocol, upstream_protocol});
}
}
}
return ret;
}
std::string HttpProtocolIntegrationTest::protocolTestParamsToString(
const ::testing::TestParamInfo<HttpProtocolTestParams>& params) {
return absl::StrCat(
(params.param.version == Network::Address::IpVersion::v4 ? "IPv4_" : "IPv6_"),
(params.param.downstream_protocol == Http::CodecClient::Type::HTTP2 ? "Http2Downstream_"
: "HttpDownstream_"),
(params.param.upstream_protocol == FakeHttpConnection::Type::HTTP2 ? "Http2Upstream"
: "HttpUpstream"));
}
} // namespace Envoy