forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegacy_json_integration_test.cc
79 lines (64 loc) · 3.07 KB
/
legacy_json_integration_test.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "test/integration/integration.h"
#include "test/mocks/runtime/mocks.h"
#include "test/test_common/utility.h"
#include "gtest/gtest.h"
namespace Envoy {
// This test loops through all of the json config files submitted as of
// 11/10/2017 and verifies Envoy continues to load the json version of their
// configuration.
class LegacyJsonIntegrationTest : public BaseIntegrationTest,
public testing::TestWithParam<Network::Address::IpVersion> {
public:
LegacyJsonIntegrationTest() : BaseIntegrationTest(GetParam(), realTime()) {}
void SetUp() override {
fake_upstreams_.emplace_back(
new FakeUpstream(0, FakeHttpConnection::Type::HTTP1, version_, timeSystem()));
registerPort("upstream_0", fake_upstreams_.back()->localAddress()->ip()->port());
fake_upstreams_.emplace_back(
new FakeUpstream(0, FakeHttpConnection::Type::HTTP1, version_, timeSystem()));
registerPort("upstream_1", fake_upstreams_.back()->localAddress()->ip()->port());
fake_upstreams_.emplace_back(
new FakeUpstream(0, FakeHttpConnection::Type::HTTP1, version_, timeSystem()));
registerPort("cluster_with_buffer_limits",
fake_upstreams_.back()->localAddress()->ip()->port());
}
};
TEST_P(LegacyJsonIntegrationTest, TestServer) {
createTestServer("test/config/integration/server.json", {"http"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerHttp2) {
createTestServer("test/config/integration/server_http2.json", {"echo"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerHttp2Upstream) {
createTestServer("test/config/integration/server_http2_upstream.json", {"http"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerProxyProto) {
createTestServer("test/config/integration/server_proxy_proto.json", {"http"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerSsl) {
createTestServer("test/config/integration/server_ssl.json", {"http"});
}
TEST_P(LegacyJsonIntegrationTest, TestTcpProxy) {
createTestServer("test/config/integration/tcp_proxy.json", {"tcp_proxy"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerUds) {
createTestServer("test/config/integration/server_uds.json", {"http"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerXfc) {
TestEnvironment::ParamMap param_map;
param_map["forward_client_cert"] = "forward_only";
param_map["set_current_client_cert_details"] = "";
std::string config = TestEnvironment::temporaryFileSubstitute(
"test/config/integration/server_xfcc.json", param_map, port_map_, version_);
IntegrationTestServer::create(config, version_, nullptr, false, timeSystem(), *api_);
}
TEST_P(LegacyJsonIntegrationTest, TestEchoServer) {
createTestServer("test/config/integration/echo_server.json", {"echo"});
}
TEST_P(LegacyJsonIntegrationTest, TestServerGrpcJsonTranscoder) {
createTestServer("test/config/integration/server_grpc_json_transcoder.json", {"http"});
}
INSTANTIATE_TEST_CASE_P(IpVersions, LegacyJsonIntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()),
TestUtility::ipTestParamsToString);
} // namespace Envoy