#include <grpc/support/port_platform.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <string>
#include <thread>
#include <vector>
#include <gmock/gmock.h>
#include "absl/flags/flag.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/resolver/resolver.h"
#include "src/core/lib/resolver/resolver_registry.h"
#include "src/core/lib/resolver/server_address.h"
#include "test/core/util/fake_udp_and_tcp_server.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/subprocess.h"
#include "test/cpp/util/test_config.h"
#include "src/core/lib/iomgr/sockaddr_posix.h"
Go to the source code of this file.
Macros | |
#define | BAD_SOCKET_RETURN_VAL (-1) |
Functions | |
ABSL_FLAG (std::string, do_ordered_address_comparison, "", "Whether or not to compare resolved addresses to expected " "addresses using an ordered comparison. This is useful for " "testing certain behaviors that involve sorting of resolved " "addresses. Note it would be better if this argument was a " "bool flag, but it's a string for ease of invocation from " "the generated python test runner.") | |
ABSL_FLAG (std::string, enable_srv_queries, "", "Whether or not to enable SRV queries for the ares resolver instance." "It would be better if this arg could be bool, but the way that we " "generate " "the python script runner doesn't allow us to pass a gflags bool to this " "binary.") | |
ABSL_FLAG (std::string, enable_txt_queries, "", "Whether or not to enable TXT queries for the ares resolver instance." "It would be better if this arg could be bool, but the way that we " "generate " "the python script runner doesn't allow us to pass a gflags bool to this " "binary.") | |
ABSL_FLAG (std::string, expected_addrs, "", "List of expected backend or balancer addresses in the form " "'<ip0:port0>,<is_balancer0>;<ip1:port1>,<is_balancer1>;...'. " "'is_balancer' should be bool, i.e. true or false.") | |
ABSL_FLAG (std::string, expected_chosen_service_config, "", "Expected service config json string that gets chosen (no " "whitespace). Empty for none.") | |
ABSL_FLAG (std::string, expected_lb_policy, "", "Expected lb policy name that appears in resolver result channel " "arg. Empty for none.") | |
ABSL_FLAG (std::string, expected_service_config_error, "", "Expected service config error. Empty for none.") | |
ABSL_FLAG (std::string, inject_broken_nameserver_list, "", "Whether or not to configure c-ares to use a broken nameserver list, in " "which " "the first nameserver in the list is non-responsive, but the second one " "works, i.e " "serves the expected DNS records; using for testing such a real scenario." "It would be better if this arg could be bool, but the way that we " "generate " "the python script runner doesn't allow us to pass a gflags bool to this " "binary.") | |
ABSL_FLAG (std::string, local_dns_server_address, "", "Optional. This address is placed as the uri authority if present.") | |
ABSL_FLAG (std::string, target_name, "", "Target name to resolve.") | |
int | main (int argc, char **argv) |
#define BAD_SOCKET_RETURN_VAL (-1) |
Definition at line 77 of file resolver_component_test.cc.
ABSL_FLAG | ( | std::string | , |
do_ordered_address_comparison | , | ||
"" | , | ||
"Whether or not to compare resolved addresses to expected " "addresses using an ordered comparison. This is useful for " "testing certain behaviors that involve sorting of resolved " "addresses. Note it would be better if this argument was a " "bool | flag, | ||
but it 's a string for ease of invocation from " "the generated python test runner." | |||
) |
ABSL_FLAG | ( | std::string | , |
enable_srv_queries | , | ||
"" | , | ||
"Whether or not to enable SRV queries for the ares resolver instance." "It would be better if this arg could be bool | , | ||
but the way that we " "generate " "the python script runner doesn 't allow us to pass a gflags bool to this " "binary." | |||
) |
ABSL_FLAG | ( | std::string | , |
enable_txt_queries | , | ||
"" | , | ||
"Whether or not to enable TXT queries for the ares resolver instance." "It would be better if this arg could be bool | , | ||
but the way that we " "generate " "the python script runner doesn 't allow us to pass a gflags bool to this " "binary." | |||
) |
ABSL_FLAG | ( | std::string | , |
expected_addrs | , | ||
"" | , | ||
"List of expected backend or balancer addresses in the form " "'<ip0:port0> | , | ||
< is_balancer0 >;< ip1:port1 > | , | ||
< is_balancer1 >;...'. " " 'is_balancer' should be bool | , | ||
i.e. true or false." | |||
) |
ABSL_FLAG | ( | std::string | , |
expected_chosen_service_config | , | ||
"" | , | ||
"Expected service config json string that gets chosen (no " "whitespace). Empty for none." | |||
) |
ABSL_FLAG | ( | std::string | , |
expected_lb_policy | , | ||
"" | , | ||
"Expected lb policy name that appears in resolver result channel " "arg. Empty for none." | |||
) |
ABSL_FLAG | ( | std::string | , |
expected_service_config_error | , | ||
"" | , | ||
"Expected service config error. Empty for none." | |||
) |
ABSL_FLAG | ( | std::string | , |
inject_broken_nameserver_list | , | ||
"" | , | ||
"Whether or not to configure c-ares to use a broken nameserver | list, | ||
in " "which " "the first nameserver in the list is non- | responsive, | ||
but the second one " " | works, | ||
i.e " "serves the expected DNS records;using for testing such a real scenario." "It would be better if this arg could be bool | , | ||
but the way that we " "generate " "the python script runner doesn 't allow us to pass a gflags bool to this " "binary." | |||
) |
ABSL_FLAG | ( | std::string | , |
local_dns_server_address | , | ||
"" | , | ||
"Optional. This address is placed as the uri authority if present." | |||
) |
Definition at line 676 of file resolver_component_test.cc.