add SKIP_IF_XDP_NOT_SUPPORTED macro

Test: builds, atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia954983565250faff547e81a53ec0df5fc26827e
This commit is contained in:
Maciej Żenczykowski 2021-01-20 15:23:40 -08:00
commit a36bed395f

View file

@ -57,6 +57,15 @@ static inline bool isAtLeastKernelVersion(unsigned major, unsigned minor, unsign
} \
} while (0)
#define SKIP_IF_XDP_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) { \
GTEST_LOG_(INFO) << "This test is skipped since xdp" \
<< "not supported\n"; \
return; \
} \
} while (0)
} // namespace bpf
} // namespace android