package util
import "github.com/opencontainers/runtime-tools/validation/util"
Index ¶
- Variables
- func Fatal(err error)
- func GetDefaultGenerator() *generate.Generator
- func PrepareBundle() (string, error)
- func RuntimeInsideValidate(g *generate.Generator, f PreFunc) (err error)
- func RuntimeOutsideValidate(g *generate.Generator, f AfterFunc) error
- func Skip(message string, diagnostic interface{})
- func ValidateLinuxResourcesBlockIO(config *rspec.Spec, state *rspec.State) error
- func ValidateLinuxResourcesMemory(config *rspec.Spec, state *rspec.State) error
- func ValidateLinuxResourcesNetwork(config *rspec.Spec, state *rspec.State) error
- func ValidateLinuxResourcesPids(config *rspec.Spec, state *rspec.State) error
- type AfterFunc
- type PreFunc
- type Runtime
- func NewRuntime(runtimeCommand string, bundleDir string) (Runtime, error)
- func (r *Runtime) Clean(removeBundle bool, forceRemoveBundle bool) error
- func (r *Runtime) Create() (stderr []byte, err error)
- func (r *Runtime) Delete() error
- func (r *Runtime) ReadStandardStreams() (stdout []byte, stderr []byte, err error)
- func (r *Runtime) SetConfig(g *generate.Generator) error
- func (r *Runtime) SetID(id string)
- func (r *Runtime) Start() (stderr []byte, err error)
- func (r *Runtime) State() (rspecs.State, error)
Variables ¶
var ( // RuntimeCommand is the default runtime command. RuntimeCommand = "runc" )
Functions ¶
func Fatal ¶
func Fatal(err error)
Fatal prints a warning to stderr and exits.
func GetDefaultGenerator ¶
GetDefaultGenerator creates a default configuration generator.
func PrepareBundle ¶
PrepareBundle creates a test bundle in a temporary directory.
func RuntimeInsideValidate ¶
RuntimeInsideValidate runs runtimetest inside a container.
func RuntimeOutsideValidate ¶
RuntimeOutsideValidate validate runtime outside a container.
func Skip ¶
func Skip(message string, diagnostic interface{})
Skip skips a full TAP suite.
func ValidateLinuxResourcesBlockIO ¶
ValidateLinuxResourcesBlockIO validates linux.resources.blockIO.
func ValidateLinuxResourcesMemory ¶
ValidateLinuxResourcesMemory validates linux.resources.memory.
func ValidateLinuxResourcesNetwork ¶
ValidateLinuxResourcesNetwork validates linux.resources.network.
func ValidateLinuxResourcesPids ¶
ValidateLinuxResourcesPids validates linux.resources.pids.
Types ¶
type AfterFunc ¶
AfterFunc validate container's outside environment after created
type PreFunc ¶
PreFunc initializes the test environment after preparing the bundle but before creating the container.
type Runtime ¶
type Runtime struct { RuntimeCommand string BundleDir string ID string // contains filtered or unexported fields }
Runtime represents the basic requirement of a container runtime
func NewRuntime ¶
NewRuntime create a runtime by command and the bundle directory
func (*Runtime) Clean ¶
Clean deletes the container. If removeBundle is set, the bundle directory is removed after the container is deleted succesfully or, if forceRemoveBundle is true, after the deletion attempt regardless of whether it was successful or not.
func (*Runtime) Create ¶
Create a container
func (*Runtime) Delete ¶
Delete a container
func (*Runtime) ReadStandardStreams ¶
ReadStandardStreams collects content from the stdout and stderr buffers.
func (*Runtime) SetConfig ¶
SetConfig creates a 'config.json' by the generator
func (*Runtime) SetID ¶
SetID sets the container ID
func (*Runtime) Start ¶
Start a container
func (*Runtime) State ¶
State a container information
Source Files ¶
container.go linux_resources_blkio.go linux_resources_memory.go linux_resources_network.go linux_resources_pids.go test.go
- Version
- v0.4.0
- Published
- Jan 23, 2018
- Platform
- windows/amd64
- Imports
- 16 packages
- Last checked
- 21 hours ago –
Tools for package owners.