e2e

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

README

Testing

This document is to help developers understand how to test CAPV.

e2e

This section illustrates how to do end-to-end (e2e) testing with CAPV.

Requirements

In order to run the e2e tests the following requirements must be met:

  • Administrative access to a vSphere server
  • The testing must occur on a host that can access the VMs deployed to vSphere via the network
  • Ginkgo (download)
  • Docker (download)
  • Kind v0.20.0+ (download)
Environment variables

The first step to running the e2e tests is setting up the required environment variables:

Environment variable Description Example
VSPHERE_SERVER The IP address or FQDN of a vCenter 6.7u3 server my.vcenter.com
VSPHERE_USERNAME The username used to access the vSphere server my-username
VSPHERE_PASSWORD The password used to access the vSphere server my-password
VSPHERE_DATACENTER The unique name or inventory path of the datacenter in which VMs will be created my-datacenter or /my-datacenter
VSPHERE_FOLDER The unique name or inventory path of the folder in which VMs will be created my-folder or /my-datacenter/vm/my-folder
VSPHERE_RESOURCE_POOL The unique name or inventory path of the resource pool in which VMs will be created my-resource-pool or /my-datacenter/host/Cluster-1/Resources/my-resource-pool
VSPHERE_DATASTORE The unique name or inventory path of the datastore in which VMs will be created my-datastore or /my-datacenter/datstore/my-datastore
VSPHERE_NETWORK The unique name or inventory path of the network to which VMs will be connected my-network or /my-datacenter/network/my-network
VSPHERE_SSH_PRIVATE_KEY The file path of the private key used to ssh into the CAPV VMs /home/foo/bar-ssh.key
VSPHERE_SSH_AUTHORIZED_KEY The public key that is added to the CAPV VMs ssh-rsa ABCDEF...XYZ=
VSPHERE_TLS_THUMBPRINT The TLS thumbprint of the vSphere server's certificate which should be trusted 2A:3F:BC:CA:C0:96:35:D4:B7:A2:AA:3C:C1:33:D9:D7:BE:EC:31:55
CONTROL_PLANE_ENDPOINT_IP The IP that kube-vip should use as a control plane endpoint 10.10.123.100
VSPHERE_STORAGE_POLICY The name of an existing vSphere storage policy to be assigned to created VMs my-test-sp
Flags
Flag Description Default Value
SKIP_RESOURCE_CLEANUP This flags skips cleanup of the resources created during the tests as well as the kind/bootstrap cluster false
USE_EXISTING_CLUSTER This flag enables the usage of an existing K8S cluster as the management cluster to run tests against. false
GINKGO_TEST_TIMEOUT This sets the timeout for the E2E test suite. 2h
GINKGO_FOCUS This populates the -focus flag of the ginkgo run command. ""
Running the e2e tests

Run the following command to execute the CAPV e2e tests:

make e2e

The above command should build the CAPV manager image locally and use that image with the e2e test suite.

Documentation

Index

Constants

View Source
const (
	DefaultUserName           = "capv"
	VSpherePrivateKeyFilePath = "VSPHERE_SSH_PRIVATE_KEY"
)
View Source
const (
	KubernetesVersion = "KUBERNETES_VERSION"
)

Variables

This section is empty.

Functions

func Byf added in v0.7.0

func Byf(format string, a ...interface{})

Types

type GlobalInput added in v1.3.2

type GlobalInput struct {
	ArtifactFolder        string
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	E2EConfig             *clusterctl.E2EConfig
}

type InfraClients added in v1.3.2

type InfraClients struct {
	Client     *govmomi.Client
	RestClient *rest.Client
	Finder     *find.Finder
}

type LogCollector added in v0.8.0

type LogCollector struct{}

func (LogCollector) CollectInfrastructureLogs added in v1.8.0

func (collector LogCollector) CollectInfrastructureLogs(_ context.Context, _ client.Client, _ *clusterv1.Cluster, _ string) error

func (LogCollector) CollectMachineLog added in v0.8.0

func (collector LogCollector) CollectMachineLog(_ context.Context, _ client.Client, m *clusterv1.Machine, outputPath string) error

func (LogCollector) CollectMachinePoolLog added in v0.8.0

func (collector LogCollector) CollectMachinePoolLog(_ context.Context, _ client.Client, _ *expv1.MachinePool, _ string) error

Jump to

Keyboard shortcuts

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