forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version_integration_test.cc
91 lines (80 loc) · 3.04 KB
/
version_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
80
81
82
83
84
85
86
87
88
89
90
91
#include "test/integration/http_integration.h"
namespace Envoy {
namespace {
// Integration test for ingestion of configuration across API versions.
// Currently we only have static tests, but there will also be xDS tests added
// later.
class VersionIntegrationTest : public testing::TestWithParam<Network::Address::IpVersion>,
public HttpIntegrationTest {
public:
VersionIntegrationTest() : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam()) {}
};
INSTANTIATE_TEST_SUITE_P(IpVersions, VersionIntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()));
// Just IP tagging for now.
const char ExampleIpTaggingConfig[] = R"EOF(
request_type: both
ip_tags:
- ip_tag_name: external_request
ip_list:
- {address_prefix: 1.2.3.4, prefix_len: 32}
)EOF";
// envoy.filters.http.ip_tagging from v2 Struct config.
TEST_P(VersionIntegrationTest, DEPRECATED_FEATURE_TEST(IpTaggingV2StaticStructConfig)) {
config_helper_.addFilter(absl::StrCat(R"EOF(
name: envoy.filters.http.ip_tagging
config:
)EOF",
ExampleIpTaggingConfig));
config_helper_.addRuntimeOverride(
"envoy.deprecated_features:envoy.extensions.filters.network."
"http_connection_manager.v3.HttpFilter.hidden_envoy_deprecated_config",
"true");
initialize();
}
// envoy.filters.http.ip_tagging from v2 TypedStruct config.
TEST_P(VersionIntegrationTest, IpTaggingV2StaticTypedStructConfig) {
config_helper_.addFilter(absl::StrCat(R"EOF(
name: ip_tagging
typed_config:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.config.filter.http.ip_tagging.v2.IPTagging
value:
)EOF",
ExampleIpTaggingConfig));
initialize();
}
// envoy.filters.http.ip_tagging from v3 TypedStruct config.
TEST_P(VersionIntegrationTest, IpTaggingV3StaticTypedStructConfig) {
config_helper_.addFilter(absl::StrCat(R"EOF(
name: ip_tagging
typed_config:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.ip_tagging.v3.IPTagging
value:
)EOF",
ExampleIpTaggingConfig));
initialize();
}
// envoy.filters.http.ip_tagging from v2 typed Any config.
TEST_P(VersionIntegrationTest, IpTaggingV2StaticTypedConfig) {
config_helper_.addFilter(absl::StrCat(R"EOF(
name: ip_tagging
typed_config:
"@type": type.googleapis.com/envoy.config.filter.http.ip_tagging.v2.IPTagging
)EOF",
ExampleIpTaggingConfig));
initialize();
}
// envoy.filters.http.ip_tagging from v3 typed Any config.
TEST_P(VersionIntegrationTest, IpTaggingV3StaticTypedConfig) {
config_helper_.addFilter(absl::StrCat(R"EOF(
name: ip_tagging
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.ip_tagging.v3.IPTagging
)EOF",
ExampleIpTaggingConfig));
initialize();
}
} // namespace
} // namespace Envoy