diff options
author | Maciej Żenczykowski <maze@google.com> | 2023-11-06 04:17:25 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-11-06 04:17:25 +0000 |
commit | 7e4a258fad7a45d585da2faea3e311e49e956a5c (patch) | |
tree | 92b24b1bd5f46aaad380e896bac0bb243d2da7e3 | |
parent | 93db04137280b620be370a0bd5dce9fa722f25ab (diff) | |
parent | a65c72b68bff64fc63834f84a92b957f9cc7bd88 (diff) | |
download | DnsResolver-7e4a258fad7a45d585da2faea3e311e49e956a5c.tar.gz |
Merge changes from topic "DNS_test_w_bpf" into main am: a65c72b68b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/2815923
Change-Id: I298c392e354403f46881c390944dde808b33de98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | tests/resolv_integration_test.cpp | 1 | ||||
-rw-r--r-- | tests/resolv_private_dns_test.cpp | 2 | ||||
-rw-r--r-- | tests/resolv_test_utils.h | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/tests/resolv_integration_test.cpp b/tests/resolv_integration_test.cpp index cae91f8a..38d5567e 100644 --- a/tests/resolv_integration_test.cpp +++ b/tests/resolv_integration_test.cpp @@ -48,7 +48,6 @@ #include <algorithm> #include <chrono> -#include <filesystem> #include <functional> #include <iterator> #include <numeric> diff --git a/tests/resolv_private_dns_test.cpp b/tests/resolv_private_dns_test.cpp index 3e270c9c..f62495ec 100644 --- a/tests/resolv_private_dns_test.cpp +++ b/tests/resolv_private_dns_test.cpp @@ -552,6 +552,8 @@ TEST_P(TransportParameterizedTest, MdnsGetAddrInfo_fallback) { TEST_P(TransportParameterizedTest, BlockDnsQuery) { SKIP_IF_BEFORE_T; + SKIP_IF_DEPENDENT_LIB_DOES_NOT_EXIST(DNS_HELPER); + constexpr char ptr_name[] = "v4v6.example.com."; // PTR record for IPv6 address 2001:db8::102:304 constexpr char ptr_addr_v6[] = diff --git a/tests/resolv_test_utils.h b/tests/resolv_test_utils.h index 03926aa8..540dd2b6 100644 --- a/tests/resolv_test_utils.h +++ b/tests/resolv_test_utils.h @@ -20,6 +20,7 @@ #include <arpa/nameser.h> #include <netdb.h> +#include <filesystem> #include <functional> #include <string> #include <vector> @@ -442,3 +443,9 @@ static const std::string DNS_HELPER = android::bpf::isUserspace64bit() ? "/apex/com.android.tethering/lib64/libcom.android.tethering.dns_helper.so" : "/apex/com.android.tethering/lib/libcom.android.tethering.dns_helper.so"; + +#define SKIP_IF_DEPENDENT_LIB_DOES_NOT_EXIST(libPath) \ + do { \ + if (!std::filesystem::exists(libPath)) \ + GTEST_SKIP() << "Required " << (libPath) << " not found."; \ + } while (0) |