e2e

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const LONGTIMEOUT = "5m"
View Source
const POLLING = "250ms"
View Source
const TIMEOUT = "60s"

Variables

This section is empty.

Functions

func ConditionExists added in v0.7.0

func ConditionExists(d *v1alpha1.Device, conditionType, conditionStatus, conditionReason string) bool

ConditionExists checks if a specific condition exists for the device with the given type, status, and reason.

func GetDeviceConfig added in v0.6.0

func GetDeviceConfig[T any](device *v1alpha1.Device, configType v1alpha1.ConfigProviderType,
	asConfig func(v1alpha1.ConfigProviderSpec) (T, error)) (T, error)

getDeviceConfig is a generic helper function to retrieve device configurations

Types

type Harness

type Harness struct {
	VM      vm.TestVMInterface
	Client  *apiclient.ClientWithResponses
	Context context.Context
	// contains filtered or unexported fields
}

func NewTestHarness

func NewTestHarness() *Harness

func (*Harness) ApiEndpoint

func (h *Harness) ApiEndpoint() string

func (*Harness) ApproveEnrollment

func (h *Harness) ApproveEnrollment(id string, approval *v1alpha1.EnrollmentRequestApproval)

func (*Harness) CLI

func (h *Harness) CLI(args ...string) (string, error)

func (*Harness) CLIWithStdin

func (h *Harness) CLIWithStdin(stdin string, args ...string) (string, error)

func (Harness) CheckDeviceStatus added in v0.6.0

func (h Harness) CheckDeviceStatus(deviceId string, status v1alpha1.DeviceSummaryStatusType) (*v1alpha1.Device, error)

Check that the device summary status is equal to the status input

func (Harness) CheckRunningContainers added in v0.7.0

func (h Harness) CheckRunningContainers() (string, error)

CheckRunningContainers verifies the expected number of running containers on the VM.

func (*Harness) CleanUpAllResources added in v0.4.0

func (h *Harness) CleanUpAllResources() error

func (*Harness) CleanUpResources added in v0.4.0

func (h *Harness) CleanUpResources(resourceType string) (string, error)

func (*Harness) Cleanup

func (h *Harness) Cleanup(printConsole bool)

Harness cleanup, this will delete the VM and cancel the context if something failed we try to gather logs, console logs are optional and can be enabled by setting printConsole to true

func (*Harness) CreateOrUpdateTestFleet added in v0.6.0

func (h *Harness) CreateOrUpdateTestFleet(testFleetName string, testFleetSelector v1alpha1.LabelSelector, testFleetSpec v1alpha1.DeviceSpec) error

Create a test fleet resource

func (Harness) CreateRepository added in v0.6.0

func (h Harness) CreateRepository(repositorySpec v1alpha1.RepositorySpec, metadata v1alpha1.ObjectMeta) error

Create a repository resource

func (*Harness) CreateTestFleetWithConfig added in v0.6.0

func (h *Harness) CreateTestFleetWithConfig(testFleetName string, testFleetSelector v1alpha1.LabelSelector, configProviderSpec v1alpha1.ConfigProviderSpec) error

Create a test fleet with a configuration

func (*Harness) EnrollAndWaitForOnlineStatus added in v0.4.0

func (h *Harness) EnrollAndWaitForOnlineStatus() (string, *v1alpha1.Device)

func (*Harness) GetCertificateSigningRequestByYaml added in v0.4.0

func (h *Harness) GetCertificateSigningRequestByYaml(csrYaml string) v1alpha1.CertificateSigningRequest

Wrapper function for CertificateSigningRequest

func (*Harness) GetCurrentDeviceGeneration added in v0.6.0

func (h *Harness) GetCurrentDeviceGeneration(deviceId string) (deviceRenderedVersionInt int64, err error)

func (*Harness) GetCurrentDeviceRenderedVersion added in v0.4.0

func (h *Harness) GetCurrentDeviceRenderedVersion(deviceId string) (deviceRenderedVersionInt int, err error)

func (Harness) GetDevice added in v0.6.0

func (h Harness) GetDevice(deviceId string) (*v1alpha1.Device, error)

Get device with response

func (*Harness) GetDeviceByYaml added in v0.4.0

func (h *Harness) GetDeviceByYaml(deviceYaml string) v1alpha1.Device

Wrapper function for Device

func (*Harness) GetDeviceGitConfig added in v0.6.0

func (h *Harness) GetDeviceGitConfig(device *v1alpha1.Device, configName string) (v1alpha1.GitConfigProviderSpec, error)

Get GitConfig

func (*Harness) GetDeviceHttpConfig added in v0.6.0

func (h *Harness) GetDeviceHttpConfig(device *v1alpha1.Device, configName string) (v1alpha1.HttpConfigProviderSpec, error)

Get HttpConfig

func (*Harness) GetDeviceInlineConfig added in v0.6.0

func (h *Harness) GetDeviceInlineConfig(device *v1alpha1.Device, configName string) (v1alpha1.InlineConfigProviderSpec, error)

Get InlineConfig

func (*Harness) GetDeviceOsImage added in v0.6.0

func (h *Harness) GetDeviceOsImage(device *v1alpha1.Device) (image string, err error)

Get an http config of a device resource

func (*Harness) GetDeviceWithStatusSummary added in v0.4.0

func (h *Harness) GetDeviceWithStatusSummary(enrollmentID string) v1alpha1.DeviceSummaryStatusType

func (*Harness) GetDeviceWithStatusSystem

func (h *Harness) GetDeviceWithStatusSystem(enrollmentID string) *apiclient.GetDeviceResponse

func (*Harness) GetDeviceWithUpdateStatus added in v0.4.0

func (h *Harness) GetDeviceWithUpdateStatus(enrollmentID string) v1alpha1.DeviceUpdatedStatusType

func (*Harness) GetEnrollmentIDFromConsole

func (h *Harness) GetEnrollmentIDFromConsole() string

func (*Harness) GetEnrollmentRequestByYaml added in v0.4.0

func (h *Harness) GetEnrollmentRequestByYaml(erYaml string) v1alpha1.EnrollmentRequest

Wrapper function for EnrollmentRequest

func (*Harness) GetFleetByYaml added in v0.4.0

func (h *Harness) GetFleetByYaml(fleetYaml string) v1alpha1.Fleet

Wrapper function for Fleet

func (*Harness) GetRepositoryByYaml added in v0.4.0

func (h *Harness) GetRepositoryByYaml(repoYaml string) v1alpha1.Repository

Wrapper function for Repository

func (*Harness) GetResourceSyncByYaml added in v0.4.0

func (h *Harness) GetResourceSyncByYaml(rSyncYaml string) v1alpha1.ResourceSync

Wrapper function for ResourceSync

func (Harness) ManageResource added in v0.7.0

func (h Harness) ManageResource(operation, resource string, args ...string) (string, error)

ManageResource performs an operation ("apply" or "delete") on a specified resource.

func (*Harness) PrepareNextDeviceGeneration added in v0.6.0

func (h *Harness) PrepareNextDeviceGeneration(deviceId string) (int64, error)

func (*Harness) PrepareNextDeviceVersion added in v0.4.0

func (h *Harness) PrepareNextDeviceVersion(deviceId string) (int, error)

func (*Harness) RegistryEndpoint added in v0.4.0

func (h *Harness) RegistryEndpoint() string

func (*Harness) ReplaceVariableInString added in v0.4.0

func (h *Harness) ReplaceVariableInString(s string, old string, new string) string

func (Harness) RunGetDevices added in v0.7.0

func (h Harness) RunGetDevices(args ...string) (string, error)

RunGetDevices executes "get devices" CLI command with optional arguments.

func (*Harness) RunInteractiveCLI

func (h *Harness) RunInteractiveCLI(args ...string) (io.WriteCloser, io.ReadCloser, error)

func (*Harness) SH added in v0.3.0

func (h *Harness) SH(command string, args ...string) (string, error)

func (*Harness) SHWithStdin added in v0.3.0

func (h *Harness) SHWithStdin(stdin, command string, args ...string) (string, error)

func (*Harness) StartVMAndEnroll

func (h *Harness) StartVMAndEnroll() string

func (*Harness) UpdateDevice added in v0.6.0

func (h *Harness) UpdateDevice(deviceId string, updateFunction func(*v1alpha1.Device)) error

func (*Harness) UpdateDeviceWithRetries added in v0.3.0

func (h *Harness) UpdateDeviceWithRetries(deviceId string, updateFunction func(*v1alpha1.Device))

func (*Harness) WaitForBootstrapAndUpdateToVersion added in v0.4.0

func (h *Harness) WaitForBootstrapAndUpdateToVersion(deviceId string, version string) (*v1alpha1.Device, string)

func (*Harness) WaitForDeviceContents added in v0.3.0

func (h *Harness) WaitForDeviceContents(deviceId string, description string, condition func(*v1alpha1.Device) bool, timeout string)

func (*Harness) WaitForDeviceNewGeneration added in v0.6.0

func (h *Harness) WaitForDeviceNewGeneration(deviceId string, newGeneration int64) (err error)

func (*Harness) WaitForDeviceNewRenderedVersion added in v0.4.0

func (h *Harness) WaitForDeviceNewRenderedVersion(deviceId string, newRenderedVersionInt int) (err error)

func (*Harness) WaitForEnrollmentRequest

func (h *Harness) WaitForEnrollmentRequest(id string) *v1alpha1.EnrollmentRequest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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