Documentation
¶
Index ¶
- Constants
- Variables
- func HypervisorRunning(containerID string) bool
- func KataInit()
- func LogIfFail(format string, args ...interface{})
- func ProxyRunning(containerID string) bool
- func RandID(n int) string
- func ShimRunning(containerID string) bool
- type Bundle
- type Command
- type Container
- func (c *Container) Delete(force bool) (string, string, int)
- func (c *Container) Exec(process Process) (string, string, int)
- func (c *Container) Exist() bool
- func (c *Container) Kill(all bool, signal interface{}) (string, string, int)
- func (c *Container) List(format string, quiet bool, all bool) (string, string, int)
- func (c *Container) RemoveOption(option string) error
- func (c *Container) Run() (string, string, int)
- func (c *Container) SetWorkload(workload []string) error
- func (c *Container) State() (string, string, int)
- func (c *Container) Teardown() error
- type KataConfiguration
- type Process
Constants ¶
const ( // DefaultHypervisor default hypervisor DefaultHypervisor = "qemu" // FirecrackerHypervisor is firecracker FirecrackerHypervisor = "firecracker" // CloudHypervisor is cloud-hypervisor CloudHypervisor = "clh" // DefaultProxy default proxy DefaultProxy = "kata" // DefaultAgent default agent DefaultAgent = "kata" // DefaultShim default shim DefaultShim = "kata" // DefaultKataConfigPath is the default path to the kata configuration file DefaultKataConfigPath = "/usr/share/defaults/kata-containers/configuration.toml" )
Variables ¶
var Hypervisor string
Hypervisor is the hypervisor currently being used with Kata
var KataHypervisor string
var Runtime string
Runtime is the path of a Kata Containers Runtime
var Timeout int
Timeout specifies the time limit in seconds for each test
Functions ¶
func HypervisorRunning ¶
HypervisorRunning returns true if the hypervisor is still running, otherwise false
func KataInit ¶
func KataInit()
KataInit initializes the kata test suite. This function should be called as soon as possible preferably from `TestMain`
func LogIfFail ¶
func LogIfFail(format string, args ...interface{})
LogIfFail will output the message online if the test fails. This can be used for information that would be useful to debug a failure.
func ProxyRunning ¶
ProxyRunning returns true if the proxy is still running, otherwise false
func ShimRunning ¶
ShimRunning returns true if the shim is still running, otherwise false
Types ¶
type Bundle ¶
type Bundle struct { // Config represents the config.json Config *spec.Spec // Path to the bundle Path string }
Bundle represents the root directory where config.json and rootfs are
type Command ¶
type Command struct { // Timeout is the time limit of seconds of the command Timeout time.Duration // contains filtered or unexported fields }
Command contains the information of the command to run
func NewCommand ¶
NewCommand returns a new instance of Command
type Container ¶
type Container struct { // Bundle contains the container information // if nil then try to run the container without --bundle option Bundle *Bundle // Console pty slave path // if nil then try to run the container without --console option Console *string // PidFile where process id is written // if nil then try to run the container without --pid-file option PidFile *string // LogFile where debug information is written // if nil then try to run the container without --log option LogFile *string // ID of the container // if nil then try to run the container without container ID ID *string // Detach allows to run the process detached from the shell Detach bool }
Container represents a kata container
func NewContainer ¶
NewContainer returns a new Container
func (*Container) Delete ¶
Delete the container calls to delete command returning its stdout, stderr and exit code
func (*Container) Exec ¶
Exec the container calls into exec command returning its stdout, stderr and exit code
func (*Container) Exist ¶
Exist returns true if any of next cases is true: - list command shows the container - the process id specified in the pid file is running (cc-shim) - the VM is running (qemu) - the proxy is running - the shim is running else false is returned
func (*Container) Kill ¶
Kill the container calls to kill command returning its stdout, stderr and exit code
func (*Container) List ¶
List the containers calls to list command returning its stdout, stderr and exit code
func (*Container) RemoveOption ¶
RemoveOption removes a specific option container will run without the specific option
func (*Container) Run ¶
Run the container calls to run command returning its stdout, stderr and exit code
func (*Container) SetWorkload ¶
SetWorkload sets a workload for the container
type KataConfiguration ¶
type KataConfiguration struct { Hypervisor map[string]hypervisor Proxy map[string]proxy Shim map[string]shim Agent map[string]agent Runtime runtime }
KataConfiguration is the runtime configuration
var KataConfig KataConfiguration
KataConfig is the runtime configuration