diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-03-11 19:50:48 -0800 |
---|---|---|
committer | Maciej Żenczykowski <maze@google.com> | 2021-03-11 19:52:30 -0800 |
commit | 67fa2073ffbeb0baa6ad20cc9f309853efb1b536 (patch) | |
tree | 47885db646a17674f523f878538ea0d3a436e0d8 | |
parent | cb358de06790032415709c982baf1226f68a13a0 (diff) | |
download | platform_system_bpf-67fa2073ffbeb0baa6ad20cc9f309853efb1b536.tar.gz platform_system_bpf-67fa2073ffbeb0baa6ad20cc9f309853efb1b536.tar.bz2 platform_system_bpf-67fa2073ffbeb0baa6ad20cc9f309853efb1b536.zip |
BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macroandroid-s-beta-2android-s-beta-1
Needs to be used by dns mainline module tests on R devices (Pixel 2).
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2974a5368f4a9d744e30be9148aefac117d09acb
-rw-r--r-- | libbpf_android/include/bpf/BpfUtils.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libbpf_android/include/bpf/BpfUtils.h b/libbpf_android/include/bpf/BpfUtils.h index 9671b8a..8fd2a4a 100644 --- a/libbpf_android/include/bpf/BpfUtils.h +++ b/libbpf_android/include/bpf/BpfUtils.h @@ -45,6 +45,22 @@ static inline bool isAtLeastKernelVersion(unsigned major, unsigned minor, unsign return kernelVersion() >= KVER(major, minor, sub); } +#define SKIP_IF_BPF_SUPPORTED \ + do { \ + if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \ + GTEST_LOG_(INFO) << "This test is skipped since bpf is supported\n"; \ + return; \ + } \ + } while (0) + +#define SKIP_IF_BPF_NOT_SUPPORTED \ + do { \ + if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \ + GTEST_LOG_(INFO) << "This test is skipped since bpf is not supported\n"; \ + return; \ + } \ + } while (0) + #define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED \ do { \ if (!android::bpf::isAtLeastKernelVersion(4, 14, 0)) { \ |