(t *testing.T)
| 239 | } |
| 240 | |
| 241 | func TestProgramLoadPinnedWithFlags(t *testing.T) { |
| 242 | // Introduced in commit 6e71b04a8224. |
| 243 | testutils.SkipOnOldKernel(t, "4.14", "file_flags in BPF_OBJ_GET") |
| 244 | |
| 245 | prog := createBasicProgram(t) |
| 246 | |
| 247 | tmp := testutils.TempBPFFS(t) |
| 248 | |
| 249 | path := filepath.Join(tmp, "program") |
| 250 | if err := prog.Pin(path); err != nil { |
| 251 | t.Fatal(err) |
| 252 | } |
| 253 | |
| 254 | prog.Close() |
| 255 | |
| 256 | _, err := LoadPinnedProgram(path, &LoadPinOptions{ |
| 257 | Flags: math.MaxUint32, |
| 258 | }) |
| 259 | testutils.SkipIfNotSupported(t, err) |
| 260 | if !errors.Is(err, unix.EINVAL) { |
| 261 | t.Fatal("Invalid flags don't trigger an error:", err) |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | func TestProgramVerifierOutputOnError(t *testing.T) { |
| 266 | _, err := newProgram(t, &ProgramSpec{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…