tests

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

README

= Integration tests =

Integration tests require a running Kubevirt cluster. Once you have a running Kubevirt cluster, you can use the -master and the -kubeconfig flags to point the tests to the cluster.

== Run them on Vagrant ==

The vagrant environment has an unprotected haproxy in front of the apiserver, so only -master needs to be set to run the tests.

cd tests # from the git repo root folder
go test -master=http://192.168.200.2:8184

There is a make target to run this with the config taken from hack/config.sh:

# from the git repo root folder
make functest

Documentation

Index

Constants

View Source
const (
	// tests.NamespaceTestDefault is the default namespace, to test non-infrastructure related KubeVirt objects.
	NamespaceTestDefault string = "kubevirt-test-default"
	// NamespaceTestAlternative is used to test controller-namespace independency.
	NamespaceTestAlternative string = "kubevirt-test-alternative"
)

Variables

This section is empty.

Functions

func AfterTestSuitCleanup

func AfterTestSuitCleanup()

func BeforeTestCleanup

func BeforeTestCleanup()

func BeforeTestSuitSetup

func BeforeTestSuitSetup()

func GetReadyNodes

func GetReadyNodes() []k8sv1.Node

func NewConsoleExpecter added in v0.0.4

func NewConsoleExpecter(config *rest.Config, vm *v1.VirtualMachine, consoleName string, timeout time.Duration, opts ...expect.Option) (expect.Expecter, <-chan error, error)

func NewInt32 added in v0.0.3

func NewInt32(x int32) *int32

func NewRandomMigrationForVm

func NewRandomMigrationForVm(vm *v1.VirtualMachine) *v1.Migration

func NewRandomReplicaSetFromVM added in v0.0.3

func NewRandomReplicaSetFromVM(vm *v1.VirtualMachine, replicas int32) *v1.VirtualMachineReplicaSet

func NewRandomVM

func NewRandomVM() *v1.VirtualMachine

func NewRandomVMWithDirectLun

func NewRandomVMWithDirectLun(lun int, withAuth bool) *v1.VirtualMachine

func NewRandomVMWithEphemeralDisk

func NewRandomVMWithEphemeralDisk(containerImage string) *v1.VirtualMachine

func NewRandomVMWithEphemeralDiskAndUserdata added in v0.0.3

func NewRandomVMWithEphemeralDiskAndUserdata(containerImage string, cloudInitDataSource, userData string) (*v1.VirtualMachine, error)

func NewRandomVMWithNS

func NewRandomVMWithNS(namespace string) *v1.VirtualMachine

func NewRandomVMWithPVC

func NewRandomVMWithPVC(claimName string) *v1.VirtualMachine

func NewRandomVMWithSerialConsole

func NewRandomVMWithSerialConsole() *v1.VirtualMachine

func NewRandomVMWithSpice

func NewRandomVMWithSpice() *v1.VirtualMachine

func NewRandomVMWithUserData added in v0.0.3

func NewRandomVMWithUserData(cloudInitDataSource string, userData string) (*v1.VirtualMachine, error)

func NewRandomVMWithWatchdog added in v0.1.0

func NewRandomVMWithWatchdog() *v1.VirtualMachine

func PanicOnError

func PanicOnError(err error)

func WaitForSuccessfulVMStart

func WaitForSuccessfulVMStart(vm runtime.Object) string

func WaitForSuccessfulVMStartWithTimeout added in v0.0.3

func WaitForSuccessfulVMStartWithTimeout(vm runtime.Object, seconds int) (nodeName string)

Block until the specified VM started and return the target node name.

Types

type EventType

type EventType string
const (
	NormalEvent  EventType = "Normal"
	WarningEvent EventType = "Warning"
)

type ObjectEventWatcher

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

func NewObjectEventWatcher

func NewObjectEventWatcher(object runtime.Object) *ObjectEventWatcher

func (*ObjectEventWatcher) FailOnWarnings

func (w *ObjectEventWatcher) FailOnWarnings() *ObjectEventWatcher

func (*ObjectEventWatcher) SinceNow

func (w *ObjectEventWatcher) SinceNow() *ObjectEventWatcher

SinceNow sets a watch starting point for events, from the moment on the connection to the apiserver was established.

func (*ObjectEventWatcher) SinceObjectResourceVersion

func (w *ObjectEventWatcher) SinceObjectResourceVersion(object runtime.Object) *ObjectEventWatcher

SinceObjectResourceVersion takes the resource version of the passed in runtime object and takes it as the starting point for all events to watch for.

func (*ObjectEventWatcher) SinceResourceVersion

func (w *ObjectEventWatcher) SinceResourceVersion(rv string) *ObjectEventWatcher

SinceResourceVersion sets the passed in resourceVersion as the starting point for all events to watch for.

func (*ObjectEventWatcher) SinceWatchedObjectResourceVersion

func (w *ObjectEventWatcher) SinceWatchedObjectResourceVersion() *ObjectEventWatcher

SinceWatchedObjectResourceVersion takes the resource version of the runtime object which is watched, and takes it as the starting point for all events to watch for.

func (*ObjectEventWatcher) Timeout

func (w *ObjectEventWatcher) Timeout(duration time.Duration) *ObjectEventWatcher

func (*ObjectEventWatcher) WaitFor

func (w *ObjectEventWatcher) WaitFor(eventType EventType, reason interface{}) (e *k8sv1.Event)

func (*ObjectEventWatcher) Watch

func (w *ObjectEventWatcher) Watch(processFunc ProcessFunc)

type ProcessFunc

type ProcessFunc func(event *k8sv1.Event) (done bool)

Jump to

Keyboard shortcuts

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