forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
extra_extensions_test.cc
28 lines (22 loc) · 848 Bytes
/
extra_extensions_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
#include <string>
#include <vector>
#include "envoy/common/exception.h"
#include "envoy/registry/registry.h"
#include "envoy/server/filter_config.h"
#include "test/test_common/environment.h"
#include "test/test_common/utility.h"
#include "gtest/gtest.h"
namespace Envoy {
namespace {
// Verify KillRequest filter is not built into Envoy by default but in compile_time_options
TEST(ExtraExtensionsTest, KillRequestFilterIsNotBuiltByDefault) {
auto* factory = Registry::FactoryRegistry<Server::Configuration::NamedHttpFilterConfigFactory>::
getFactoryByType("envoy.extensions.filters.http.kill_request.v3.KillRequest");
if (TestEnvironment::getOptionalEnvVar("ENVOY_HAS_EXTRA_EXTENSIONS").value_or("") == "true") {
EXPECT_NE(nullptr, factory);
} else {
EXPECT_EQ(nullptr, factory);
}
}
} // namespace
} // namespace Envoy