Skip BpfExistenceTest#TestPrograms on BPF unsupported device
BPF is supported after kernel 4.9. Skip the test on BPF unsupported device. Ex: walleye. Bug: 219696135 Test: atest bpf_existence_test on walleye Change-Id: I583a858587c0501582c9e77c8b584b3136312cd5
This commit is contained in:
parent
61ef984d52
commit
0456900bf2
2 changed files with 6 additions and 0 deletions
|
|
@ -27,6 +27,9 @@ cc_test {
|
|||
"connectivity-mainline-presubmit-cc-defaults",
|
||||
],
|
||||
require_root: true,
|
||||
header_libs: [
|
||||
"bpf_headers",
|
||||
],
|
||||
static_libs: [
|
||||
"libbase",
|
||||
"libmodules-utils-build",
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <android/api-level.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-modules-utils/sdk_level.h>
|
||||
#include <bpf/BpfUtils.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
|
@ -151,6 +152,8 @@ void checkFiles() {
|
|||
}
|
||||
|
||||
TEST_F(BpfExistenceTest, TestPrograms) {
|
||||
SKIP_IF_BPF_NOT_SUPPORTED;
|
||||
|
||||
// Pre-flight check to ensure test has been updated.
|
||||
uint64_t buildVersionSdk = android_get_device_api_level();
|
||||
ASSERT_NE(0, buildVersionSdk) << "Unable to determine device SDK version";
|
||||
|
|
|
|||
Loading…
Reference in a new issue