Skip to content

Commit

Permalink
Remove vendor specific dynamo filter use from HCM config test (envoyp…
Browse files Browse the repository at this point in the history
…roxy#10858)

Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: pengg <pengg@google.com>
  • Loading branch information
yanavlasov authored and penguingao committed Apr 22, 2020
1 parent 052ae4d commit c3df5f1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ envoy_extension_cc_test(
"//source/common/buffer:buffer_lib",
"//source/common/event:dispatcher_lib",
"//source/extensions/access_loggers/file:config",
"//source/extensions/filters/http/dynamo:config",
"//source/extensions/filters/http/health_check:config",
"//source/extensions/filters/http/ratelimit:config",
"//source/extensions/filters/http/router:config",
"//source/extensions/filters/network/http_connection_manager:config",
"//test/integration/filters:encoder_decoder_buffer_filter_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/test_common:registry_lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ stat_prefix: router
route:
cluster: cluster
http_filters:
- name: envoy.filters.http.dynamo
- name: encoder-decoder-buffer-filter
typed_config:
"@type": type.googleapis.com/google.protobuf.Empty
- name: envoy.filters.http.router
Expand Down Expand Up @@ -1146,7 +1146,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.filters.http.dynamo
- name: encoder-decoder-buffer-filter
config: {}
access_log:
- name: accesslog
Expand Down Expand Up @@ -1175,7 +1175,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.filters.http.dynamo
- name: encoder-decoder-buffer-filter
typed_config: {}
access_log:
- name: accesslog
Expand Down Expand Up @@ -1205,7 +1205,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.filters.http.dynamo
- name: encoder-decoder-buffer-filter
typed_config: {}
access_log:
- name: accesslog
Expand Down Expand Up @@ -1276,7 +1276,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.http_dynamo_filter
- name: encoder-decoder-buffer-filter
typed_config: {}
http2_protocol_options:
hpack_table_size: 2048
Expand Down Expand Up @@ -1366,7 +1366,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.http_dynamo_filter
- name: encoder-decoder-buffer-filter
typed_config: {}
http2_protocol_options:
custom_settings_parameters: { identifier: 2, value: 1 }
Expand Down Expand Up @@ -1394,7 +1394,7 @@ stat_prefix: my_stat_prefix
route:
cluster: fake_cluster
http_filters:
- name: envoy.http_dynamo_filter
- name: encoder-decoder-buffer-filter
typed_config: {}
http2_protocol_options:
hpack_table_size: 2048
Expand Down Expand Up @@ -1580,7 +1580,7 @@ stat_prefix: router
route:
cluster: cluster
http_filters:
- name: envoy.filters.http.dynamo
- name: encoder-decoder-buffer-filter
- name: envoy.filters.http.router
)EOF";
Expand All @@ -1592,7 +1592,7 @@ TEST_F(FilterChainTest, CreateFilterChain) {
scoped_routes_config_provider_manager_, http_tracer_manager_);

Http::MockFilterChainFactoryCallbacks callbacks;
EXPECT_CALL(callbacks, addStreamFilter(_)); // Dynamo
EXPECT_CALL(callbacks, addStreamFilter(_)); // Buffer
EXPECT_CALL(callbacks, addStreamDecoderFilter(_)); // Router
config.createFilterChain(callbacks);
}
Expand All @@ -1611,7 +1611,7 @@ TEST_F(FilterChainTest, CreateUpgradeFilterChain) {
// config is present. We should create an upgrade filter chain for
// WebSockets.
{
EXPECT_CALL(callbacks, addStreamFilter(_)); // Dynamo
EXPECT_CALL(callbacks, addStreamFilter(_)); // Buffer
EXPECT_CALL(callbacks, addStreamDecoderFilter(_)); // Router
EXPECT_TRUE(config.createUpgradeFilterChain("WEBSOCKET", nullptr, callbacks));
}
Expand All @@ -1635,7 +1635,7 @@ TEST_F(FilterChainTest, CreateUpgradeFilterChain) {
// For paranoia's sake make sure route-specific enabling doesn't break
// anything.
{
EXPECT_CALL(callbacks, addStreamFilter(_)); // Dynamo
EXPECT_CALL(callbacks, addStreamFilter(_)); // Buffer
EXPECT_CALL(callbacks, addStreamDecoderFilter(_)); // Router
std::map<std::string, bool> upgrade_map;
upgrade_map.emplace(std::make_pair("WebSocket", true));
Expand Down Expand Up @@ -1694,11 +1694,11 @@ TEST_F(FilterChainTest, CreateCustomUpgradeFilterChain) {
auto foo_config = hcm_config.add_upgrade_configs();
foo_config->set_upgrade_type("foo");
foo_config->add_filters()->ParseFromString("\n"
"\x19"
"envoy.filters.http.dynamo");
"\x1D"
"encoder-decoder-buffer-filter");
foo_config->add_filters()->ParseFromString("\n"
"\x19"
"envoy.filters.http.dynamo");
"\x1D"
"encoder-decoder-buffer-filter");
foo_config->add_filters()->ParseFromString("\n"
"\x19"
"envoy.filters.http.router");
Expand All @@ -1709,7 +1709,7 @@ TEST_F(FilterChainTest, CreateCustomUpgradeFilterChain) {

{
Http::MockFilterChainFactoryCallbacks callbacks;
EXPECT_CALL(callbacks, addStreamFilter(_)); // Dynamo
EXPECT_CALL(callbacks, addStreamFilter(_)); // Buffer
EXPECT_CALL(callbacks, addStreamDecoderFilter(_)); // Router
config.createFilterChain(callbacks);
}
Expand All @@ -1723,7 +1723,7 @@ TEST_F(FilterChainTest, CreateCustomUpgradeFilterChain) {
{
Http::MockFilterChainFactoryCallbacks callbacks;
EXPECT_CALL(callbacks, addStreamDecoderFilter(_)).Times(1);
EXPECT_CALL(callbacks, addStreamFilter(_)).Times(2); // Dynamo
EXPECT_CALL(callbacks, addStreamFilter(_)).Times(2); // Buffer
EXPECT_TRUE(config.createUpgradeFilterChain("Foo", nullptr, callbacks));
}
}
Expand All @@ -1743,8 +1743,8 @@ TEST_F(FilterChainTest, CreateCustomUpgradeFilterChainWithRouterNotLast) {
"\x19"
"envoy.filters.http.router");
foo_config->add_filters()->ParseFromString("\n"
"\x19"
"envoy.filters.http.dynamo");
"\x1D"
"encoder-decoder-buffer-filter");

EXPECT_THROW_WITH_MESSAGE(
HttpConnectionManagerConfig(hcm_config, context_, date_provider_,
Expand Down

0 comments on commit c3df5f1

Please sign in to comment.