Documentation
¶
Index ¶
- Constants
- Variables
- func AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
- func AddCloudInitData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, ...)
- func AddConfigMapDisk(vmi *v1.VirtualMachineInstance, configMapName string)
- func AddEphemeralCdrom(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
- func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
- func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
- func AddHostDisk(vmi *v1.VirtualMachineInstance, path string, diskType v1.HostDiskType, ...)
- func AddLabelToNode(nodeName string, key string, value string)
- func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus string, claimName string) *v1.VirtualMachineInstance
- func AddSecretDisk(vmi *v1.VirtualMachineInstance, secretName string)
- func AddServiceAccountDisk(vmi *v1.VirtualMachineInstance, serviceAccountName string)
- func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)
- func AfterTestSuitCleanup()
- func AppendEmptyDisk(vmi *v1.VirtualMachineInstance, diskName, busName, diskSize string)
- func ApplyRawManifest(object unstructured.Unstructured) error
- func BeforeAll(fn func())
- func BeforeTestCleanup()
- func BeforeTestSuitSetup()
- func CheckForTextExpecter(vmi *v1.VirtualMachineInstance, expected []expect.Batcher, wait int) error
- func CleanNodes()
- func ContainerDiskFor(name ContainerDisk) string
- func CreateBlockVolumePvAndPvc(name string, size string)
- func CreateCommandWithNS(namespace string, cmdName string, args ...string) (string, *exec.Cmd, error)
- func CreateConfigMap(name string, data map[string]string)
- func CreateHostDiskImage(diskPath string) *k8sv1.Pod
- func CreateHostPathPVC(os, size string)
- func CreateHostPathPv(osName string, hostPath string)
- func CreateHostPathPvWithSize(osName string, hostPath string, size string)
- func CreateISCSIPV(name string, size string, iscsiTargetIP string, ...) *k8sv1.PersistentVolume
- func CreateISCSIPvAndPvc(name string, size string, iscsiTargetIP string, ...)
- func CreateISCSITargetPOD(containerDiskName ContainerDisk) (iscsiTargetIP string)
- func CreatePVC(os, size, storageClass string)
- func CreateSecret(name string, data map[string]string)
- func DeleteConfigMap(name string)
- func DeletePV(os string)
- func DeletePVC(os string)
- func DeletePvAndPvc(name string)
- func DeleteRawManifest(object unstructured.Unstructured) error
- func DeleteSecret(name string)
- func DeployTestingInfrastructure()
- func DoScaleDeployment(namespace string, name string, desired int32) (error, int32)
- func DoScaleVirtHandler(namespace string, name string, selector map[string]string) (int32, map[string]string, int64, error)
- func EnsureKVMPresent()
- func ExecuteCommandOnPod(virtCli kubecli.KubevirtClient, pod *k8sv1.Pod, containerName string, ...) (string, error)
- func ExecuteCommandOnPodV2(virtCli kubecli.KubevirtClient, pod *k8sv1.Pod, containerName string, ...) (stdout, stderr string, err error)
- func ForwardPorts(pod *k8sv1.Pod, ports []string, stop chan struct{}, readyTimeout time.Duration) error
- func GenerateTemplateJson(template *vmsgen.Template) (string, error)
- func GenerateVMIJson(vmi *v1.VirtualMachineInstance) (string, error)
- func GenerateVMJson(vm *v1.VirtualMachine) (string, error)
- func GetAllSchedulableNodes(virtClient kubecli.KubevirtClient) *k8sv1.NodeList
- func GetK8sCmdClient() string
- func GetListOfManifests(pathToManifestsDir string) []string
- func GetNodeCPUInfo(vmi *v1.VirtualMachineInstance) string
- func GetNodeLibvirtCapabilities(vmi *v1.VirtualMachineInstance) string
- func GetNodeWithHugepages(virtClient kubecli.KubevirtClient, hugepages k8sv1.ResourceName) *k8sv1.Node
- func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
- func GetRunningPodByLabel(label string, labelType string, namespace string) *k8sv1.Pod
- func GetRunningPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
- func GetRunningVMISpec(vmi *v1.VirtualMachineInstance) (*launcherApi.DomainSpec, error)
- func GetRunningVirtualMachineInstanceDomainXML(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (string, error)
- func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
- func HasCDI() bool
- func HasDataVolumeCRD() bool
- func HasExperimentalIgnitionSupport() bool
- func HasFeature(feature string) bool
- func HasLiveMigration() bool
- func IsOpenShift() bool
- func KubevirtFailHandler(message string, callerSkip ...int)
- func LoggedInAlpineExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
- func LoggedInCirrosExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
- func LoggedInFedoraExpecter(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 NewHelloWorldJobHttp(host string, port string) *k8sv1.Pod
- func NewHelloWorldJobUDP(host string, port string) *k8sv1.Pod
- func NewISCSIPvAndPvc(name string, size string, iscsiTargetIP string, ...)
- func NewInt32(x int32) *int32
- func NewRandomDataVolumeWithHttpImport(imageUrl string, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) *cdiv1.DataVolume
- func NewRandomFedoraVMIWitGuestAgent() *v1.VirtualMachineInstance
- func NewRandomMigration(vmiName string, namespace string) *v1.VirtualMachineInstanceMigration
- func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
- func NewRandomVMI() *v1.VirtualMachineInstance
- func NewRandomVMIWithBridgeInterfaceEphemeralDiskAndUserdata(containerImage string, userData string, Ports []v1.Port) *v1.VirtualMachineInstance
- func NewRandomVMIWithCDRom(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithConfigMap(configMapName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithCustomMacAddress() *v1.VirtualMachineInstance
- func NewRandomVMIWithDataVolume(dataVolumeName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEFIBootloader() *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 NewRandomVMIWithEphemeralDiskAndUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskHighMemory(containerImage string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithHostDisk(diskPath string, diskType v1.HostDiskType, nodeName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithNS(namespace string) *v1.VirtualMachineInstance
- func NewRandomVMIWithPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithSecret(secretName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithServiceAccount(serviceAccountName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithSlirpInterfaceEphemeralDiskAndUserdata(containerImage string, userData string, Ports []v1.Port) *v1.VirtualMachineInstance
- func NewRandomVMIWithWatchdog() *v1.VirtualMachineInstance
- func NewRandomVMIWithe1000NetworkInterface() *v1.VirtualMachineInstance
- func NewRandomVMWithDataVolume(imageUrl string, namespace string) *v1.VirtualMachine
- func NewRandomVirtualMachine(vmi *v1.VirtualMachineInstance, running bool) *v1.VirtualMachine
- 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 ReadManifestYamlFile(pathToManifest string) []unstructured.Unstructured
- func RemoveHostDiskImage(diskPath string, nodeName string)
- func RemoveLabelFromNode(nodeName string, key string)
- func RenderHostPathJob(jobName string, dir string, hostPathType k8sv1.HostPathType, ...) *k8sv1.Pod
- func RenderJob(name string, cmd []string, args []string) *k8sv1.Pod
- func RunCommand(cmdName string, args ...string) (string, string, error)
- func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
- func RunCommandPipe(commands ...[]string) (string, string, error)
- func RunCommandPipeWithNS(namespace string, commands ...[]string) (string, string, error)
- func RunCommandWithNS(namespace string, cmdName string, args ...string) (string, string, error)
- func RunVMI(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectLaunch(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectScheduling(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func SkipIfNoCmd(cmdName string)
- func SkipIfNoRhelImage(virtClient kubecli.KubevirtClient)
- func SkipIfNoSriovDevicePlugin(virtClient kubecli.KubevirtClient)
- func SkipIfNoWindowsImage(virtClient kubecli.KubevirtClient)
- func SkipIfNotUseNetworkPolicy(virtClient kubecli.KubevirtClient)
- func SkipIfOpenShift(message string)
- func SkipIfUseFlannel(virtClient kubecli.KubevirtClient)
- func SkipIfVersionBelow(message string, expectedVersion string)
- func StartHTTPServer(vmi *v1.VirtualMachineInstance, port int)
- func StartTCPServer(vmi *v1.VirtualMachineInstance, port int)
- func StartVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
- func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string)
- func StopVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
- func Taint(nodeName string, key string, effect k8sv1.TaintEffect)
- func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
- func WaitForAllPodsReady(timeout time.Duration, listOptions metav1.ListOptions)
- func WaitForMigrationToDisappearWithTimeout(migration *v1.VirtualMachineInstanceMigration, seconds int)
- func WaitForSuccessfulDataVolumeImport(obj runtime.Object, seconds int)
- 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)
- func WaitUntilVMIReady(vmi *v1.VirtualMachineInstance, expecterFactory VMIExpecterFactory) *v1.VirtualMachineInstance
- func WaitUntilVMIReadyWithNamespace(namespace string, vmi *v1.VirtualMachineInstance, ...) *v1.VirtualMachineInstance
- func WipeTestingInfrastructure()
- type ContainerDisk
- type EventType
- type KubeVirtTestsConfiguration
- 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(stopChan chan struct{}, eventType EventType, reason interface{}) (e *k8sv1.Event)
- func (w *ObjectEventWatcher) WaitNotFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *k8sv1.Event)
- func (w *ObjectEventWatcher) Watch(abortChan chan struct{}, processFunc ProcessFunc)
- type ProcessFunc
- type VMIExpecterFactory
Constants ¶
const ( AlpineHttpUrl = "http://cdi-http-import-server.kubevirt/images/alpine.iso" GuestAgentHttpUrl = "http://cdi-http-import-server.kubevirt/qemu-ga" StressHttpUrl = "http://cdi-http-import-server.kubevirt/stress" )
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 ( HostPathBase = "/tmp/hostImages/" HostPathAlpine = HostPathBase + "alpine" HostPathCustom = HostPathBase + "custom" )
const ( DiskAlpineHostPath = "disk-alpine-host-path" DiskWindows = "disk-windows" DiskRhel = "disk-rhel" DiskCustomHostPath = "disk-custom-host-path" )
const (
CustomHostPath = "custom-host-path"
)
const (
DefaultConfigFile string = "tests/default-config.json"
)
const (
SecretLabel = "kubevirt.io/secret"
)
const SubresourceTestLabel = "subresource-access-test-pod"
const TempDirPrefix = "kubevirt-test"
const VMIResource = "virtualmachineinstances"
Variables ¶
var ConfigFile = ""
var ContainerizedDataImporterNamespace = "cdi"
var DeployTestingInfrastructureFlag = false
var KubeVirtInstallNamespace string
var KubeVirtKubectlPath = ""
var KubeVirtOcPath = ""
var KubeVirtRepoPrefix = "kubevirt"
var KubeVirtVersionTag = "latest"
var KubeVirtVersionTagAlt = ""
var KubeVirtVirtctlPath = ""
var PathToTestingInfrastrucureManifests = ""
Functions ¶
func AddBootOrderToDisk ¶ added in v0.6.0
func AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
func AddCloudInitData ¶ added in v0.14.0
func AddCloudInitData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, b64encode bool)
func AddConfigMapDisk ¶ added in v0.9.0
func AddConfigMapDisk(vmi *v1.VirtualMachineInstance, configMapName string)
func AddEphemeralCdrom ¶ added in v0.12.0
func AddEphemeralCdrom(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
func AddEphemeralDisk ¶ added in v0.3.0
func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus string, image string) *v1.VirtualMachineInstance
func AddExplicitPodNetworkInterface ¶ added in v0.7.0
func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
func AddHostDisk ¶ added in v0.9.4
func AddHostDisk(vmi *v1.VirtualMachineInstance, path string, diskType v1.HostDiskType, name string)
func AddLabelToNode ¶ added in v0.16.0
func AddPVCDisk ¶ added in v0.5.0
func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus string, claimName string) *v1.VirtualMachineInstance
func AddSecretDisk ¶ added in v0.9.0
func AddSecretDisk(vmi *v1.VirtualMachineInstance, secretName string)
func AddServiceAccountDisk ¶ added in v0.9.2
func AddServiceAccountDisk(vmi *v1.VirtualMachineInstance, serviceAccountName string)
func AddUserData ¶ added in v0.9.0
func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)
func AfterTestSuitCleanup ¶
func AfterTestSuitCleanup()
func AppendEmptyDisk ¶ added in v0.16.0
func AppendEmptyDisk(vmi *v1.VirtualMachineInstance, diskName, busName, diskSize string)
func ApplyRawManifest ¶ added in v0.12.0
func ApplyRawManifest(object unstructured.Unstructured) error
func BeforeTestCleanup ¶
func BeforeTestCleanup()
func BeforeTestSuitSetup ¶
func BeforeTestSuitSetup()
func CheckForTextExpecter ¶ added in v0.6.0
func CleanNodes ¶ added in v0.16.0
func CleanNodes()
func ContainerDiskFor ¶ added in v0.11.0
func ContainerDiskFor(name ContainerDisk) string
ContainerDiskFor takes the name of an image and returns the full registry diks image path. Supported values are: cirros, fedora, alpine, guest-agent
func CreateBlockVolumePvAndPvc ¶ added in v0.9.2
func CreateCommandWithNS ¶ added in v0.9.5
func CreateConfigMap ¶ added in v0.9.0
func CreateHostDiskImage ¶ added in v0.9.0
func CreateHostPathPVC ¶ added in v0.11.0
func CreateHostPathPVC(os, size string)
func CreateHostPathPv ¶ added in v0.6.1
func CreateHostPathPvWithSize ¶ added in v0.9.6
func CreateISCSIPV ¶ added in v0.16.1
func CreateISCSIPV(name string, size string, iscsiTargetIP string, accessMode k8sv1.PersistentVolumeAccessMode, volumeMode k8sv1.PersistentVolumeMode) *k8sv1.PersistentVolume
func CreateISCSIPvAndPvc ¶ added in v0.12.0
func CreateISCSIPvAndPvc(name string, size string, iscsiTargetIP string, volumeMode k8sv1.PersistentVolumeMode)
func CreateISCSITargetPOD ¶ added in v0.12.0
func CreateISCSITargetPOD(containerDiskName ContainerDisk) (iscsiTargetIP string)
func CreateSecret ¶ added in v0.9.0
func DeleteConfigMap ¶ added in v0.9.0
func DeleteConfigMap(name string)
func DeletePvAndPvc ¶ added in v0.9.2
func DeletePvAndPvc(name string)
func DeleteRawManifest ¶ added in v0.12.0
func DeleteRawManifest(object unstructured.Unstructured) error
func DeleteSecret ¶ added in v0.9.0
func DeleteSecret(name string)
func DeployTestingInfrastructure ¶ added in v0.12.0
func DeployTestingInfrastructure()
func DoScaleDeployment ¶ added in v0.12.0
Do scale and retuns error, replicas-before.
func DoScaleVirtHandler ¶ added in v0.12.0
func EnsureKVMPresent ¶ added in v0.7.0
func EnsureKVMPresent()
func ExecuteCommandOnPod ¶ added in v0.4.1
func ExecuteCommandOnPodV2 ¶ added in v0.9.0
func ForwardPorts ¶ added in v0.17.0
func GenerateTemplateJson ¶ added in v0.7.0
func GenerateVMIJson ¶ added in v0.6.1
func GenerateVMIJson(vmi *v1.VirtualMachineInstance) (string, error)
func GenerateVMJson ¶ added in v0.17.0
func GenerateVMJson(vm *v1.VirtualMachine) (string, error)
func GetAllSchedulableNodes ¶ added in v0.9.0
func GetAllSchedulableNodes(virtClient kubecli.KubevirtClient) *k8sv1.NodeList
func GetK8sCmdClient ¶ added in v0.17.0
func GetK8sCmdClient() string
func GetListOfManifests ¶ added in v0.12.0
func GetNodeCPUInfo ¶ added in v0.6.3
func GetNodeCPUInfo(vmi *v1.VirtualMachineInstance) string
GetNodeCPUInfo returns output of lscpu on the pod that runs on the specified node
func GetNodeLibvirtCapabilities ¶ added in v0.6.2
func GetNodeLibvirtCapabilities(vmi *v1.VirtualMachineInstance) string
GetNodeLibvirtCapabilities returns node libvirt capabilities
func GetNodeWithHugepages ¶ added in v0.6.1
func GetNodeWithHugepages(virtClient kubecli.KubevirtClient, hugepages k8sv1.ResourceName) *k8sv1.Node
func GetPodByVirtualMachineInstance ¶ added in v0.17.0
func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
func GetRunningPodByLabel ¶ added in v0.3.0
func GetRunningPodByVirtualMachineInstance ¶ added in v0.8.0
func GetRunningPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
func GetRunningVMISpec ¶ added in v0.17.0
func GetRunningVMISpec(vmi *v1.VirtualMachineInstance) (*launcherApi.DomainSpec, error)
func GetRunningVirtualMachineInstanceDomainXML ¶ added in v0.9.2
func GetRunningVirtualMachineInstanceDomainXML(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (string, error)
func GetVmPodName ¶ added in v0.15.0
func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
func HasDataVolumeCRD ¶ added in v0.17.0
func HasDataVolumeCRD() bool
func HasExperimentalIgnitionSupport ¶ added in v0.17.3
func HasExperimentalIgnitionSupport() bool
func HasFeature ¶ added in v0.16.0
func HasLiveMigration ¶ added in v0.16.0
func HasLiveMigration() bool
func IsOpenShift ¶ added in v0.12.0
func IsOpenShift() bool
func KubevirtFailHandler ¶ added in v0.8.0
KubevirtFailHandler call ginkgo.Fail with printing the additional information
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 LoggedInFedoraExpecter ¶ added in v0.10.0
func LoggedInFedoraExpecter(vmi *v1.VirtualMachineInstance) (expect.Expecter, error)
LoggedInFedoraExpecter return prepared and ready to use console expecter for Fedora test VM
func NewConsoleExpecter ¶ added in v0.0.4
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 NewHelloWorldJobHttp ¶ added in v0.15.0
NewHelloWorldJobHttp gets an IP address and a port, which it uses to create a pod. This pod tries to contact the host on the provided port, over HTTP. On success - it expects to receive "Hello World!".
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 NewISCSIPvAndPvc ¶ added in v0.15.0
func NewISCSIPvAndPvc(name string, size string, iscsiTargetIP string, accessMode k8sv1.PersistentVolumeAccessMode, volumeMode k8sv1.PersistentVolumeMode)
func NewRandomDataVolumeWithHttpImport ¶ added in v0.8.0
func NewRandomDataVolumeWithHttpImport(imageUrl string, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) *cdiv1.DataVolume
func NewRandomFedoraVMIWitGuestAgent ¶ added in v0.16.1
func NewRandomFedoraVMIWitGuestAgent() *v1.VirtualMachineInstance
func NewRandomMigration ¶ added in v0.9.2
func NewRandomMigration(vmiName string, namespace string) *v1.VirtualMachineInstanceMigration
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 NewRandomVMIWithCDRom ¶ added in v0.6.1
func NewRandomVMIWithCDRom(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithConfigMap ¶ added in v0.9.0
func NewRandomVMIWithConfigMap(configMapName string) *v1.VirtualMachineInstance
func NewRandomVMIWithCustomMacAddress ¶ added in v0.6.4
func NewRandomVMIWithCustomMacAddress() *v1.VirtualMachineInstance
func NewRandomVMIWithDataVolume ¶ added in v0.8.0
func NewRandomVMIWithDataVolume(dataVolumeName string) *v1.VirtualMachineInstance
func NewRandomVMIWithEFIBootloader ¶ added in v0.14.0
func NewRandomVMIWithEFIBootloader() *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 NewRandomVMIWithEphemeralDiskAndUserdataNetworkData ¶ added in v0.14.0
func NewRandomVMIWithEphemeralDiskAndUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *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 NewRandomVMIWithHostDisk ¶ added in v0.9.0
func NewRandomVMIWithHostDisk(diskPath string, diskType v1.HostDiskType, nodeName 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 NewRandomVMIWithSecret ¶ added in v0.9.0
func NewRandomVMIWithSecret(secretName string) *v1.VirtualMachineInstance
func NewRandomVMIWithServiceAccount ¶ added in v0.9.2
func NewRandomVMIWithServiceAccount(serviceAccountName string) *v1.VirtualMachineInstance
func NewRandomVMIWithSlirpInterfaceEphemeralDiskAndUserdata ¶ added in v0.7.0
func NewRandomVMIWithWatchdog ¶ added in v0.6.1
func NewRandomVMIWithWatchdog() *v1.VirtualMachineInstance
func NewRandomVMIWithe1000NetworkInterface ¶ added in v0.6.1
func NewRandomVMIWithe1000NetworkInterface() *v1.VirtualMachineInstance
func NewRandomVMWithDataVolume ¶ added in v0.8.0
func NewRandomVMWithDataVolume(imageUrl string, namespace string) *v1.VirtualMachine
func NewRandomVirtualMachine ¶ added in v0.8.0
func NewRandomVirtualMachine(vmi *v1.VirtualMachineInstance, running bool) *v1.VirtualMachine
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 ReadManifestYamlFile ¶ added in v0.12.0
func ReadManifestYamlFile(pathToManifest string) []unstructured.Unstructured
func RemoveHostDiskImage ¶ added in v0.9.0
func RemoveLabelFromNode ¶ added in v0.16.0
func RenderHostPathJob ¶ added in v0.9.6
func RenderHostPathJob(jobName string, dir string, hostPathType k8sv1.HostPathType, mountPropagation k8sv1.MountPropagationMode, cmd []string, args []string) *k8sv1.Pod
func RunCommand ¶ added in v0.8.0
func RunCommandOnVmiPod ¶ added in v0.6.3
func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
RunCommandOnVmiPod runs specified command on the virt-launcher pod
func RunCommandPipe ¶ added in v0.9.2
func RunCommandPipeWithNS ¶ added in v0.9.2
func RunCommandWithNS ¶ added in v0.9.2
func RunVMI ¶ added in v0.9.0
func RunVMI(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectLaunch ¶ added in v0.9.0
func RunVMIAndExpectLaunch(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectScheduling ¶ added in v0.17.0
func RunVMIAndExpectScheduling(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func SkipIfNoCmd ¶ added in v0.8.0
func SkipIfNoCmd(cmdName string)
func SkipIfNoRhelImage ¶ added in v0.9.0
func SkipIfNoRhelImage(virtClient kubecli.KubevirtClient)
func SkipIfNoSriovDevicePlugin ¶ added in v0.11.0
func SkipIfNoSriovDevicePlugin(virtClient kubecli.KubevirtClient)
func SkipIfNoWindowsImage ¶ added in v0.4.1
func SkipIfNoWindowsImage(virtClient kubecli.KubevirtClient)
func SkipIfNotUseNetworkPolicy ¶ added in v0.9.0
func SkipIfNotUseNetworkPolicy(virtClient kubecli.KubevirtClient)
func SkipIfOpenShift ¶ added in v0.8.0
func SkipIfOpenShift(message string)
func SkipIfUseFlannel ¶ added in v0.9.0
func SkipIfUseFlannel(virtClient kubecli.KubevirtClient)
func SkipIfVersionBelow ¶ added in v0.7.0
SkipIfVersionBelow will skip tests if it runs on an environment with k8s version below specified
func StartHTTPServer ¶ added in v0.11.0
func StartHTTPServer(vmi *v1.VirtualMachineInstance, port int)
func StartTCPServer ¶ added in v0.11.0
func StartTCPServer(vmi *v1.VirtualMachineInstance, port int)
func StartVirtualMachine ¶ added in v0.8.0
func StartVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
func StartVmOnNode ¶ added in v0.6.3
func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string)
StartVmOnNode starts a VMI on the specified node
func StopVirtualMachine ¶ added in v0.8.0
func StopVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
func UnfinishedVMIPodSelector ¶ added in v0.6.1
func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
func WaitForAllPodsReady ¶ added in v0.12.0
func WaitForAllPodsReady(timeout time.Duration, listOptions metav1.ListOptions)
func WaitForMigrationToDisappearWithTimeout ¶ added in v0.16.0
func WaitForMigrationToDisappearWithTimeout(migration *v1.VirtualMachineInstanceMigration, seconds int)
func WaitForSuccessfulDataVolumeImport ¶ added in v0.12.0
Block until DataVolume succeeds.
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)
func WaitUntilVMIReady ¶ added in v0.8.0
func WaitUntilVMIReady(vmi *v1.VirtualMachineInstance, expecterFactory VMIExpecterFactory) *v1.VirtualMachineInstance
func WaitUntilVMIReadyWithNamespace ¶ added in v0.8.0
func WaitUntilVMIReadyWithNamespace(namespace string, vmi *v1.VirtualMachineInstance, expecterFactory VMIExpecterFactory) *v1.VirtualMachineInstance
func WipeTestingInfrastructure ¶ added in v0.12.0
func WipeTestingInfrastructure()
Types ¶
type ContainerDisk ¶ added in v0.11.0
type ContainerDisk string
const ( ContainerDiskCirros ContainerDisk = "cirros" ContainerDiskAlpine ContainerDisk = "alpine" ContainerDiskFedora ContainerDisk = "fedora-cloud" ContainerDiskVirtio ContainerDisk = "virtio-container-disk" ContainerDiskEmpty ContainerDisk = "empty" )
type KubeVirtTestsConfiguration ¶ added in v0.16.0
type KubeVirtTestsConfiguration struct { // StorageClass to use to create local PVCs StorageClassLocal string `json:"storageClassLocal"` // StorageClass to use to create host-path PVCs StorageClassHostPath string `json:"storageClassHostPath"` // StorageClass to use to create block-volume PVCs StorageClassBlockVolume string `json:"storageClassBlockVolume"` // StorageClass to use to create rhel PVCs StorageClassRhel string `json:"storageClassRhel"` // StorageClass to use to create windows PVCs StorageClassWindows string `json:"storageClassWindows"` }
KubeVirtTestsConfiguration contains the configuration for KubeVirt tests
var Config *KubeVirtTestsConfiguration
func NewKubeVirtTestsConfiguration ¶ added in v0.16.0
func NewKubeVirtTestsConfiguration() *KubeVirtTestsConfiguration
Returns a new KubeVirtTestsConfiguration with default values
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(stopChan chan struct{}, eventType EventType, reason interface{}) (e *k8sv1.Event)
func (*ObjectEventWatcher) WaitNotFor ¶ added in v0.11.0
func (w *ObjectEventWatcher) WaitNotFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *k8sv1.Event)
func (*ObjectEventWatcher) Watch ¶
func (w *ObjectEventWatcher) Watch(abortChan chan struct{}, processFunc ProcessFunc)
type ProcessFunc ¶
type VMIExpecterFactory ¶ added in v0.6.1
type VMIExpecterFactory func(*v1.VirtualMachineInstance) (expect.Expecter, error)