Documentation ¶
Index ¶
- func BuildAndApplyKustomization(ctx context.Context, input *BuildAndApplyKustomizationInput) error
- func BuildAndRemoveKustomization(ctx context.Context, kustomization string, clusterProxy framework.ClusterProxy) error
- func CreateSecret(ctx context.Context, client client.Client, secretNamespace, secretName string, ...)
- func DeploymentRolledOut(ctx context.Context, clusterProxy framework.ClusterProxy, name string, ...) bool
- func EstablishSSHConnection(e2eConfig *Config, auth ssh.AuthMethod, user, address string) *ssh.Client
- func HasRootOnDisk(output string) bool
- func IsBootedFromDisk(client *ssh.Client) (bool, error)
- func KubectlDelete(ctx context.Context, kubeconfigPath string, resources []byte, args ...string) error
- func LoadBMCConfig(configPath string) *[]BMC
- func PerformSSHBootCheck(e2eConfig *Config, expectedBootMode string, auth ssh.AuthMethod, ...)
- func WaitForBmhDeleted(ctx context.Context, input WaitForBmhDeletedInput, intervals ...interface{})
- func WaitForBmhInPowerState(ctx context.Context, input WaitForBmhInPowerStateInput, ...)
- func WaitForBmhInProvisioningState(ctx context.Context, input WaitForBmhInProvisioningStateInput, ...)
- func WaitForNamespaceDeleted(ctx context.Context, input WaitForNamespaceDeletedInput, ...)
- type BMC
- type BMOIronicUpgradeInput
- type BuildAndApplyKustomizationInput
- type Config
- type LoadImageBehavior
- type PowerState
- type WaitForBmhDeletedInput
- type WaitForBmhInPowerStateInput
- type WaitForBmhInProvisioningStateInput
- type WaitForNamespaceDeletedInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAndApplyKustomization ¶ added in v0.6.0
func BuildAndApplyKustomization(ctx context.Context, input *BuildAndApplyKustomizationInput) error
BuildAndApplyKustomization takes input from BuildAndApplyKustomizationInput. It builds the provided kustomization and apply it to the cluster provided by clusterProxy.
func BuildAndRemoveKustomization ¶ added in v0.6.0
func BuildAndRemoveKustomization(ctx context.Context, kustomization string, clusterProxy framework.ClusterProxy) error
BuildAndRemoveKustomization builds the provided kustomization to resources and removes them from the cluster provided by clusterProxy.
func CreateSecret ¶
func DeploymentRolledOut ¶ added in v0.6.0
func EstablishSSHConnection ¶
func HasRootOnDisk ¶
HasRootOnDisk parses the output from 'df -h' and checks if the root filesystem is on a disk (as opposed to tmpfs).
func IsBootedFromDisk ¶
IsBootedFromDisk checks if the system, accessed via the provided ssh.Client, is booted from a disk. It executes the 'df -h' command on the remote system to analyze the filesystem layout. In the case of a disk boot, the output includes a disk-based root filesystem (e.g., '/dev/vda1'). Conversely, in the case of a Live-ISO boot, the primary filesystems are memory-based (tmpfs).
func KubectlDelete ¶ added in v0.6.0
func KubectlDelete(ctx context.Context, kubeconfigPath string, resources []byte, args ...string) error
KubectlDelete shells out to kubectl delete.
func LoadBMCConfig ¶ added in v0.6.0
func PerformSSHBootCheck ¶
func PerformSSHBootCheck(e2eConfig *Config, expectedBootMode string, auth ssh.AuthMethod, sshAddress string)
PerformSSHBootCheck performs an SSH check to verify the node's boot source. The `expectedBootMode` parameter should be "disk" or "memory". The `auth` parameter is an ssh.AuthMethod for authentication.
func WaitForBmhDeleted ¶
func WaitForBmhDeleted(ctx context.Context, input WaitForBmhDeletedInput, intervals ...interface{})
WaitForBmhDeleted waits until the BMH object has been deleted.
func WaitForBmhInPowerState ¶
func WaitForBmhInPowerState(ctx context.Context, input WaitForBmhInPowerStateInput, intervals ...interface{})
func WaitForBmhInProvisioningState ¶
func WaitForBmhInProvisioningState(ctx context.Context, input WaitForBmhInProvisioningStateInput, intervals ...interface{})
func WaitForNamespaceDeleted ¶
func WaitForNamespaceDeleted(ctx context.Context, input WaitForNamespaceDeletedInput, intervals ...interface{})
WaitForNamespaceDeleted waits until the namespace object has been deleted.
Types ¶
type BMC ¶ added in v0.6.0
type BMC struct { // BMC initial username User string `yaml:"user,omitempty"` // BMC initial password Password string `yaml:"password,omitempty"` // BMC initial address Address string `yaml:"address,omitempty"` // BMC Mac address BootMacAddress string `yaml:"bootMacAddress,omitempty"` // The Hostname of the node, which will be read into BMH object HostName string `yaml:"hostName,omitempty"` // The IP address of the node // Optional. Only needed if e2eConfig variable // SSH_CHECK_PROVISIONED is true IPAddress string `yaml:"ipAddress,omitempty"` // Optional. Only needed if e2eConfig variable // SSH_CHECK_PROVISIONED is true SSHPort string `yaml:"sshPort,omitempty"` }
BMC defines a BMH to use in the tests.
type BMOIronicUpgradeInput ¶ added in v0.6.0
type BMOIronicUpgradeInput struct { // DeployIronic determines if Ironic should be installed at the beginning of the test. // This should be generally set to `true`, but can be `false` in case Ironic is either pre-installed // or not required (for e.g. in `fixture` setup) DeployIronic bool `yaml:"deployIronic,omitempty"` // DeployBMO determines if BMO should be installed at the beginning of the test. // This should be generally set to `true`, but can be `false` in case BMO is pre-installed DeployBMO bool `yaml:"deployBMO,omitempty"` // Path to the Ironic kustomization that should be installed at the beginning of the test. // Not used if DeployIronic is false InitIronicKustomization string `yaml:"initIronicKustomization,omitempty"` // Path to the BMO kustomization that should be installed at the beginning of the test. // Not used if DeployBMO is false InitBMOKustomization string `yaml:"initBMOKustomization,omitempty"` // Name of the entity that should be upgraded and tested. It should be either `bmo` or `ironic`. UpgradeEntityName string `yaml:"upgradeEntityName,omitempty"` // Path to the kustomization of the entity that should be used in upgrading. UpgradeEntityKustomization string `yaml:"upgradeEntityKustomization,omitempty"` }
type BuildAndApplyKustomizationInput ¶ added in v0.6.0
type BuildAndApplyKustomizationInput struct { // Path to the kustomization to build Kustomization string ClusterProxy framework.ClusterProxy // If this is set to true. Perform a wait until the deployment specified by // DeploymentName and DeploymentNamespace is available or WaitIntervals is timed out WaitForDeployment bool // If this is set to true. Set up a log watcher for the deployment specified by // DeploymentName and DeploymentNamespace WatchDeploymentLogs bool // DeploymentName and DeploymentNamespace specified a deployment that will be waited and/or logged DeploymentName string DeploymentNamespace string // Path to store the deployment logs LogPath string // Intervals to use in checking and waiting for the deployment WaitIntervals []interface{} }
BuildAndApplyKustomizationInput provides input for BuildAndApplyKustomize(). If WaitForDeployment and/or WatchDeploymentLogs is set to true, then DeploymentName and DeploymentNamespace are expected.
type Config ¶
type Config struct { // Images is a list of container images to load into the Kind cluster. // Note that this not relevant when using an existing cluster. Images []clusterctl.ContainerImage `json:"images,omitempty"` // Variables to be used in the tests. Variables map[string]string `json:"variables,omitempty"` // Intervals to be used for long operations during tests. Intervals map[string][]string `json:"intervals,omitempty"` // BMOIronicUpgradeSpecs BMOIronicUpgradeSpecs []BMOIronicUpgradeInput `yaml:"bmoIronicUpgradeSpecs,omitempty"` }
Config defines the configuration of an e2e test environment.
func LoadE2EConfig ¶
LoadE2EConfig loads the configuration for the e2e test environment.
func (*Config) Defaults ¶
func (c *Config) Defaults()
Defaults assigns default values to the object. More specifically: - Images gets LoadBehavior = MustLoadImage if not otherwise specified.
func (*Config) GetIntervals ¶
GetIntervals returns the intervals to be applied to a Eventually operation. It searches for [spec]/[key] intervals first, and if it is not found, it searches for default/[key]. If also the default/[key] intervals are not found, ginkgo DefaultEventuallyTimeout and DefaultEventuallyPollingInterval are used.
func (*Config) GetVariable ¶
GetVariable returns a variable from environment variables or from the e2e config file.
type LoadImageBehavior ¶
type LoadImageBehavior string
LoadImageBehavior indicates the behavior when loading an image.
const ( // MustLoadImage causes a load operation to fail if the image cannot be // loaded. MustLoadImage LoadImageBehavior = "mustLoad" // TryLoadImage causes any errors that occur when loading an image to be // ignored. TryLoadImage LoadImageBehavior = "tryLoad" )
type PowerState ¶
type PowerState string
const ( PoweredOn PowerState = "on" PoweredOff PowerState = "off" )
type WaitForBmhDeletedInput ¶
type WaitForBmhDeletedInput struct { Client client.Client BmhName string Namespace string UndesiredStates []metal3api.ProvisioningState }
WaitForBmhDeletedInput is the input for WaitForBmhDeleted.
type WaitForBmhInPowerStateInput ¶
type WaitForBmhInPowerStateInput struct { Client client.Client Bmh metal3api.BareMetalHost State PowerState }
type WaitForBmhInProvisioningStateInput ¶
type WaitForBmhInProvisioningStateInput struct { Client client.Client Bmh metal3api.BareMetalHost State metal3api.ProvisioningState UndesiredStates []metal3api.ProvisioningState }