The purpose of this test is to verify that the bpfloader related stuff in the platform is compatible with mainline module bpf .o's. To be more precise: the test is trying to check that platform/OEM BPF programs (and, by implication, the platform/OEM bpfloader) have a struct layout that is known, and thus that BPF programs shipped in mainline modules will be compatible (with the OEM bpfloader). (ie. basically this is trying to make sure that the vendor/oem haven't made incompatible changes to the bpfloader parsed structs, these can only be extended safely in aosp master) Since clatd/netd.o have been moved to mainline they are no longer a useful representation of the state of the platform side of things. (we'd simply be testing that mainline is compatible with mainline, which of course it is...) As such we pick two other bpf .o files that are still shipped as part of the platform. Verified on cuttlefish via 'atest CtsNativeNetTestCases': x86 CtsNativeNetTestCases ------------------------- CtsNativeNetTestCases (2 Test(s)) [1/2] BpfTest#bpfStructSizeTestPreT: IGNORED (0ms) [2/2] BpfTest#bpfStructSizeTest: PASSED (0ms) Summary (Test executed with 1 device(s).) ------- x86 CtsNativeNetTestCases: Passed: 1, Failed: 0, Ignored: 1, Assumption Failed: 0, All tests passed! Note: it's not clear to me if this code can even ever be run on pre-T devices... but I guess it shouldn't hurt. Bug: 215718693 Test: atest Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I1b2d76e5ef95d8e4b94068f5525263653879d1f4
61 lines
1.3 KiB
Plaintext
61 lines
1.3 KiB
Plaintext
// Copyright (C) 2017 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// Build the unit tests.
|
|
|
|
package {
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
cc_test {
|
|
name: "CtsNativeNetTestCases",
|
|
|
|
compile_multilib: "both",
|
|
multilib: {
|
|
lib32: {
|
|
suffix: "32",
|
|
},
|
|
lib64: {
|
|
suffix: "64",
|
|
},
|
|
},
|
|
|
|
srcs: [
|
|
"src/BpfCompatTest.cpp",
|
|
],
|
|
|
|
shared_libs: [
|
|
"libbase",
|
|
"liblog",
|
|
],
|
|
|
|
static_libs: [
|
|
"libbpf_android",
|
|
"libgtest",
|
|
"libmodules-utils-build",
|
|
],
|
|
|
|
// Tag this module as a cts test artifact
|
|
test_suites: [
|
|
"cts",
|
|
"general-tests",
|
|
],
|
|
|
|
cflags: [
|
|
"-Werror",
|
|
"-Wall",
|
|
],
|
|
|
|
}
|