forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_protocol_integration.cc
52 lines (45 loc) · 1.73 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#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;
}
absl::string_view upstreamToString(FakeHttpConnection::Type type) {
switch (type) {
case FakeHttpConnection::Type::HTTP1:
return "HttpUpstream";
case FakeHttpConnection::Type::HTTP2:
return "Http2Upstream";
case FakeHttpConnection::Type::HTTP3:
return "Http3Upstream";
}
return "UnknownUpstream";
}
absl::string_view downstreamToString(Http::CodecClient::Type type) {
switch (type) {
case Http::CodecClient::Type::HTTP1:
return "HttpDownstream_";
case Http::CodecClient::Type::HTTP2:
return "Http2Downstream_";
case Http::CodecClient::Type::HTTP3:
return "Http3Downstream_";
}
return "UnknownDownstream";
}
std::string HttpProtocolIntegrationTest::protocolTestParamsToString(
const ::testing::TestParamInfo<HttpProtocolTestParams>& params) {
return absl::StrCat((params.param.version == Network::Address::IpVersion::v4 ? "IPv4_" : "IPv6_"),
downstreamToString(params.param.downstream_protocol),
upstreamToString(params.param.upstream_protocol));
}
} // namespace Envoy