aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/naming/resolver_component_tests_runner_invoker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/naming/resolver_component_tests_runner_invoker.cc')
-rw-r--r--test/cpp/naming/resolver_component_tests_runner_invoker.cc38
1 files changed, 23 insertions, 15 deletions
diff --git a/test/cpp/naming/resolver_component_tests_runner_invoker.cc b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
index 306c322780..45c1029caa 100644
--- a/test/cpp/naming/resolver_component_tests_runner_invoker.cc
+++ b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
@@ -102,14 +102,18 @@ namespace testing {
void InvokeResolverComponentTestsRunner(std::string test_runner_bin_path,
std::string test_bin_path,
std::string dns_server_bin_path,
- std::string records_config_path) {
- int test_dns_server_port = grpc_pick_unused_port_or_die();
-
- SubProcess* test_driver = new SubProcess(
- {test_runner_bin_path, "--test_bin_path=" + test_bin_path,
- "--dns_server_bin_path=" + dns_server_bin_path,
- "--records_config_path=" + records_config_path,
- "--test_dns_server_port=" + std::to_string(test_dns_server_port)});
+ std::string records_config_path,
+ std::string dns_resolver_bin_path,
+ std::string tcp_connect_bin_path) {
+ int dns_server_port = grpc_pick_unused_port_or_die();
+
+ SubProcess* test_driver =
+ new SubProcess({test_runner_bin_path, "--test_bin_path=" + test_bin_path,
+ "--dns_server_bin_path=" + dns_server_bin_path,
+ "--records_config_path=" + records_config_path,
+ "--dns_server_port=" + std::to_string(dns_server_port),
+ "--dns_resolver_bin_path=" + dns_resolver_bin_path,
+ "--tcp_connect_bin_path=" + tcp_connect_bin_path});
gpr_mu test_driver_mu;
gpr_mu_init(&test_driver_mu);
gpr_cv test_driver_cv;
@@ -161,27 +165,31 @@ int main(int argc, char** argv) {
GPR_ASSERT(FLAGS_grpc_test_directory_relative_to_test_srcdir != "");
// Use bazel's TEST_SRCDIR environment variable to locate the "test data"
// binaries.
+ char* test_srcdir = gpr_getenv("TEST_SRCDIR");
std::string const bin_dir =
- gpr_getenv("TEST_SRCDIR") +
- FLAGS_grpc_test_directory_relative_to_test_srcdir +
+ test_srcdir + FLAGS_grpc_test_directory_relative_to_test_srcdir +
std::string("/test/cpp/naming");
// Invoke bazel's executeable links to the .sh and .py scripts (don't use
// the .sh and .py suffixes) to make
// sure that we're using bazel's test environment.
grpc::testing::InvokeResolverComponentTestsRunner(
bin_dir + "/resolver_component_tests_runner",
- bin_dir + "/" + FLAGS_test_bin_name, bin_dir + "/test_dns_server",
- bin_dir + "/resolver_test_record_groups.yaml");
+ bin_dir + "/" + FLAGS_test_bin_name, bin_dir + "/utils/dns_server",
+ bin_dir + "/resolver_test_record_groups.yaml",
+ bin_dir + "/utils/dns_resolver", bin_dir + "/utils/tcp_connect");
+ gpr_free(test_srcdir);
} else {
// Get the current binary's directory relative to repo root to invoke the
// correct build config (asan/tsan/dbg, etc.).
std::string const bin_dir = my_bin.substr(0, my_bin.rfind('/'));
// Invoke the .sh and .py scripts directly where they are in source code.
grpc::testing::InvokeResolverComponentTestsRunner(
- "test/cpp/naming/resolver_component_tests_runner.sh",
+ "test/cpp/naming/resolver_component_tests_runner.py",
bin_dir + "/" + FLAGS_test_bin_name,
- "test/cpp/naming/test_dns_server.py",
- "test/cpp/naming/resolver_test_record_groups.yaml");
+ "test/cpp/naming/utils/dns_server.py",
+ "test/cpp/naming/resolver_test_record_groups.yaml",
+ "test/cpp/naming/utils/dns_resolver.py",
+ "test/cpp/naming/utils/tcp_connect.py");
}
grpc_shutdown();
return 0;