e2e

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 34 Imported by: 4

Documentation

Overview

Package e2e implements end to end testing.

Index

Constants

View Source
const (
	KubernetesVersionManagement  = "KUBERNETES_VERSION_MANAGEMENT"
	KubernetesVersion            = "KUBERNETES_VERSION"
	CNIPath                      = "CNI"
	CNIResources                 = "CNI_RESOURCES"
	KubernetesVersionUpgradeFrom = "KUBERNETES_VERSION_UPGRADE_FROM"
	KubernetesVersionUpgradeTo   = "KUBERNETES_VERSION_UPGRADE_TO"
	EtcdVersionUpgradeTo         = "ETCD_VERSION_UPGRADE_TO"
	CoreDNSVersionUpgradeTo      = "COREDNS_VERSION_UPGRADE_TO"
	IPFamily                     = "IP_FAMILY"
)

Test suite constants for e2e config variables.

Variables

This section is empty.

Functions

func Byf

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

func ClusterUpgradeConformanceSpec

func ClusterUpgradeConformanceSpec(ctx context.Context, inputGetter func() ClusterUpgradeConformanceSpecInput)

ClusterUpgradeConformanceSpec implements a spec that upgrades a cluster and runs the Kubernetes conformance suite. Upgrading a cluster refers to upgrading the control-plane and worker nodes (managed by MD and machine pools).

func ClusterctlUpgradeSpec

func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpgradeSpecInput)

ClusterctlUpgradeSpec implements a test that verifies clusterctl upgrade of a management cluster.

NOTE: this test is designed to test v1alpha3 --> v1alpha4 upgrades.

func HaveControllerRef

func HaveControllerRef(kind string, owner metav1.Object) types.GomegaMatcher

func HaveValidVersion

func HaveValidVersion(version string) types.GomegaMatcher

HaveValidVersion succeeds if version is a valid semver version.

func K8SConformanceSpec

func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSpecInput)

K8SConformanceSpec implements a spec that creates a cluster and runs Kubernetes conformance suite.

func KCPAdoptionSpec

func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInput)

KCPAdoptionSpec implements a test that verifies KCP to properly adopt existing control plane Machines.

func KCPUpgradeSpec

func KCPUpgradeSpec(ctx context.Context, inputGetter func() KCPUpgradeSpecInput)

KCPUpgradeSpec implements a test that verifies KCP to properly upgrade a control plane.

func MachineDeploymentRolloutSpec added in v0.4.1

func MachineDeploymentRolloutSpec(ctx context.Context, inputGetter func() MachineDeploymentRolloutSpecInput)

MachineDeploymentRolloutSpec implements a test that verifies that MachineDeployment rolling updates are successful.

func MachineDeploymentScaleSpec

func MachineDeploymentScaleSpec(ctx context.Context, inputGetter func() MachineDeploymentScaleSpecInput)

MachineDeploymentScaleSpec implements a test that verifies that MachineDeployment scale operations are successful.

func MachineRemediationSpec

func MachineRemediationSpec(ctx context.Context, inputGetter func() MachineRemediationSpecInput)

MachineRemediationSpec implements a test that verifies that Machines are remediated by MHC during unhealthy conditions.

func NodeDrainTimeoutSpec

func NodeDrainTimeoutSpec(ctx context.Context, inputGetter func() NodeDrainTimeoutSpecInput)

func QuickStartSpec

func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput)

QuickStartSpec implements a spec that mimics the operation described in the Cluster API quick start, that is creating a workload cluster. This test is meant to provide a first, fast signal to detect regression; it is recommended to use it as a PR blocker test.

func SelfHostedSpec

func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)

SelfHostedSpec implements a test that verifies Cluster API creating a cluster, pivoting to a self-hosted cluster.

Types

type ClusterProxy

type ClusterProxy interface {
	framework.ClusterProxy

	ApplyWithArgs(context.Context, []byte, ...string) error
}

type ClusterUpgradeConformanceSpecInput

type ClusterUpgradeConformanceSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	SkipConformanceTests  bool

	// Flavor to use when creating the cluster for testing, "upgrades" is used if not specified.
	Flavor *string
}

ClusterUpgradeConformanceSpecInput is the input for ClusterUpgradeConformanceSpec.

type ClusterctlUpgradeSpecInput

type ClusterctlUpgradeSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	PreUpgrade            func(managementClusterProxy framework.ClusterProxy)
	PostUpgrade           func(managementClusterProxy framework.ClusterProxy)
	MgmtFlavor            string
	WorkloadFlavor        string
}

ClusterctlUpgradeSpecInput is the input for ClusterctlUpgradeSpec.

type K8SConformanceSpecInput

type K8SConformanceSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	Flavor                string
}

K8SConformanceSpecInput is the input for K8SConformanceSpec.

type KCPAdoptionSpecInput

type KCPAdoptionSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool

	// Flavor, if specified, must refer to a template that is
	// specially crafted with individual control plane machines
	// and a KubeadmControlPlane resource configured for adoption.
	// The initial Cluster, InfraCluster, Machine, InfraMachine,
	// KubeadmConfig, and any other resources that should exist
	// prior to adoption must have the kcp-adoption.step1: "" label
	// applied to them. The updated Cluster (with controlPlaneRef
	// configured), InfraMachineTemplate, and KubeadmControlPlane
	// resources must have the kcp-adoption.step2: "" applied to them.
	// If not specified, "kcp-adoption" is used.
	Flavor *string
}

KCPAdoptionSpecInput is the input for KCPAdoptionSpec.

type KCPUpgradeSpecInput

type KCPUpgradeSpecInput struct {
	E2EConfig                *clusterctl.E2EConfig
	ClusterctlConfigPath     string
	BootstrapClusterProxy    framework.ClusterProxy
	ArtifactFolder           string
	SkipCleanup              bool
	ControlPlaneMachineCount int64
	Flavor                   string
}

KCPUpgradeSpecInput is the input for KCPUpgradeSpec.

type MachineDeploymentRolloutSpecInput added in v0.4.1

type MachineDeploymentRolloutSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	Flavor                string
}

MachineDeploymentRolloutSpecInput is the input for MachineDeploymentRolloutSpec.

type MachineDeploymentScaleSpecInput

type MachineDeploymentScaleSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	Flavor                string
}

MachineDeploymentScaleSpecInput is the input for MachineDeploymentScaleSpec.

type MachineRemediationSpecInput

type MachineRemediationSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool

	// KCPFlavor, if specified, must refer to a template that has a MachineHealthCheck
	// resource configured to match the control plane Machines (cluster.x-k8s.io/controlplane: "" label)
	// and be configured to treat "e2e.remediation.condition" "False" as an unhealthy
	// condition with a short timeout.
	// If not specified, "kcp-remediation" is used.
	KCPFlavor *string

	// MDFlavor, if specified, must refer to a template that has a MachineHealthCheck
	// resource configured to match the MachineDeployment managed Machines and be
	// configured to treat "e2e.remediation.condition" "False" as an unhealthy
	// condition with a short timeout.
	// If not specified, "md-remediation" is used.
	MDFlavor *string
}

MachineRemediationSpecInput is the input for MachineRemediationSpec.

type NodeDrainTimeoutSpecInput

type NodeDrainTimeoutSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool

	// Flavor, if specified, must refer to a template that contains
	// a KubeadmControlPlane resource with spec.machineTemplate.nodeDrainTimeout
	// configured and a MachineDeployment resource that has
	// spec.template.spec.nodeDrainTimeout configured.
	// If not specified, "node-drain" is used.
	Flavor *string
}

NodeDrainTimeoutSpecInput is the input for NodeDrainTimeoutSpec.

type QuickStartSpecInput

type QuickStartSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool

	// Flavor, if specified is the template flavor used to create the cluster for testing.
	// If not specified, and the e2econfig variable IPFamily is IPV6, then "ipv6" is used,
	// otherwise the default flavor is used.
	Flavor *string
}

QuickStartSpecInput is the input for QuickStartSpec.

type SelfHostedSpecInput

type SelfHostedSpecInput struct {
	E2EConfig             *clusterctl.E2EConfig
	ClusterctlConfigPath  string
	BootstrapClusterProxy framework.ClusterProxy
	ArtifactFolder        string
	SkipCleanup           bool
	Flavor                string
}

SelfHostedSpecInput is the input for SelfHostedSpec.

Directories

Path Synopsis
internal
log
Package log implements log handling.
Package log implements log handling.

Jump to

Keyboard shortcuts

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