skip unittest.grpc.io dualstack socket test if DNS64 is used (#28343)

reviewable/pr27867/r1^2
Jan Tattermusch 3 years ago committed by GitHub
parent 09e5ca15c5
commit 5466a0bc43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      test/core/end2end/dualstack_socket_test.cc

@ -279,11 +279,27 @@ int external_dns_works(const char* host) {
grpc_resolved_addresses* res = nullptr;
grpc_error_handle error = grpc_blocking_resolve_address(host, "80", &res);
GRPC_ERROR_UNREF(error);
if (res != nullptr) {
grpc_resolved_addresses_destroy(res);
return 1;
if (res == nullptr) {
return 0;
}
return 0;
int result = 1;
for (size_t i = 0; i < res->naddrs; ++i) {
// Kokoro on Macservice uses Google DNS64 servers by default
// (https://en.wikipedia.org/wiki/Google_Public_DNS) and that breaks
// "dualstack_socket_test" due to loopback4.unittest.grpc.io resolving to
// [64:ff9b::7f00:1]. (Working as expected for DNS64, but it prevents the
// dualstack_socket_test from functioning correctly). See b/201064791.
if (grpc_sockaddr_to_uri(&res->addrs[i]) == "ipv6:[64:ff9b::7f00:1]:80") {
gpr_log(
GPR_INFO,
"Detected DNS64 server response. Tests that depend on "
"*.unittest.grpc.io. will be skipped as they won't work with DNS64.");
result = 0;
break;
}
}
grpc_resolved_addresses_destroy(res);
return result;
}
int main(int argc, char** argv) {
@ -332,7 +348,8 @@ int main(int argc, char** argv) {
test_connect("127.0.0.1", "ipv6:[::1]", 0, 0);
}
if (!external_dns_works("loopback46.unittest.grpc.io")) {
if (!external_dns_works("loopback4.unittest.grpc.io") ||
!external_dns_works("loopback46.unittest.grpc.io")) {
gpr_log(GPR_INFO, "Skipping tests that depend on *.unittest.grpc.io.");
} else {
test_connect("loopback46.unittest.grpc.io", "loopback4.unittest.grpc.io",

Loading…
Cancel
Save