diff --git a/configs/BUILD b/configs/BUILD index b4ebc516c440..0e795dea7348 100644 --- a/configs/BUILD +++ b/configs/BUILD @@ -19,14 +19,26 @@ envoy_py_test_binary( external_deps = ["jinja2"], ) +filegroup( + name = "configs", + srcs = [ + "original-dst-cluster/proxy_config.json", + ] + select({ + "@bazel_tools//tools/osx:darwin": [], + "//conditions:default": ["freebind/freebind.yaml"], + }), +) + genrule( name = "example_configs", srcs = [ + ":configs", "//examples:configs", "//test/config/integration/certs", ], outs = ["example_configs.tar"], - cmd = "$(location configgen.sh) $(location configgen) $(@D) $(locations //examples:configs) $(locations //test/config/integration/certs)", + cmd = "$(location configgen.sh) $(location configgen) $(@D) $(locations :configs) " + + "$(locations //examples:configs) $(locations //test/config/integration/certs)", tools = [ "configgen.sh", ":configgen", diff --git a/test/config_test/BUILD b/test/config_test/BUILD index b6684b0eec09..a8fe0ce41d35 100644 --- a/test/config_test/BUILD +++ b/test/config_test/BUILD @@ -42,5 +42,6 @@ envoy_cc_test_library( "//test/integration:integration_lib", "//test/mocks/server:server_mocks", "//test/mocks/ssl:ssl_mocks", + "//test/test_common:threadsafe_singleton_injector_lib", ] + envoy_all_extensions(), ) diff --git a/test/config_test/config_test.cc b/test/config_test/config_test.cc index 8fb02d89b854..fad184741f18 100644 --- a/test/config_test/config_test.cc +++ b/test/config_test/config_test.cc @@ -12,6 +12,7 @@ #include "test/integration/server.h" #include "test/mocks/server/mocks.h" #include "test/mocks/ssl/mocks.h" +#include "test/test_common/threadsafe_singleton_injector.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" @@ -83,6 +84,8 @@ class ConfigTest { NiceMock worker_factory_; Server::ListenerManagerImpl listener_manager_{server_, component_factory_, worker_factory_}; Runtime::RandomGeneratorImpl random_; + NiceMock os_sys_calls_; + TestThreadsafeSingletonInjector os_calls{&os_sys_calls_}; }; void testMerge() { diff --git a/test/config_test/example_configs_test.cc b/test/config_test/example_configs_test.cc index 80f645f76f50..f7e1cf2edd97 100644 --- a/test/config_test/example_configs_test.cc +++ b/test/config_test/example_configs_test.cc @@ -15,7 +15,12 @@ TEST(ExampleConfigsTest, All) { RELEASE_ASSERT(::getcwd(cwd, PATH_MAX) != nullptr); RELEASE_ASSERT(::chdir(directory.c_str()) == 0); - EXPECT_EQ(26UL, ConfigTest::run(directory)); +#ifdef __APPLE__ + // freebind/freebind.yaml is not supported on OS X and disabled via Bazel. + EXPECT_EQ(27UL, ConfigTest::run(directory)); +#else + EXPECT_EQ(28UL, ConfigTest::run(directory)); +#endif ConfigTest::testMerge(); ConfigTest::testIncompatibleMerge();