testlib

package
v0.0.0-...-d674e6d Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModel = "testlib/testdata/default"

	DefaultHostId = "host-24" // Generated by vcsim

)

Variables

View Source
var (
	NodeProperties = []string{"config.extraConfig", "config.flags", "config.version", "runtime.host"}
)

Functions

func CustomizeHostVersion

func CustomizeHostVersion(hostSystemId string, version string, apiVersion string) error

func CustomizeVM

func CustomizeVM(vmClient *vim25.Client, node *v1.Node, spec *types.VirtualMachineConfigSpec) error

func DefaultNodes

func DefaultNodes() []*v1.Node

func GetVM

func GetVM(vmClient *vim25.Client, node *v1.Node) (*mo.VirtualMachine, error)

func Infrastructure

func Infrastructure(modifiers ...func(*ocpv1.Infrastructure)) *ocpv1.Infrastructure

func Node

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

func SetHardwareVersion

func SetHardwareVersion(vmClient *vim25.Client, node *v1.Node, hardwareVersion string) error

func WithProviderID

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

Types

type FakeKubeClient

type FakeKubeClient struct {
	Infrastructure *ocpv1.Infrastructure
	Nodes          []*v1.Node
	StorageClasses []*storagev1.StorageClass
	PVs            []*v1.PersistentVolume
}

func (*FakeKubeClient) GetInfrastructure

func (f *FakeKubeClient) GetInfrastructure(ctx context.Context) (*ocpv1.Infrastructure, error)

func (*FakeKubeClient) ListNodes

func (f *FakeKubeClient) ListNodes(ctx context.Context) ([]*v1.Node, error)

func (*FakeKubeClient) ListPVs

func (f *FakeKubeClient) ListPVs(ctx context.Context) ([]*v1.PersistentVolume, error)

func (*FakeKubeClient) ListStorageClasses

func (f *FakeKubeClient) ListStorageClasses(ctx context.Context) ([]*storagev1.StorageClass, error)

type SimulatedVM

type SimulatedVM struct {
	Name, UUID string
}

type TestSetup

type TestSetup struct {
	Context     context.Context
	Username    string
	VMConfig    *vsphere.VSphereConfig
	VMClient    *vim25.Client
	TagManager  *vapitags.Manager
	ClusterInfo *util.ClusterInfo
}

func SetupSimulator

func SetupSimulator(kubeClient *FakeKubeClient, modelDir string) (setup *TestSetup, cleanup func(), err error)

Jump to

Keyboard shortcuts

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