kola

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

README

kola

See the kola docs.

Documentation

Index

Constants

View Source
const AllowRerunSuccessTag = "allow-rerun-success"

The string for the tag that indicates a test has been marked as allowing rerun success. In some cases the internal test framework will add this tag to a test to indicate if the test passes a rerun to allow the run to succeed.

View Source
const InstalledTestDefaultTest = "test.sh"

InstalledTestDefaultTest is a special name; see the README-kola-ext.md for more information.

View Source
const InstalledTestMetaPrefix = "# kola:"

InstalledTestMetaPrefix is the prefix for JSON-formatted metadata

View Source
const InstalledTestMetaPrefixYaml = "## kola:"

InstalledTestMetaPrefixYaml is the prefix for YAML-formatted metadata

View Source
const InstalledTestsDir = "/usr/lib/coreos-assembler/tests/kola"

InstalledTestsDir is a directory where "installed" external can be placed; for example, a project like ostree can install tests at /usr/lib/coreos-assembler/tests/kola/ostree/... and this will be automatically picked up.

View Source
const KoletExtTestUnit = "kola-runext"
View Source
const KoletRebootAckFifo = "/run/kolet-reboot-ack"
View Source
const NeedsInternetTag = "needs-internet"

This is the same string from https://salsa.debian.org/ci-team/autopkgtest/raw/master/doc/README.package-tests.rst Specifying this in the tags list is required to denote a need for Internet access

View Source
const PlatformIndependentTag = "platform-independent"

PlatformIndependentTag is currently equivalent to platform: qemu, but that may change in the future. For more, see the doc in external-tests.md.

View Source
const SkipBaseChecksTag = "skip-base-checks"

Don't e.g. check console for kernel errors, SELinux AVCs, etc.

View Source
const SkipConsoleWarningsTag = "skip-console-warnings"

SkipConsoleWarningsTag will cause kola not to check console for kernel errors. This overlaps with SkipBaseChecksTag above, but is really a special flag for kola-denylist.yaml.

Variables

View Source
var (
	Options          = platform.Options{}
	AWSOptions       = awsapi.Options{Options: &Options}       // glue to set platform options from main
	AzureOptions     = azureapi.Options{Options: &Options}     // glue to set platform options from main
	DOOptions        = doapi.Options{Options: &Options}        // glue to set platform options from main
	ESXOptions       = esxapi.Options{Options: &Options}       // glue to set platform options from main
	GCPOptions       = gcloudapi.Options{Options: &Options}    // glue to set platform options from main
	OpenStackOptions = openstackapi.Options{Options: &Options} // glue to set platform options from main
	PacketOptions    = packetapi.Options{Options: &Options}    // glue to set platform options from main
	QEMUOptions      = qemu.Options{Options: &Options}         // glue to set platform options from main
	QEMUIsoOptions   = qemuiso.Options{Options: &Options}      // glue to set platform options from main

	CosaBuild *util.LocalBuild // this is a parsed cosa build

	TestParallelism int    //glue var to set test parallelism from main
	TAPFile         string // if not "", write TAP results here
	NoNet           bool   // Disable tests requiring Internet
	// ForceRunPlatformIndependent will cause tests that claim platform-independence to run
	ForceRunPlatformIndependent bool

	// SkipConsoleWarnings is set via SkipConsoleWarningsTag in kola-denylist.yaml
	SkipConsoleWarnings bool
	DenylistedTests     []string // tests which are on the denylist
	WarnOnErrorTests    []string // denylisted tests we are going to run and warn in case of error
	Tags                []string // tags to be ran

	// Sharding is a string of the form: hash:m/n where m and n are integers to run only tests which hash to m.
	Sharding string

	ErrWarnOnTestFail = errors.New("A test marked as warn:true failed.")
)

Functions

func CheckConsole

func CheckConsole(output []byte, t *register.Test) (bool, []string)

CheckConsole checks some console output for badness and returns short descriptions of any bad lines it finds along with a boolean indicating if the configuration has the bad lines marked as warnOnly or not (for things we don't want to error for). If t is specified, its flags are respected and tags possibly updated for rerun success.

func GetBaseTestName

func GetBaseTestName(testName string) string

func GetRerunnableTestName

func GetRerunnableTestName(testName string) (string, bool)

func HasString

func HasString(s string, slice []string) bool

HasString returns true if `s` equals one of the strings in `slice`.

func IsWarningOnFailure

func IsWarningOnFailure(testName string) bool

func MatchesPatterns

func MatchesPatterns(s string, patterns []string) (bool, error)

MatchesPatterns returns true if `s` matches one of the patterns in `patterns`.

func NewFlight

func NewFlight(pltfrm string) (flight platform.Flight, err error)

func ParseDenyListYaml

func ParseDenyListYaml(pltfrm string) error

func RegisterExternalTests

func RegisterExternalTests(dir string) error

RegisterExternalTests iterates over a directory, and finds subdirectories that have exactly one executable binary.

func RegisterExternalTestsWithPrefix

func RegisterExternalTestsWithPrefix(dir, prefix string) error

func RunTests

func RunTests(patterns []string, multiply int, rerun bool, rerunSuccessTags []string, pltfrm, outputDir string) error

func RunUpgradeTests

func RunUpgradeTests(patterns []string, rerun bool, pltfrm, outputDir string) error

func ScpKolet added in v0.17.0

func ScpKolet(machines []platform.Machine) error

ScpKolet searches for a kolet binary and copies it to the machine.

func SetupOutputDir

func SetupOutputDir(outputDir, platform string) (string, error)

Types

type DenyListObj

type DenyListObj struct {
	Pattern    string   `yaml:"pattern"`
	Tracker    string   `yaml:"tracker"`
	Streams    []string `yaml:"streams"`
	Arches     []string `yaml:"arches"`
	Platforms  []string `yaml:"platforms"`
	SnoozeDate string   `yaml:"snooze"`
	OsVersion  []string `yaml:"osversion"`
	Warn       bool     `yaml:"warn"`
}

type InitConfigData

type InitConfigData struct {
	ConfigVariant string `json:"coreos-assembler.config-variant"`
}

type KoletResult

type KoletResult struct {
	Reboot string
}

KoletResult is serialized JSON passed from kolet to the harness

type ManifestData

type ManifestData struct {
	Variables struct {
		Stream    string `yaml:"stream"`
		OsVersion string `yaml:"osversion"`
	} `yaml:"variables"`
}

type NativeRunner

type NativeRunner func(funcName string, m platform.Machine) error

NativeRunner is a closure passed to all kola test functions and used to run native go functions directly on kola machines. It is necessary glue until kola does introspection.

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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