framework

package
v0.0.0-...-efd2147 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceBasePrefix = "virtualization-e2e"
	NamespaceLabel      = "virtualization-e2e"
)
View Source
const (
	ShortTimeout  = 30 * time.Second
	MiddleTimeout = 60 * time.Second
	LongTimeout   = 300 * time.Second
	MaxTimeout    = 600 * time.Second
)
View Source
const ContinueOnFailureEnv = "CONTINUE_ON_FAILURE"

Variables

This section is empty.

Functions

func CommonE2ETestDecorators

func CommonE2ETestDecorators() []interface{}

CommonE2ETestDecorators returns common decorators for e2e tests: Ordered and ContinueOnFailure switchable with env.

func DecoratorsFromEnv

func DecoratorsFromEnv(decorators ...interface{}) []interface{}

func FailureBehaviourEnvSwitcherDecorator

func FailureBehaviourEnvSwitcherDecorator() []interface{}

func GetConfig

func GetConfig() *config.Config

func SIG

func SIG(identifier, text string, args ...interface{}) (extendedText string, newArgs []interface{})

func SIGDescribe

func SIGDescribe(identifier, text string, args ...interface{}) bool

func SetConfig

func SetConfig(c *config.Config)

SetConfig sets the config. this needs because we have some legacy, config mutating in the main test suite should be refactored in the future

func WithSSHPrivateKey

func WithSSHPrivateKey(privateKey string) func(o *sshCommandOptions)

func WithSSHTimeout

func WithSSHTimeout(timeout time.Duration) func(o *sshCommandOptions)

func WithSSHUser

func WithSSHUser(user string) func(o *sshCommandOptions)

Types

type Clients

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

func GetClients

func GetClients() Clients

func (Clients) D8Virtualization

func (c Clients) D8Virtualization() d8.D8Virtualization

func (Clients) DynamicClient

func (c Clients) DynamicClient() dynamic.Interface

func (Clients) GenericClient

func (c Clients) GenericClient() client.Client

func (Clients) Git

func (c Clients) Git() gt.Git

func (Clients) KubeClient

func (c Clients) KubeClient() kubernetes.Interface

func (Clients) Kubectl

func (c Clients) Kubectl() kubectl.Kubectl

func (Clients) VirtClient

func (c Clients) VirtClient() kubeclient.Client

type Dvcr

type Dvcr struct {
	Storage Storage `json:"storage"`
}

type EnvSwitchable

type EnvSwitchable interface {
	Decorator() interface{}
}

type FailureBehaviourEnvSwitcher

type FailureBehaviourEnvSwitcher struct{}

func (FailureBehaviourEnvSwitcher) Decorator

func (f FailureBehaviourEnvSwitcher) Decorator() interface{}

func (FailureBehaviourEnvSwitcher) IsContinueOnFailure

func (f FailureBehaviourEnvSwitcher) IsContinueOnFailure() bool

IsContinueOnFailure returns true if Continue on error is enabled.

type Framework

type Framework struct {
	Clients
	// contains filtered or unexported fields
}

func NewFramework

func NewFramework(namespacePrefix string) *Framework

func (*Framework) After

func (f *Framework) After()

func (*Framework) AfterAll

func (f *Framework) AfterAll()

func (*Framework) AfterEach

func (f *Framework) AfterEach()

func (*Framework) BatchCreate

func (f *Framework) BatchCreate(ctx context.Context, objs ...client.Object) error

func (*Framework) Before

func (f *Framework) Before()

func (*Framework) BeforeAll

func (f *Framework) BeforeAll()

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace(prefix string, labels map[string]string) (*corev1.Namespace, error)

func (*Framework) DeferDelete

func (f *Framework) DeferDelete(objs ...client.Object)

func (*Framework) DeferNamespaceDelete

func (f *Framework) DeferNamespaceDelete(name string)

func (*Framework) GetModuleConfig

func (f *Framework) GetModuleConfig(name string) (*dv1alpha1.ModuleConfig, error)

func (*Framework) GetNamePrefix

func (f *Framework) GetNamePrefix(storageClass *storagev1.StorageClass) (string, error)

func (*Framework) GetVirtualizationModuleConfig

func (f *Framework) GetVirtualizationModuleConfig() (*VirtualizationModuleConfig, error)

func (*Framework) Namespace

func (f *Framework) Namespace() *corev1.Namespace

func (*Framework) SSHCommand

func (f *Framework) SSHCommand(vmName, vmNamespace, command string, options ...SSHCommandOption) error

type SSHCommandOption

type SSHCommandOption func(o *sshCommandOptions)

type Storage

type Storage struct {
	PersistentVolumeClaim map[string]string `json:"persistentVolumeClaim"`
	Type                  string            `json:"type"`
}

type VirtualizationModuleConfig

type VirtualizationModuleConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec VirtualizationModuleConfigSpec `json:"spec"`
}

type VirtualizationModuleConfigSettings

type VirtualizationModuleConfigSettings struct {
	Loglevel            string   `json:"logLevel,omitempty"`
	VirtualMachineCIDRs []string `json:"virtualMachineCIDRs"`
	Dvcr                Dvcr     `json:"dvcr"`
	HighAvailability    bool     `json:"highAvailability,omitempty"`
}

type VirtualizationModuleConfigSpec

type VirtualizationModuleConfigSpec struct {
	Enabled  bool                               `json:"enabled"`
	Settings VirtualizationModuleConfigSettings `json:"settings"`
	Version  int                                `json:"version"`
}

Jump to

Keyboard shortcuts

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