Commit d37ad9c
struct_ops_test: Fix
On newer kernels fields have been added to the value type of the
`bpf_testmod_ops` struct. The test was assuming a static size of
448 bytes, but that is no longer valid for all kernels.
Instead of hardcoding the size, we now look up the value type in the BTF
of the module and use that size to create the map contents.
Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>TestCreateStructOpsMapSpecSimple
1 parent 5e8bcc7 commit d37ad9c
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | | - | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
0 commit comments