From 86d07d0147225ef588d24968ac89e8c6b9326354 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 28 Mar 2019 17:38:32 +0900 Subject: [PATCH] Fix expected reverse lookup of Google DNS IP addresses DnsTest.testDnsWorks expects that reverse lookup for the Google public DNS servers will return something with google.com in the name. This no longer works because the reverse DNS entries have changed to dns.google. Bug: 129452237 Test: atest android.net.cts.DnsTest.testDnsWorks Change-Id: Iee8bfe418bf6003e5c78df77d75f6f9745249267 Merged-In: Iee8bfe418bf6003e5c78df77d75f6f9745249267 (cherry picked from commit 3852fd92f583e4f05db4d086b168df9f070eae4c) --- tests/cts/net/jni/NativeDnsJni.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/cts/net/jni/NativeDnsJni.c b/tests/cts/net/jni/NativeDnsJni.c index 4eb3c7aebc..1df9169cdc 100644 --- a/tests/cts/net/jni/NativeDnsJni.c +++ b/tests/cts/net/jni/NativeDnsJni.c @@ -120,8 +120,8 @@ JNIEXPORT jboolean Java_android_net_cts_DnsTest_testNativeDns(JNIEnv* env, jclas gai_strerror(res)); return JNI_FALSE; } - if (strstr(buf, "google.com") == NULL) { - ALOGD("getnameinfo(%s (GoogleDNS) ) didn't return google.com: %s", + if (strstr(buf, "google.com") == NULL && strstr(buf, "dns.google") == NULL) { + ALOGD("getnameinfo(%s (GoogleDNS) ) didn't return google.com or dns.google: %s", GoogleDNSIpV4Address, buf); return JNI_FALSE; } @@ -133,8 +133,9 @@ JNIEXPORT jboolean Java_android_net_cts_DnsTest_testNativeDns(JNIEnv* env, jclas res, gai_strerror(res)); return JNI_FALSE; } - if (strstr(buf, "google.com") == NULL) { - ALOGD("getnameinfo(%s) didn't return google.com: %s", GoogleDNSIpV6Address2, buf); + if (strstr(buf, "google.com") == NULL && strstr(buf, "dns.google") == NULL) { + ALOGD("getnameinfo(%s (GoogleDNS) ) didn't return google.com or dns.google: %s", + GoogleDNSIpV6Address2, buf); return JNI_FALSE; }