BpfUtils.h - add SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED

(being moved from //system/netd/tests/bpf_base_test.cpp)

Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7a38eff6d86a1bcd6dde193fd360d198bd57a900
This commit is contained in:
Maciej Żenczykowski 2020-02-12 04:15:20 -08:00
parent 524deefc88
commit 672b0e7aae

View file

@ -166,6 +166,15 @@ inline bool isBpfSupported() {
if (android::bpf::isBpfSupported()) return; \
} while (0)
#define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED \
do { \
if (android::bpf::getBpfSupportLevel() < android::bpf::BpfLevel::EXTENDED) { \
GTEST_LOG_(INFO) << "This test is skipped since extended bpf feature" \
<< "not supported\n"; \
return; \
} \
} while (0)
} // namespace bpf
} // namespace android