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:
parent
524deefc88
commit
672b0e7aae
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue