test

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package test provides the definition of a Test and a test Builder, as well as some error types useful to identify error conditions and retrieve additional information, like step/resource name and index.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// Build builds a new test.
	Build(logger logr.Logger, testDesc *loader.Test) (Test, error)
}

Builder allows to build new test.

type ResourceBuildError

type ResourceBuildError struct {
	ResourceName  string
	ResourceIndex int
	Err           error
}

ResourceBuildError is an error produced while building a test resource.

func (*ResourceBuildError) Error

func (e *ResourceBuildError) Error() string

type ResourceCreationError

type ResourceCreationError struct {
	ResourceName  string
	ResourceIndex int
	Err           error
}

ResourceCreationError is an error produced while creating a test resource.

func (*ResourceCreationError) Error

func (e *ResourceCreationError) Error() string

type Script

type Script interface {
	// RunBefore runs the "before" part of the script. The execution will block until the "before" script execution is
	// completed. It returns a function that can be used to run the "after" part.
	RunBefore(ctx context.Context) (func(ctx context.Context) error, error)
}

Script wraps the execution of a test script. The test script is logically divided into two part: a "before" part and an "after" part. The two parts can be executed in the same environment or not, depends on the particular implementation choice.

type StepBuildError

type StepBuildError struct {
	StepName  string
	StepIndex int
	Err       error
}

StepBuildError is an error produced while building a test step.

func (*StepBuildError) Error

func (e *StepBuildError) Error() string

type StepRunError

type StepRunError struct {
	StepName  string
	StepIndex int
	Err       error
}

StepRunError is an error produced while running a test step.

func (*StepRunError) Error

func (e *StepRunError) Error() string

type Test

type Test interface {
	// Run runs the test.
	Run(ctx context.Context) error
}

Test represents a runnable test.

Directories

