testlib

package
v0.0.0-...-f06192f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModel  = "testlib/testdata/default"
	DefaultVMPath = "/DC0/vm/"
)

Variables

View Source
var (
	// Virtual machines generated by vSphere simulator. UUIDs look generated, but they're stable.
	DefaultVMs = []simulatedVM{
		{"DC0_H0_VM0", "265104de-1472-547c-b873-6dc7883fb6cb"},
		{"DC0_H0_VM1", "39365506-5a0a-5fd0-be10-9586ad53aaad"},
	}
	DefaultHostId = "host-24" // Generated by vcsim
)

Functions

func AddClusterCSIDriverClient

func AddClusterCSIDriverClient(apiClient *utils.APIClient, obj *opv1.ClusterCSIDriver) *utils.APIClient

func AddInitialObjects

func AddInitialObjects(objects []runtime.Object, clients *utils.APIClient) error

func ConnectToSimulator

func ConnectToSimulator(s *simulator.Server) (*govmomi.Client, error)

func CustomizeHostVersion

func CustomizeHostVersion(hostSystemId string, version string) error

func CustomizeVCenterVersion

func CustomizeVCenterVersion(version string, apiVersion string, conn *vclib.VSphereConnection)

func CustomizeVM

func CustomizeVM(conn *vclib.VSphereConnection, node *v1.Node, spec *types.VirtualMachineConfigSpec) error

func DefaultNodes

func DefaultNodes() []*v1.Node

func GetCSIDriver

func GetCSIDriver(withOCPAnnotation bool) *storagev1.CSIDriver

func GetCSINode

func GetCSINode() *storagev1.CSINode

func GetClusterCSIDriver

func GetClusterCSIDriver(hasTopology bool) *opv1.ClusterCSIDriver

func GetConfigMap

func GetConfigMap() *v1.ConfigMap

func GetInfraObject

func GetInfraObject() *ocpv1.Infrastructure

func GetLegacyVSphereConfig

func GetLegacyVSphereConfig(fileName string) (vsphere.VSphereConfig, error)

func GetMatchingCondition

func GetMatchingCondition(status []opv1.OperatorCondition, conditionType string) *opv1.OperatorCondition

func GetSecret

func GetSecret() *v1.Secret

func GetSingleFailureDomainInfra

func GetSingleFailureDomainInfra() *ocpv1.Infrastructure

func GetTestClusterResult

func GetTestClusterResult(statusType checks.CheckStatusType) checks.ClusterCheckResult

func GetZonalInfra

func GetZonalInfra() *ocpv1.Infrastructure

func NewFakeClients

func NewFakeClients(coreObjects []runtime.Object, operatorObject *FakeDriverInstance, configObject runtime.Object) *utils.APIClient

func Node

func Node(name string, modifiers ...func(*v1.Node)) *v1.Node

func ReadFile

func ReadFile(name string) ([]byte, error)

ReadFile reads and returns the content of the named file.

func SetHWVersion

func SetHWVersion(conn *vclib.VSphereConnection, node *v1.Node, hardwareVersion string) error

func SetupSimulator

func SetupSimulator(modelDir string) (*vclib.VSphereConnection, func(), error)

func StartFakeInformer

func StartFakeInformer(clients *utils.APIClient, stopCh <-chan struct{})

func WaitForSync

func WaitForSync(clients *utils.APIClient, stopCh <-chan struct{})

func WithProviderID

func WithProviderID(id string) func(*v1.Node)

Types

type FakeDriverInstance

type FakeDriverInstance struct {
	metav1.ObjectMeta
	Spec   opv1.OperatorSpec
	Status opv1.OperatorStatus
}

fakeInstance is a fake CSI driver instance that also fullfils the OperatorClient interface

func MakeFakeDriverInstance

func MakeFakeDriverInstance(modifiers ...driverModifier) *FakeDriverInstance

Jump to

Keyboard shortcuts

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