framework

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceTestDefault  = "kubevirt-test-default"
	NamespaceTestTemplate = "openshift"
	UsernameTestUser      = "kubevirt-test-user"
	UsernameAdminUser     = "test_admin"
	PasswordAdminUser     = "123456"

	CDI_LABEL_KEY      = "app"
	CDI_LABEL_VALUE    = "containerized-data-importer"
	CDI_LABEL_SELECTOR = CDI_LABEL_KEY + "=" + CDI_LABEL_VALUE

	ShortTimeout = time.Duration(2) * time.Minute
	LongTimeout  = time.Duration(4) * time.Minute
)

Variables

This section is empty.

Functions

func CollectObjDesc

func CollectObjDesc(dest string, objTypes ...string) error

func CollectObjDescUsingTestDesc

func CollectObjDescUsingTestDesc(td GinkgoTestDescription) error

func CreateNamespaceWithParameter

func CreateNamespaceWithParameter(namespace string) error

func CreateResourceWithFilePath added in v0.12.4

func CreateResourceWithFilePath(filePath string)

func CreateResourceWithFilePathTestNamespace

func CreateResourceWithFilePathTestNamespace(filePath string)

func CreateServiceAccount

func CreateServiceAccount(saName string)

func CreateUserWithParameter

func CreateUserWithParameter(username string) error

func DeleteResourceByName added in v0.12.4

func DeleteResourceByName(resourceType, nameSpace, resourceName string)

func DeleteResourceWithLabelTestNamespace

func DeleteResourceWithLabelTestNamespace(resourceType, resourceLabel string)

func DeleteServiceAccount

func DeleteServiceAccount(saName string)

func DeleteUserWithParameter

func DeleteUserWithParameter(username string) error

func DescribeObject

func DescribeObject(name string, namespace string) (string, error)

func DescribeObjects

func DescribeObjects(namespace string, names []string) (map[string]string, error)

func DumpObjects

func DumpObjects(namespace string, objTypes []string, dest string) error

func DumpObjectsByType

func DumpObjectsByType(namespace string, objType string, dest string) error

func EncodePrivateKeyToPEM

func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte

encodePrivateKeyToPEM encodes Private Key from RSA to PEM format

func GeneratePrivateKey

func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)

generatePrivateKey creates a RSA Private Key of specified byte size

func GeneratePublicKey

func GeneratePublicKey(privatekey *rsa.PublicKey) ([]byte, error)

Will returns in the format "ssh-rsa ..."

func GetAvailableResources added in v0.12.4

func GetAvailableResources(virtClient kubecli.KubevirtClient, cpuNeeded int64, memNeeded int64) (int, int)

func GetNamespaces

func GetNamespaces() ([]string, error)

func GetObjects

func GetObjects(namespace string, objType string) ([]string, error)

func IsEnoughResources added in v0.12.4

func IsEnoughResources(virtClient kubecli.KubevirtClient, cpuNeeded int, memNeeded int64) (bool, int)

Checking if the cluster can run at least one VM

func LoggedInFedoraExpecter

func LoggedInFedoraExpecter(vmiName string, vmiNamespace string, timeout int64, vmNameInPromt bool) (expect.Expecter, error)

func OpenConsole

func OpenConsole(virtCli kubecli.KubevirtClient, vmiName string, vmiNamespace string, timeout time.Duration, consoleType string, opts ...expect.Option) (expect.Expecter, <-chan error, error)

func ProcessTemplateWithParameters

func ProcessTemplateWithParameters(srcFilePath, dstFilePath string, params ...string) string

func RemoveDataVolume added in v0.11.0

func RemoveDataVolume(dvName string, namespace string)

func RemoveNamespaceWithParameter

func RemoveNamespaceWithParameter(namespace string) error

func RunOcDescribeCommand

func RunOcDescribeCommand(resourceType, resourceName string) string

func VNCConnection

func VNCConnection(namespace, vmname string) (string, error)

func WaitUntilResourceReadyByLabelTestNamespace

func WaitUntilResourceReadyByLabelTestNamespace(resourceType, label, query, expectOut string)

func WaitUntilResourceReadyByName added in v0.12.4

func WaitUntilResourceReadyByName(resourceType, resourceName, nameSpace, query, expectOut string)

func WaitUntilResourceReadyByNameTestNamespace

func WaitUntilResourceReadyByNameTestNamespace(resourceType, resourceName, query, expectOut string)

Types

type Result

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

type User

type User struct {
	Name     string
	Password string
}

func (*User) Login

func (u *User) Login() error

type VirtualMachine

type VirtualMachine struct {
	Name              string
	Type              string
	UID               string
	Manifest          string
	TemplateInCluster string
	TemplateFromFile  string
	TemplateParams    []string
	Namespace         string
}

VirtualMachine can be a vm, vmi, vmirs, vmiPreset.

func (VirtualMachine) Create

func (vm VirtualMachine) Create() (string, string, error)

func (VirtualMachine) Delete

func (vm VirtualMachine) Delete() (string, string, error)

func (VirtualMachine) GetVMInfo

func (vm VirtualMachine) GetVMInfo(spec string) (string, string, error)

func (VirtualMachine) GetVMUID

func (vm VirtualMachine) GetVMUID() (string, error)

func (VirtualMachine) IsRunning

func (vm VirtualMachine) IsRunning() (bool, error)

func (VirtualMachine) ProcessTemplate

func (vm VirtualMachine) ProcessTemplate() (string, error)

func (VirtualMachine) Start

func (vm VirtualMachine) Start() (string, string, error)

func (VirtualMachine) Stop

func (vm VirtualMachine) Stop() (string, string, error)

Jump to

Keyboard shortcuts

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