| 1 | package linux |
| 2 | |
| 3 | import ( |
| 4 | "errors" |
| 5 | "testing" |
| 6 | |
| 7 | "github.com/cilium/ebpf/internal" |
| 8 | ) |
| 9 | |
| 10 | // skipIfNotSupportedOnOS is a copy of testutils.SkipIfNotSupported to avoid |
| 11 | // a circular dependency. |
| 12 | func skipIfNotSupportedOnOS(tb testing.TB, err error) { |
| 13 | tb.Helper() |
| 14 | |
| 15 | if err == internal.ErrNotSupportedOnOS { |
| 16 | tb.Fatal("Unwrapped ErrNotSupportedOnOS") |
| 17 | } |
| 18 | |
| 19 | if errors.Is(err, internal.ErrNotSupportedOnOS) { |
| 20 | tb.Skip(err.Error()) |
| 21 | } |
| 22 | } |