testutilities

package
v0.0.0-...-ba4bfca Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLCOWBlankRWLayer

func CreateLCOWBlankRWLayer(ctx context.Context, t *testing.T) string

CreateLCOWBlankRWLayer uses an LCOW utility VM to create a blank VHDX and format it ext4. This can then be used as a scratch space for a container, or for a "service VM".

func CreateLCOWUVM

func CreateLCOWUVM(ctx context.Context, t *testing.T, id string) *uvm.UtilityVM

CreateLCOWUVM with all default options.

func CreateLCOWUVMFromOpts

func CreateLCOWUVMFromOpts(ctx context.Context, t *testing.T, opts *uvm.OptionsLCOW) *uvm.UtilityVM

CreateLCOWUVMFromOpts creates an LCOW utility VM with the specified options.

func CreateTempDir

func CreateTempDir(t *testing.T) string

CreateTempDir creates a temporary directory

func CreateWCOWBlankRWLayer

func CreateWCOWBlankRWLayer(t *testing.T, imageLayers []string) string

CreateWCOWBlankRWLayer uses HCS to create a temp test directory containing a read-write layer containing a disk that can be used as a containers scratch space. The VHD is created with VM group access TODO: This is wrong. Need to search the folders.

func CreateWCOWUVM

func CreateWCOWUVM(ctx context.Context, t *testing.T, id, image string) (*uvm.UtilityVM, []string, string)

CreateWCOWUVM creates a WCOW utility VM with all default options. Returns the UtilityVM object; folder used as its scratch

func CreateWCOWUVMFromOpts

func CreateWCOWUVMFromOpts(ctx context.Context, t *testing.T, opts *uvm.OptionsWCOW) *uvm.UtilityVM

CreateWCOWUVMFromOpts creates a WCOW utility VM with the passed opts.

func CreateWCOWUVMFromOptsWithImage

func CreateWCOWUVMFromOptsWithImage(ctx context.Context, t *testing.T, opts *uvm.OptionsWCOW, image string) (*uvm.UtilityVM, []string, string)

CreateWCOWUVMFromOptsWithImage creates a WCOW utility VM with the passed opts builds the LayerFolders based on `image`. Returns the UtilityVM object; folder used as its scratch

func GetDefaultLinuxSpec

func GetDefaultLinuxSpec(t *testing.T) *specs.Spec

func GetDefaultWindowsSpec

func GetDefaultWindowsSpec(t *testing.T) *specs.Spec

func LayerFolders

func LayerFolders(t *testing.T, imageName string) []string

func RequiresBuild

func RequiresBuild(t *testing.T, b uint16)

func RequiresExactBuild

func RequiresExactBuild(t *testing.T, b uint16)

Types

type StringSetFlag

type StringSetFlag struct {
	// contains filtered or unexported fields
}

StringSetFlag is a type to be used with the standard library's flag.Var function as a custom flag value. It accumulates the arguments passed each time the flag is used into a set.

func NewStringSetFlag

func NewStringSetFlag() StringSetFlag

NewStringSetFlag returns a new StringSetFlag with an empty set.

func (StringSetFlag) Set

func (ssf StringSetFlag) Set(s string) error

Set is called by `flag` each time the flag is seen when parsing the command line.

func (StringSetFlag) String

func (ssf StringSetFlag) String() string

func (StringSetFlag) ValueSet

func (ssf StringSetFlag) ValueSet() map[string]struct{}

ValueSet returns the internal set of what values have been seen.

Jump to

Keyboard shortcuts

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