testutils

package
v0.0.0-...-8d5c9ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFeatureMatrix

func CheckFeatureMatrix[K comparable](t *testing.T, fm internal.FeatureMatrix[K])

func CheckFeatureTest

func CheckFeatureTest(t *testing.T, fn func() error)

func CreateCgroup

func CreateCgroup(tb testing.TB) *os.File

func Files

func Files(t *testing.T, files []string, fn func(*testing.T, string))

Files calls fn for each given file.

The function errors out if the pattern matches no files.

func GetCgroupIno

func GetCgroupIno(t *testing.T, cgroup *os.File) uint64

func Glob

func Glob(tb testing.TB, pattern string, excludes ...string) []string

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 IsKernelLessThan(tb testing.TB, minVersion string) bool

func Rand

func Rand(tb testing.TB) *rand.Rand

func SkipIfNotSupported

func SkipIfNotSupported(tb testing.TB, err error)

func SkipOnOldKernel

func SkipOnOldKernel(tb testing.TB, minVersion, feature string)

func TempBPFFS

func TempBPFFS(tb testing.TB) string

TempBPFFS creates a temporary directory on a BPF FS.

The directory is automatically cleaned up at the end of the test run.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL