Documentation
¶
Index ¶
- Constants
- Variables
- func AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
- func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
- func AddEphemeralFloppy(vmi *v1.VirtualMachineInstance, name string, image string) *v1.VirtualMachineInstance
- func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
- func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus string, claimName string) *v1.VirtualMachineInstance
- func AfterTestSuitCleanup()
- func BeforeAll(fn func())
- func BeforeTestCleanup()
- func BeforeTestSuitSetup()
- func CheckForTextExpecter(vmi *v1.VirtualMachineInstance, text string, wait int) error
- func CreateHostPathPv(os string, hostPath string)
- func CreatePVC(os string, size string)
- func DeletePV(os string)
- func DeletePVC(os string)
- func ExecuteCommandOnPod(virtCli kubecli.KubevirtClient, pod *k8sv1.Pod, containerName string, ...) (string, error)
- func GenerateVMIJson(vmi *v1.VirtualMachineInstance) (string, error)
- func GetNodeCPUInfo(nodeName string) string
- func GetNodeLibvirtCapabilities(nodeName string) string
- func GetNodeWithHugepages(virtClient kubecli.KubevirtClient, hugepages k8sv1.ResourceName) *k8sv1.Node
- func GetRunningPodByLabel(label string, labelType string, namespace string) *k8sv1.Pod
- func LoggedInAlpineExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
- func LoggedInCirrosExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
- func NewBool(x bool) *bool
- func NewConsoleExpecter(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance, ...) (expect.Expecter, <-chan error, error)
- func NewHelloWorldJob(host string, port string) *k8sv1.Pod
- func NewHelloWorldJobUDP(host string, port string) *k8sv1.Pod
- func NewInt32(x int32) *int32
- func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
- func NewRandomVMI() *v1.VirtualMachineInstance
- func NewRandomVMIWithBridgeInterfaceEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithBridgeNetworkEphemeralDiskAndUserdata(containerImage, userData, networkName, bridgeName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithCDRom(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithCustomMacAddress() *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskHighMemory(containerImage string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithNS(namespace string) *v1.VirtualMachineInstance
- func NewRandomVMIWithPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithWatchdog() *v1.VirtualMachineInstance
- func NewRandomVMIWithe1000NetworkInterface() *v1.VirtualMachineInstance
- func NewRepeatableVirtctlCommand(args ...string) func() error
- func NewVirtctlCommand(args ...string) *cobra.Command
- func NotDeleted(vmis *v1.VirtualMachineInstanceList) (notDeleted []v1.VirtualMachineInstance)
- func PanicOnError(err error)
- func RegistryDiskFor(name RegistryDisk) string
- func RenderIPRouteJob(name string, args []string) *k8sv1.Pod
- func RenderJob(name string, cmd []string, args []string) *k8sv1.Pod
- func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
- func RunKubectlCommand(args ...string) (string, error)
- func SkipIfNoKubectl()
- func SkipIfNoWindowsImage(virtClient kubecli.KubevirtClient)
- func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string)
- func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
- func WaitForSuccessfulVMIStart(vmi runtime.Object) string
- func WaitForSuccessfulVMIStartIgnoreWarnings(vmi runtime.Object) string
- func WaitForSuccessfulVMIStartWithTimeout(vmi runtime.Object, seconds int) (nodeName string)
- func WaitForVirtualMachineToDisappearWithTimeout(vmi *v1.VirtualMachineInstance, seconds int)
- type EventType
- type ObjectEventWatcher
- func (w *ObjectEventWatcher) FailOnWarnings() *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceNow() *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceObjectResourceVersion(object runtime.Object) *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceResourceVersion(rv string) *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceWatchedObjectResourceVersion() *ObjectEventWatcher
- func (w *ObjectEventWatcher) Timeout(duration time.Duration) *ObjectEventWatcher
- func (w *ObjectEventWatcher) WaitFor(eventType EventType, reason interface{}) (e *k8sv1.Event)
- func (w *ObjectEventWatcher) Watch(processFunc ProcessFunc)
- type ProcessFunc
- type RegistryDisk
- type VMIExpecterFactory
Constants ¶
const ( SubresourceServiceAccountName = "kubevirt-subresource-test-sa" AdminServiceAccountName = "kubevirt-admin-test-sa" EditServiceAccountName = "kubevirt-edit-test-sa" ViewServiceAccountName = "kubevirt-view-test-sa" )
const ( // tests.NamespaceTestDefault is the default namespace, to test non-infrastructure related KubeVirt objects. NamespaceTestDefault = "kubevirt-test-default" // NamespaceTestAlternative is used to test controller-namespace independency. NamespaceTestAlternative = "kubevirt-test-alternative" )
const ( HostPathAlpine = "/tmp/hostImages/alpine" HostPathCustom = "/tmp/hostImages/custom" )
const ( DiskAlpineHostPath = "disk-alpine-host-path" DiskWindows = "disk-windows" DiskCustomHostPath = "disk-custom-host-path" )
const (
CustomHostPath = "custom-host-path"
)
const LocalStorageClass = "local"
const (
SecretLabel = "kubevirt.io/secret"
)
const SubresourceTestLabel = "subresource-access-test-pod"
const VMIResource = "virtualmachineinstances"
Variables ¶
var KubeVirtInstallNamespace = "kube-system"
var KubeVirtKubectlPath = ""
var KubeVirtRepoPrefix = "kubevirt"
var KubeVirtVersionTag = "latest"
Functions ¶
func AddBootOrderToDisk ¶ added in v0.6.0
func AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
func AddEphemeralDisk ¶ added in v0.3.0
func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
func AddEphemeralFloppy ¶ added in v0.3.0
func AddEphemeralFloppy(vmi *v1.VirtualMachineInstance, name string, image string) *v1.VirtualMachineInstance
func AddExplicitPodNetworkInterface ¶ added in v0.7.0
func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
func AddPVCDisk ¶ added in v0.5.0
func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus string, claimName string) *v1.VirtualMachineInstance
func AfterTestSuitCleanup ¶
func AfterTestSuitCleanup()
func BeforeTestCleanup ¶
func BeforeTestCleanup()
func BeforeTestSuitSetup ¶
func BeforeTestSuitSetup()
func CheckForTextExpecter ¶ added in v0.6.0
func CheckForTextExpecter(vmi *v1.VirtualMachineInstance, text string, wait int) error
func CreateHostPathPv ¶ added in v0.6.1
func ExecuteCommandOnPod ¶ added in v0.4.1
func GenerateVMIJson ¶ added in v0.6.1
func GenerateVMIJson(vmi *v1.VirtualMachineInstance) (string, error)
func GetNodeCPUInfo ¶ added in v0.6.3
GetNodeCPUInfo returns output of lscpu on the pod that runs on the specified node
func GetNodeLibvirtCapabilities ¶ added in v0.6.2
GetNodeLibvirtCapabilities returns node libvirt capabilities
func GetNodeWithHugepages ¶ added in v0.6.1
func GetNodeWithHugepages(virtClient kubecli.KubevirtClient, hugepages k8sv1.ResourceName) *k8sv1.Node
func GetRunningPodByLabel ¶ added in v0.3.0
func LoggedInAlpineExpecter ¶ added in v0.6.0
func LoggedInAlpineExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
func LoggedInCirrosExpecter ¶ added in v0.3.0
func LoggedInCirrosExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
func NewConsoleExpecter ¶ added in v0.0.4
func NewConsoleExpecter(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance, timeout time.Duration, opts ...expect.Option) (expect.Expecter, <-chan error, error)
func NewHelloWorldJob ¶ added in v0.6.0
NewHelloWorldJob takes a DNS entry or an IP and a port which it will use create a pod which tries to contact the host on the provided port. It expects to receive "Hello World!" to succeed.
func NewHelloWorldJobUDP ¶ added in v0.6.0
NewHelloWorldJobUDP takes a DNS entry or an IP and a port which it will use create a pod which tries to contact the host on the provided port. It expects to receive "Hello World!" to succeed. Note that in case of UDP, the server will not see the connection unless something is sent over it However, netcat does not work well with UDP and closes before the answer arrives, for that another netcat call is needed, this time as a UDP listener
func NewRandomReplicaSetFromVMI ¶ added in v0.6.1
func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
func NewRandomVMI ¶ added in v0.6.1
func NewRandomVMI() *v1.VirtualMachineInstance
func NewRandomVMIWithBridgeInterfaceEphemeralDiskAndUserdata ¶ added in v0.8.0
func NewRandomVMIWithBridgeInterfaceEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithBridgeNetworkEphemeralDiskAndUserdata ¶
func NewRandomVMIWithBridgeNetworkEphemeralDiskAndUserdata(containerImage, userData, networkName, bridgeName string) *v1.VirtualMachineInstance
func NewRandomVMIWithCDRom ¶ added in v0.6.1
func NewRandomVMIWithCDRom(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithCustomMacAddress ¶ added in v0.6.4
func NewRandomVMIWithCustomMacAddress() *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDisk ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndUserdata ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskHighMemory ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskHighMemory(containerImage string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralPVC ¶ added in v0.6.1
func NewRandomVMIWithEphemeralPVC(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithNS ¶ added in v0.6.1
func NewRandomVMIWithNS(namespace string) *v1.VirtualMachineInstance
func NewRandomVMIWithPVC ¶ added in v0.6.1
func NewRandomVMIWithPVC(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithWatchdog ¶ added in v0.6.1
func NewRandomVMIWithWatchdog() *v1.VirtualMachineInstance
func NewRandomVMIWithe1000NetworkInterface ¶ added in v0.6.1
func NewRandomVMIWithe1000NetworkInterface() *v1.VirtualMachineInstance
func NewRepeatableVirtctlCommand ¶ added in v0.4.0
func NewVirtctlCommand ¶ added in v0.4.0
func NotDeleted ¶ added in v0.5.0
func NotDeleted(vmis *v1.VirtualMachineInstanceList) (notDeleted []v1.VirtualMachineInstance)
func PanicOnError ¶
func PanicOnError(err error)
func RegistryDiskFor ¶ added in v0.3.0
func RegistryDiskFor(name RegistryDisk) string
RegistryDiskFor takes the name of an image and returns the full registry diks image path. Supported values are: cirros, fedora, alpine
func RunCommandOnVmiPod ¶ added in v0.6.3
func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
RunCommandOnVmiPod will run specified command on the virt-launcher pod
func RunKubectlCommand ¶ added in v0.4.1
func SkipIfNoKubectl ¶ added in v0.4.1
func SkipIfNoKubectl()
func SkipIfNoWindowsImage ¶ added in v0.4.1
func SkipIfNoWindowsImage(virtClient kubecli.KubevirtClient)
func StartVmOnNode ¶ added in v0.6.3
func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string)
StartVmOnNode will start a VMI on the specified node
func UnfinishedVMIPodSelector ¶ added in v0.6.1
func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
func WaitForSuccessfulVMIStart ¶ added in v0.6.1
func WaitForSuccessfulVMIStartIgnoreWarnings ¶ added in v0.6.1
func WaitForSuccessfulVMIStartWithTimeout ¶ added in v0.6.1
func WaitForVirtualMachineToDisappearWithTimeout ¶ added in v0.5.0
func WaitForVirtualMachineToDisappearWithTimeout(vmi *v1.VirtualMachineInstance, seconds int)
Types ¶
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 RegistryDisk ¶ added in v0.3.0
type RegistryDisk string
const ( RegistryDiskCirros RegistryDisk = "cirros" RegistryDiskAlpine RegistryDisk = "alpine" RegistryDiskFedora RegistryDisk = "fedora-cloud" )
type VMIExpecterFactory ¶ added in v0.6.1
type VMIExpecterFactory func(*v1.VirtualMachineInstance) (expect.Expecter, error)