Path Synopsis
Package builder provides an implementation of test.Builder.
Package builder provides an implementation of test.Builder.
Package field defines a generic way to reference and assign values to any test field by leveraging reflection and struct field tagging.
Package field defines a generic way to reference and assign values to any test field by leveraging reflection and struct field tagging.
Package loader defines a Loader, able to unmarshall a YAML document into a Description.
Package loader defines a Loader, able to unmarshall a YAML document into a Description.
schema
Package schema provides validation for the loaded tests description and documentation generation leveraging JSON schemas.
Package schema provides validation for the loaded tests description and documentation generation leveraging JSON schemas.
Package resource provides the definition of a test Resource and a test resource Builder.
Package resource provides the definition of a test Resource and a test resource Builder.
builder
Package builder provides an implementation of resource.Builder.
Package builder provides an implementation of resource.Builder.
clientserver
Package clientserver provides the implementation of a clientServer test resource.
Package clientserver provides the implementation of a clientServer test resource.
fd/directory
Package directory provides the implementation of a directory fd test resource.
Package directory provides the implementation of a directory fd test resource.
fd/epoll
Package epoll provides the implementation of an eventpoll fd test resource.
Package epoll provides the implementation of an eventpoll fd test resource.
fd/event
Package event provides the implementation of an event fd test resource.
Package event provides the implementation of an event fd test resource.
fd/file
Package file provides the implementation of a regular file fd test resource.
Package file provides the implementation of a regular file fd test resource.
fd/inotify
Package inotify provides the implementation of an inotify fd test resource.
Package inotify provides the implementation of an inotify fd test resource.
fd/mem
Package mem provides the implementation of a memfd fd test resource.
Package mem provides the implementation of a memfd fd test resource.
fd/pipe
Package pipe provides the implementation of a pipe fd test resource.
Package pipe provides the implementation of a pipe fd test resource.
fd/signal
Package signal provides the implementation of a signal fd test resource.
Package signal provides the implementation of a signal fd test resource.
process
Package process provides the implementation of a process test resource.
Package process provides the implementation of a process test resource.
Package runner provides the definition of a Runner and a runner Builder.
Package runner provides the definition of a Runner and a runner Builder.
builder
Package builder provides an implementation of runner.Builder.
Package builder provides an implementation of runner.Builder.
host
Package host provides an implementation of runner.Runner enabling test execution on the host system.
Package host provides an implementation of runner.Runner enabling test execution on the host system.
script
shell
Package shell provides the implementation of a shell test script.
Package shell provides the implementation of a shell test script.
Package step provides the definition of a test Step and a test step Builder.
Package step provides the definition of a test Step and a test step Builder.
builder
Package builder provides an implementation of step.Builder.
Package builder provides an implementation of step.Builder.
syscall
Package syscall provides the definition of a Syscall test step and a syscall test step Builder.
Package syscall provides the definition of a Syscall test step and a syscall test step Builder.
syscall/base
Package base provides the definition of a generic syscall.Syscall test step.
Package base provides the definition of a generic syscall.Syscall test step.
syscall/builder
Package builder provides the implementation of a syscall.Builder.
Package builder provides the implementation of a syscall.Builder.
syscall/connect
Package connect provides the implementation of a connect system call test step.
Package connect provides the implementation of a connect system call test step.
syscall/dup
Package dup provides the implementation of a dup system call test step.
Package dup provides the implementation of a dup system call test step.
syscall/dup2
Package dup2 provides the implementation of a dup2 system call test step.
Package dup2 provides the implementation of a dup2 system call test step.
syscall/dup3
Package dup3 provides the implementation of a dup3 system call test step.
Package dup3 provides the implementation of a dup3 system call test step.
syscall/finitmodule
Package finitmodule provides the implementation of an finit_module system call test step.
Package finitmodule provides the implementation of an finit_module system call test step.
syscall/initmodule
Package initmodule provides the implementation of an init_module system call test step.
Package initmodule provides the implementation of an init_module system call test step.
syscall/kill
Package kill provides the implementation of a kill system call test step.
Package kill provides the implementation of a kill system call test step.
syscall/link
Package link provides the implementation of a link system call test step.
Package link provides the implementation of a link system call test step.
syscall/linkat
Package linkat provides the implementation of a linkat system call test step.
Package linkat provides the implementation of a linkat system call test step.
syscall/open
Package open provides the implementation of an open system call test step.
Package open provides the implementation of an open system call test step.
syscall/openat
Package openat provides the implementation of an openat system call test step.
Package openat provides the implementation of an openat system call test step.
syscall/openat2
Package openat2 provides the implementation of an openat2 system call test step.
Package openat2 provides the implementation of an openat2 system call test step.
syscall/read
Package read provides the implementation of a write system call test step.
Package read provides the implementation of a write system call test step.
syscall/sendto
Package sendto provides the implementation of a sendto system call test step.
Package sendto provides the implementation of a sendto system call test step.
syscall/socket
Package socket provides the implementation of a socket system call test step.
Package socket provides the implementation of a socket system call test step.
syscall/symlink
Package symlink provides the implementation of a symlink system call test step.
Package symlink provides the implementation of a symlink system call test step.
syscall/symlinkat
Package symlinkat provides the implementation of a symlinkat system call test step.
Package symlinkat provides the implementation of a symlinkat system call test step.
syscall/write
Package write provides the implementation of a write system call test step.
Package write provides the implementation of a write system call test step.
Package suite provides the definition of a test suite as well as a mechanism to load multiple test suites from multiple sources through the Loader interface.
Package suite provides the definition of a test suite as well as a mechanism to load multiple test suites from multiple sources through the Loader interface.
loader
Package loader provides the implementation of a suite.Loader.
Package loader provides the implementation of a suite.Loader.
reportencoder/jsonencoder
Package jsonencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a JSON encoding.
Package jsonencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a JSON encoding.
reportencoder/textencoder
Package textencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a formatted text encoding.
Package textencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a formatted text encoding.
reportencoder/yamlencoder
Package yamlencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a YAML encoding.
Package yamlencoder provides an implementation of suite.ReportEncoder allowing to write a report to the underlying destination using a YAML encoding.
source
Package source provides the implementation of a suite.Source.
Package source provides the implementation of a suite.Source.
Package test provides an implementation the test.Test interface.
Package test provides an implementation the test.Test interface.
Package tester provides an implementation of tester.Tester.
Package tester provides an implementation of tester.Tester.

Jump to

Keyboard shortcuts

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