package testutils
import "github.com/cilium/ebpf/internal/testutils"
Index ¶
- func CheckFeatureMatrix[K comparable](t *testing.T, fm internal.FeatureMatrix[K])
- func CheckFeatureTest(t *testing.T, fn func() error)
- func CreateCgroup(tb testing.TB) *os.File
- func Files(t *testing.T, files []string, fn func(*testing.T, string))
- func GetCgroupIno(t *testing.T, cgroup *os.File) uint64
- func Glob(tb testing.TB, pattern string, excludes ...string) []string
- func IsKernelLessThan(tb testing.TB, minVersion string) bool
- func Rand(tb testing.TB) *rand.Rand
- func SkipIfNotSupported(tb testing.TB, err error)
- func SkipOnOldKernel(tb testing.TB, minVersion, feature string)
- func TempBPFFS(tb testing.TB) string
Functions ¶
func CheckFeatureMatrix ¶
func CheckFeatureMatrix[K comparable](t *testing.T, fm internal.FeatureMatrix[K])
func CheckFeatureTest ¶
func CreateCgroup ¶
func Files ¶
Files calls fn for each given file.
The function errors out if the pattern matches no files.
func GetCgroupIno ¶
func Glob ¶
Glob finds files matching a pattern.
The pattern should may include full path. Excludes use the same syntax as pattern, but are only applied to the basename instead of the full path.
func IsKernelLessThan ¶
func Rand ¶
func SkipIfNotSupported ¶
func SkipOnOldKernel ¶
func TempBPFFS ¶
TempBPFFS creates a temporary directory on a BPF FS.
The directory is automatically cleaned up at the end of the test run.
Source Files ¶
bpffs.go cgroup.go feature.go glob.go rlimit.go seed.go
Directories ¶
Path | Synopsis |
---|---|
internal/testutils/fdtrace |
- Version
- v0.13.0
- Published
- Feb 15, 2024
- Platform
- darwin/amd64
- Imports
- 13 packages
- Last checked
- 39 seconds ago –
Tools for package owners.