testutil

package
v0.0.0-...-7c31ad9 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiresCanManageOwnership = ConveyRequirement{"have caps for managing file ownership", caps.Scan().CanManageOwnership}

Require that the test process is running with enough capabilities to be able to manage file ownership.

View Source
var RequiresCanMountAny = ConveyRequirement{"have caps for any mounting", caps.Scan().CanMountAny}

Require that the test process is running with enough capabilities to be able to make any/all mounts.

View Source
var RequiresCanMountBind = ConveyRequirement{"have caps for mounting binds", caps.Scan().CanMountBind}

Require that the test process is running with enough capabilities to be able to make bind mounts.

View Source
var RequiresLongRun = ConveyRequirement{"run long tests", func() bool { return !testing.Short() }}

Require that the tests are not running with the "short" flag enabled.

Functions

func Requires

func Requires(items ...interface{}) func(c convey.C)

Decorates a GoConvey test to check a set of `ConveyRequirement`s, returning a dummy test func that skips (with an explanation!) if any of the requirements are unsatisfied; if all is well, it yields the real test function unchanged. Provide the `...ConveyRequirement`s first, followed by the `func()` (like the argument order in `Convey`).

func ShouldStat

func ShouldStat(afs fs.FS, path fs.RelPath) fs.Metadata

func WithTmpdir

func WithTmpdir(fn func(tmpDir fs.AbsolutePath))

Types

type ConveyRequirement

type ConveyRequirement struct {
	Name      string
	Predicate func() bool
}

func RequiresEnvBlank

func RequiresEnvBlank(key string) ConveyRequirement

Require than an env var *not* be set.

We use this for things like `RequiresEnvBlank(RIO_TEST_SKIP_AUFS)`.

Jump to

Keyboard shortcuts

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