adjust for newly added bpf map/prog definition fields in T+
This is needed due to BpfLoader v0.18 supporting more
functionality and thus bpf code compilation by default using
larger structs than it did during S.
Bug: 218408035
Test: booted on cuttlefish, atest CtsNativeNetTestCases
OBSigned-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55
(cherry picked from commit b95db28080)
Merged-In: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55
This commit is contained in:
@@ -31,8 +31,13 @@ void doBpfStructSizeTest(const char *elfPath) {
|
|||||||
std::ifstream elfFile(elfPath, std::ios::in | std::ios::binary);
|
std::ifstream elfFile(elfPath, std::ios::in | std::ios::binary);
|
||||||
ASSERT_TRUE(elfFile.is_open());
|
ASSERT_TRUE(elfFile.is_open());
|
||||||
|
|
||||||
EXPECT_EQ(48, readSectionUint("size_of_bpf_map_def", elfFile, 0));
|
if (android::modules::sdklevel::IsAtLeastT()) {
|
||||||
EXPECT_EQ(28, readSectionUint("size_of_bpf_prog_def", elfFile, 0));
|
EXPECT_EQ(116, readSectionUint("size_of_bpf_map_def", elfFile, 0));
|
||||||
|
EXPECT_EQ(92, readSectionUint("size_of_bpf_prog_def", elfFile, 0));
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(48, readSectionUint("size_of_bpf_map_def", elfFile, 0));
|
||||||
|
EXPECT_EQ(28, readSectionUint("size_of_bpf_prog_def", elfFile, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(BpfTest, bpfStructSizeTestPreT) {
|
TEST(BpfTest, bpfStructSizeTestPreT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user