framework

package
v0.0.0-...-ad62b84 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubeClientFromRESTConfig

func GetKubeClientFromRESTConfig(config *rest.Config) (*kubernetes.Clientset, error)

GetKubeClientFromRESTConfig provides a function to get a K8s client using the REST config

Types

type Framework

type Framework struct {
	// NsPrefix is a prefix for generated namespace
	NsPrefix string
	//  k8sClient provides our k8s client pointer
	K8sClient *kubernetes.Clientset
	//SampleConfigCLient provides SampleConfig client  pointer
	SampleConfigCLient *versioned.Clientset
	// RestConfig provides a pointer to our REST client config.
	RestConfig *rest.Config

	// KubectlPath is a test run-time flag so we can find kubectl
	KubectlPath string
	// KubeConfig is a test run-time flag to store the location of our test setup kubeconfig
	KubeConfig string
	// Master is a test run-time flag to store the id of our master node
	Master string
	// OperatorInstallNamespace namespace where KubeVirt is installed
	OperatorInstallNamespace string
}

Framework supports common operations used by functional/e2e tests. This package is based on https://kubevirt.io/containerized-data-importer/blob/master/tests/framework/framework.go

func NewFramework

func NewFramework(prefix string) (*Framework, error)

NewFramework makes a new framework and sets up the global BeforeEach/AfterEach's. Test run-time flags are parsed and added to the Framework struct.

func NewFrameworkOrDie

func NewFrameworkOrDie(prefix string) *Framework

NewFrameworkOrDie calls NewFramework and handles errors by calling Fail. Config is optional, but if passed there can only be one.

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach provides a set of operations to run after each test

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

BeforeEach provides a set of operations to run before each test

func (*Framework) CleanUp

func (f *Framework) CleanUp()

CleanUp provides a set of operations clean the namespace

func (*Framework) EnsureSampleConfig

func (f *Framework) EnsureSampleConfig(configName string) (*v1alpha1.SampleConfig, error)

EnsureSampleConfig creates Sample Config if it does not exist

func (*Framework) GetKubeClient

func (f *Framework) GetKubeClient() (*kubernetes.Clientset, error)

GetKubeClient returns a Kubernetes rest client

func (*Framework) GetSampleConfig

func (f *Framework) GetSampleConfig(configName string) (*v1alpha1.SampleConfig, error)

GetSampleConfig retrieves SampleConfig instance

func (*Framework) GetSampleConfigClient

func (f *Framework) GetSampleConfigClient() (*versioned.Clientset, error)

GetSampleConfigClient gets an instance of a Sample Config client

func (*Framework) GetSampleConfigPhase

func (f *Framework) GetSampleConfigPhase(configName string) (sdkapi.Phase, error)

GetSampleConfigPhase returns phase of the SampleConfig

func (*Framework) LoadConfig

func (f *Framework) LoadConfig() (*rest.Config, error)

LoadConfig loads our specified kubeconfig

func (*Framework) RunKubectlCommand

func (f *Framework) RunKubectlCommand(args ...string) (string, error)

RunKubectlCommand ...

Jump to

Keyboard shortcuts

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