testlib

package
v0.0.0-...-c361259 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 32 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 GetDCSecret

func GetDCSecret() *v1.Secret

func GetInfraObject

func GetInfraObject() *ocpv1.Infrastructure

func GetInfraObjectWithEmptyPlatformSpec

func GetInfraObjectWithEmptyPlatformSpec() *ocpv1.Infrastructure

func GetMatchingCondition

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

func GetMultiVCSecret

func GetMultiVCSecret() *v1.Secret

func GetNewConfigMap

func GetNewConfigMap() *v1.ConfigMap

GetNewConfigMap this function generates a config map with the newer YAML provider config.

func GetSecret

func GetSecret() *v1.Secret

func GetSingleFailureDomainInfra

func GetSingleFailureDomainInfra() *ocpv1.Infrastructure

func GetTestClusterResult

func GetTestClusterResult(statusType checks.CheckStatusType) checks.ClusterCheckResult

func GetVSphereConfig

func GetVSphereConfig(fileName string) (*vclib.VSphereConfig, error)

func GetZonalInfra

func GetZonalInfra() *ocpv1.Infrastructure

func GetZonalMultiVCenterInfra

func GetZonalMultiVCenterInfra() *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, infra *ocpv1.Infrastructure) ([]*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