register

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Tests = map[string]*Test{}

Registered tests live here. Mapping of names to tests.

Functions

func Register

func Register(t *Test)

Register is usually called in init() functions and is how kola test harnesses knows which tests it can choose from. Panics if existing name is registered

Types

type Flag added in v0.6.0

type Flag int
const (
	NoSSHKeyInUserData      Flag = iota // don't inject SSH key into Ignition/cloud-config
	NoSSHKeyInMetadata                  // don't add SSH key to platform metadata
	NoEmergencyShellCheck               // don't check console output for emergency shell invocation
	NoEnableSelinux                     // don't enable selinux when starting or rebooting a machine
	NoKernelPanicCheck                  // don't check console output for kernel panic
	NoVerityCorruptionCheck             // don't check console output for verity corruption
)

type Test

type Test struct {
	Name             string // should be unique
	Run              func(cluster.TestCluster)
	NativeFuncs      map[string]func() error
	UserData         *conf.UserData
	UserDataV3       *conf.UserData
	ClusterSize      int
	Platforms        []string // whitelist of platforms to run test against -- defaults to all
	ExcludePlatforms []string // blacklist of platforms to ignore -- defaults to none
	Distros          []string // whitelist of distributions to run test against -- defaults to all
	ExcludeDistros   []string // blacklist of distributions to ignore -- defaults to none
	Channels         []string // whitelist of channels to run test against -- defaults to all
	ExcludeChannels  []string // blacklist of channels to ignore -- defaults to none
	Offerings        []string // whitelist of offerings to run the test against -- defaults to all
	ExcludeOfferings []string // blacklist of offerings to ignore -- defaults to none
	Architectures    []string // whitelist of machine architectures supported -- defaults to all
	Flags            []Flag   // special-case options for this test

	// FailFast skips any sub-test that occurs after a sub-test has
	// failed.
	FailFast bool

	// MinVersion prevents the test from executing on CoreOS machines
	// less than MinVersion. This will be ignored if the name fully
	// matches without globbing.
	MinVersion semver.Version

	// EndVersion prevents the test from executing on CoreOS machines
	// greater than or equal to EndVersion. This will be ignored if
	// the name fully matches without globbing.
	EndVersion semver.Version

	// SkipFunc can be used to define if a test should be skip or not based on some
	// condition on the version, channel, arch and platform.
	SkipFunc func(version semver.Version, channel, arch, platform string) bool
}

Test provides the main test abstraction for kola. The run function is the actual testing function while the other fields provide ways to statically declare state of the platform.TestCluster before the test function is run.

func (*Test) HasFlag added in v0.6.0

func (t *Test) HasFlag(flag Flag) bool

Jump to

Keyboard shortcuts

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