forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ads_integration.h
91 lines (74 loc) · 2.72 KB
/
ads_integration.h
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
80
81
82
83
84
85
86
87
88
89
90
91
#pragma once
#include <memory>
#include <string>
#include "envoy/admin/v3/config_dump.pb.h"
#include "envoy/config/cluster/v3/cluster.pb.h"
#include "envoy/config/endpoint/v3/endpoint.pb.h"
#include "envoy/config/listener/v3/listener.pb.h"
#include "envoy/config/route/v3/route.pb.h"
#include "test/common/grpc/grpc_client_integration.h"
#include "test/integration/http_integration.h"
// TODO(fredlas) set_node_on_first_message_only was true; the delta+SotW unification
// work restores it here.
namespace Envoy {
static std::string AdsIntegrationConfig(const std::string& api_type) {
// Note: do not use CONSTRUCT_ON_FIRST_USE here!
return fmt::format(R"EOF(
dynamic_resources:
lds_config:
ads: {{}}
cds_config:
ads: {{}}
ads_config:
api_type: {}
set_node_on_first_message_only: false
static_resources:
clusters:
name: dummy_cluster
connect_timeout:
seconds: 5
type: STATIC
load_assignment:
cluster_name: dummy_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 0
lb_policy: ROUND_ROBIN
http2_protocol_options: {{}}
admin:
access_log_path: /dev/null
address:
socket_address:
address: 127.0.0.1
port_value: 0
)EOF",
api_type);
}
class AdsIntegrationTest : public Grpc::DeltaSotwIntegrationParamTest, public HttpIntegrationTest {
public:
AdsIntegrationTest();
void TearDown() override;
envoy::config::cluster::v3::Cluster buildCluster(const std::string& name);
envoy::config::cluster::v3::Cluster buildRedisCluster(const std::string& name);
envoy::config::endpoint::v3::ClusterLoadAssignment
buildClusterLoadAssignment(const std::string& name);
envoy::config::listener::v3::Listener buildListener(const std::string& name,
const std::string& route_config,
const std::string& stat_prefix = "ads_test");
envoy::config::listener::v3::Listener buildRedisListener(const std::string& name,
const std::string& cluster);
envoy::config::route::v3::RouteConfiguration buildRouteConfig(const std::string& name,
const std::string& cluster);
void makeSingleRequest();
void initialize() override;
void initializeAds(const bool rate_limiting);
void testBasicFlow();
envoy::admin::v3::ClustersConfigDump getClustersConfigDump();
envoy::admin::v3::ListenersConfigDump getListenersConfigDump();
envoy::admin::v3::RoutesConfigDump getRoutesConfigDump();
};
} // namespace Envoy