Documentation
¶
Index ¶
- Constants
- Variables
- func AddImageServerFile(name string, content []byte) string
- func ArmControllerFault(fault ControllerFault)
- func Checkpoint(name string)
- func ClearControllerFaults()
- func Close()
- func ControllerFaultsEnabled() bool
- func CreateBlankImageFile(name string, format eveconfig.Format, sizeBytes uint64) (relativePath, sha256Hex string)
- func CreateRandomImageFile(name string, sizeBytes uint64) (relativePath, sha256Hex string)
- func DefineTestParameters(params ...TestParameterDefinition)
- func DiskName(extraDiskIdx uint) string
- func FaultForDuration(fault ControllerFault, window time.Duration, run func())
- func FetchAndServeImageFile(url, name, sha256Hex string) string
- func GetCACertPEM() []byte
- func GetCPUsParameterValue() uint8
- func GetControllerEncryptCertPEM() []byte
- func GetControllerHostname() string
- func GetControllerIPv4() net.IP
- func GetControllerIPv6() net.IP
- func GetControllerPort() uint16
- func GetControllerSigningCertPEM() []byte
- func GetDiskSizeMiBParameterValue() uint32
- func GetEVEVersionParameterValue() string
- func GetImageServerHTTPSPort() uint16
- func GetImageServerIPv4() net.IP
- func GetImageServerPort() uint16
- func GetImageServerSFTPPort() uint16
- func GetRAMSizeMiBParameterValue() uint32
- func GetSrcIPv4ForEVEAccess() net.IP
- func GetSrcIPv4ForInternetAccess() net.IP
- func GetSrcIPv6ForEVEAccess() net.IP
- func GetSrcIPv6ForInternetAccess() net.IP
- func GetTPMParameterValue() (useTPM bool)
- func GetTestParameter[T any](key string) T
- func IPAddress(ipAddr string) net.IP
- func IPAddressWithPrefix(cidr string) *net.IPNet
- func IPSubnet(ipSubnet string) *net.IPNet
- func LocalLiveImageRequested() bool
- func Logger() *logrus.Logger
- func MACAddress(macAddr string) net.HardwareAddr
- func ReadAllPublications[T any](d *EdgeDevice, fromAgent string, persistent bool) ([]T, error)
- func ReadPublication[T any](d *EdgeDevice, fromAgent string, persistent bool, key string, output *T) error
- func RotateControllerEncryptCert(deviceConfigs ...*EdgeDeviceConfig)
- func RotateControllerSigningCert()
- func RunParallel(numOfWorkers int, workerFunc func(workerIdx int))
- func RunTestSuite(cases ...TestCase)
- func Setup(requirements ...Requirement)
- func UpdateNetworkModel(netModel *api.NetworkModel)
- func WithControllerFault(fault ControllerFault, run func())
- type ACLAllowRule
- type AppNetworkAdapter
- type ApplicationImageStorage
- type ApplicationInstanceConfig
- type AuthMethod
- type AwsS3Bucket
- type AzureBlob
- type BaseOSDatastoreType
- type BondConfig
- type CSRProfile
- type CellularNetworkConfig
- type ClientCertAuth
- type ClusterApplicationInstanceConfig
- type ClusterBlankVolumeConfig
- type ClusterNode
- type ControllerFault
- type CrashWatch
- type DHCPNetworkConfig
- type DNSLogMatch
- type DirectlyAssignedNetworkAdapter
- type DiskLayoutType
- type DisksLayout
- type DockerContainer
- type EdgeCluster
- func (ec *EdgeCluster) ActivateApplication(appUUID uuid.UUID, waitUntilActivated bool, timeout time.Duration)
- func (ec *EdgeCluster) ApplyConfig(clusterConfig *EdgeClusterConfig, waitUntilFetched, waitUntilConfirmed bool, ...)
- func (ec *EdgeCluster) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
- func (ec *EdgeCluster) FindDeviceHostingApp(appUUID uuid.UUID, timeout time.Duration, excludeDevNames ...string) *EdgeDevice
- func (ec *EdgeCluster) GetAppLogs(appUUID uuid.UUID, match LogMsgMatch) []LogMsg
- func (ec *EdgeCluster) PurgeApplication(appUUID uuid.UUID, volumeGen VolumeGenerationPolicy, waitUntilPurged bool, ...)
- func (ec *EdgeCluster) RebootApplication(appUUID uuid.UUID, waitUntilRebooted bool, timeout time.Duration)
- func (ec *EdgeCluster) RunShellScriptInsideApp(appUUID uuid.UUID, auth AuthMethod, script string, timeout time.Duration, ...) (stdout, stderr string, err error)
- func (ec *EdgeCluster) WaitForFreshNodesReady(timeout time.Duration)
- func (ec *EdgeCluster) WaitUntilAppIsHostedOn(appUUID uuid.UUID, devName string, timeout time.Duration) *EdgeDevice
- func (ec *EdgeCluster) WaitUntilAppIsRunning(appUUID uuid.UUID, timeoutExcludingDownload time.Duration)
- func (ec *EdgeCluster) WaitUntilClusterInfoSatisfies(timeout time.Duration, freshOnly bool, description string, ...)
- func (ec *EdgeCluster) WaitUntilNodesAreReady(timeout time.Duration)
- type EdgeClusterConfig
- func (cc *EdgeClusterConfig) AddApplication(config ClusterApplicationInstanceConfig) uuid.UUID
- func (cc *EdgeClusterConfig) AddBlankVolume(config ClusterBlankVolumeConfig) uuid.UUID
- func (cc *EdgeClusterConfig) AddNetwork(netConfig NetworkConfig) uuid.UUID
- func (cc *EdgeClusterConfig) AddNetworkAdapter(config NetworkAdapterConfig)
- func (cc *EdgeClusterConfig) AddNetworkInstance(config NetworkInstanceConfig) uuid.UUID
- func (cc *EdgeClusterConfig) AddNode(node ClusterNode)
- func (cc *EdgeClusterConfig) AddSCEPProfile(profile SCEPProfile)
- func (cc *EdgeClusterConfig) AddVLANSubinterface(config VLANSubinterfaceConfig)
- func (cc *EdgeClusterConfig) DeleteApplication(appUUID uuid.UUID)
- func (cc *EdgeClusterConfig) DeleteNetwork(networkUUID uuid.UUID)
- func (cc *EdgeClusterConfig) DeleteNetworkAdapter(logicalLabel string)
- func (cc *EdgeClusterConfig) DeleteNetworkInstance(niUUID uuid.UUID)
- func (cc *EdgeClusterConfig) DeleteSCEPProfile(profileName string)
- func (cc *EdgeClusterConfig) DeleteVLANSubinterface(logicalLabel string)
- func (cc *EdgeClusterConfig) GetDeviceConfig(devName string) *EdgeDeviceConfig
- func (cc *EdgeClusterConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
- func (cc *EdgeClusterConfig) SetLPS(config LPSConfig)
- func (cc *EdgeClusterConfig) SetNativeK8SOrchestration(enabled bool)
- func (cc *EdgeClusterConfig) SetRegistrationManifest(manifestYAML []byte)
- func (cc *EdgeClusterConfig) SetWitness(witnessIP net.IP)
- func (cc *EdgeClusterConfig) UpdateApplication(appUUID uuid.UUID, newConfig ClusterApplicationInstanceConfig)
- func (cc *EdgeClusterConfig) UpdateNetwork(networkUUID uuid.UUID, newConfig NetworkConfig)
- func (cc *EdgeClusterConfig) UpdateNetworkAdapter(config NetworkAdapterConfig)
- func (cc *EdgeClusterConfig) UpdateNetworkInstance(niUUID uuid.UUID, newConfig NetworkInstanceConfig)
- func (cc *EdgeClusterConfig) UpdateSCEPProfile(profile SCEPProfile)
- func (cc *EdgeClusterConfig) UpdateVLANSubinterface(config VLANSubinterfaceConfig)
- type EdgeDevice
- func (d *EdgeDevice) ActivateApplication(appUUID uuid.UUID, waitUntilActivated bool, timeout time.Duration)
- func (d *EdgeDevice) ApplyConfig(config *EdgeDeviceConfig, waitUntilFetched bool, waitUntilConfirmed bool)
- func (d *EdgeDevice) AttachUSBHub(id, parentHubID string) string
- func (d *EdgeDevice) AttachUSBStorage(id string, sizeBytes uint64) string
- func (d *EdgeDevice) AttachUSBStorageBehind(hubID, id string, sizeBytes uint64) string
- func (d *EdgeDevice) ConsoleOutput() (string, error)
- func (d *EdgeDevice) CreatePersistPartition(extraDiskIdx uint)
- func (d *EdgeDevice) CreateScratchImage(name string, sizeBytes uint64) string
- func (d *EdgeDevice) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
- func (d *EdgeDevice) DeleteFile(fileName string)
- func (d *EdgeDevice) DeletePartition(partitionLabel string)
- func (d *EdgeDevice) DeleteScratchImage(name string)
- func (d *EdgeDevice) DestroyPartitionFilesystem(partitionLabel string)
- func (d *EdgeDevice) DetachUSBHub(id string)
- func (d *EdgeDevice) DetachUSBStorage(id string)
- func (d *EdgeDevice) DialViaSSH(network, address string) (net.Conn, error)
- func (d *EdgeDevice) DisableRebootAccounting(reason string)
- func (d *EdgeDevice) ExecuteQMP(execute string, arguments any) json.RawMessage
- func (d *EdgeDevice) ExpectAdditionalReboots(count int)
- func (d *EdgeDevice) FileExists(fileName string) bool
- func (d *EdgeDevice) GetAppDNSLogs(appUUID uuid.UUID, match DNSLogMatch) []*eveflowlog.DnsRequest
- func (d *EdgeDevice) GetAppFlowLogs(appUUID uuid.UUID, match FlowLogMatch) []*eveflowlog.FlowRecord
- func (d *EdgeDevice) GetAppInfo(appUUID uuid.UUID) *eveinfo.ZInfoApp
- func (d *EdgeDevice) GetAppLogs(appUUID uuid.UUID, match LogMsgMatch) []LogMsg
- func (d *EdgeDevice) GetAppMetadata(appUUID uuid.UUID) *eveinfo.ZInfoAppInstMetaData
- func (d *EdgeDevice) GetAppMetrics(appUUID uuid.UUID) *evemetrics.AppMetric
- func (d *EdgeDevice) GetArch() string
- func (d *EdgeDevice) GetBlobInfo() *eveinfo.ZInfoBlobList
- func (d *EdgeDevice) GetClusterInfo() (*eveinfo.ZInfoKubeCluster, time.Time)
- func (d *EdgeDevice) GetClusterMetrics() *evemetrics.KubeClusterMetrics
- func (d *EdgeDevice) GetClusterUpdateInfo() *eveinfo.ZInfoKubeClusterUpdateStatus
- func (d *EdgeDevice) GetConfig() *EdgeDeviceConfig
- func (d *EdgeDevice) GetContentTreeInfo(ctUUID uuid.UUID) *eveinfo.ZInfoContentTree
- func (d *EdgeDevice) GetDeviceIPAddress(netAdapterLogicalLabel string) []net.IP
- func (d *EdgeDevice) GetDeviceInfo() *eveinfo.ZInfoDevice
- func (d *EdgeDevice) GetDeviceMetrics() *evemetrics.DeviceMetric
- func (d *EdgeDevice) GetHardwareInfo() *eveinfo.ZInfoHardware
- func (d *EdgeDevice) GetLocationInfo() *eveinfo.ZInfoLocation
- func (d *EdgeDevice) GetLogs(match LogMsgMatch) []LogMsg
- func (d *EdgeDevice) GetNTPSources() *eveinfo.ZInfoNTPSources
- func (d *EdgeDevice) GetNetworkInstanceInfo(niUUID uuid.UUID) *eveinfo.ZInfoNetworkInstance
- func (d *EdgeDevice) GetNetworkInstanceMetrics(niUUID uuid.UUID) *evemetrics.ZMetricNetworkInstance
- func (d *EdgeDevice) GetState() api.EVEDeviceState
- func (d *EdgeDevice) GetVolumeInfo(volumeUUID uuid.UUID) *eveinfo.ZInfoVolume
- func (d *EdgeDevice) GetVolumeMetrics(volumeUUID uuid.UUID) *evemetrics.ZMetricVolume
- func (d *EdgeDevice) GrowDisk(newSizeBytes uint64)
- func (d *EdgeDevice) HardReboot(waitUntilRebooted bool)
- func (d *EdgeDevice) KubectlListNames(resource string) ([]string, error)
- func (d *EdgeDevice) ListAppVMIRS(appUUID uuid.UUID, timeout time.Duration) ([]string, error)
- func (d *EdgeDevice) ListDirEntries(dir string) ([]string, error)
- func (d *EdgeDevice) ListUSBDevices() (USBDeviceList, error)
- func (d *EdgeDevice) ListUSBDevicesInsideApp(appUUID uuid.UUID, auth AuthMethod) (USBDeviceList, error)
- func (d *EdgeDevice) Name() string
- func (d *EdgeDevice) PathExists(target string) (bool, error)
- func (d *EdgeDevice) PowerOff()
- func (d *EdgeDevice) PowerOn(waitUntilOnline bool)
- func (d *EdgeDevice) PrepareShutdown()
- func (d *EdgeDevice) PurgeApplication(appUUID uuid.UUID, volumeGen VolumeGenerationPolicy, waitUntilPurged bool, ...)
- func (d *EdgeDevice) ReachableAddress(port uint16) (string, error)
- func (d *EdgeDevice) ReadFile(fileName string) ([]byte, error)
- func (d *EdgeDevice) RebootApplication(appUUID uuid.UUID, waitUntilRebooted bool, timeout time.Duration)
- func (d *EdgeDevice) RequestReboot(waitUntilFetched bool, waitUntilRebooted bool)
- func (d *EdgeDevice) RequestRefusedEVEUpgrade(targetEVEVersion string, targetEVEHypervisor Hypervisor, ...)
- func (d *EdgeDevice) RunKubectl(args string, timeout time.Duration) (string, error)
- func (d *EdgeDevice) RunShellScript(script string, timeout time.Duration, stdoutWatchdogTimeout time.Duration) (stdout, stderr string, err error)
- func (d *EdgeDevice) RunShellScriptInsideApp(appUUID uuid.UUID, auth AuthMethod, script string, timeout time.Duration, ...) (stdout, stderr string, err error)
- func (d *EdgeDevice) SoftReboot(waitUntilRebooted bool)
- func (d *EdgeDevice) SyncDisks()
- func (d *EdgeDevice) TryExecuteQMP(execute string, arguments any) (json.RawMessage, error)
- func (d *EdgeDevice) UnexpectedRebootCount() int
- func (d *EdgeDevice) UpgradeEVE(targetEVEVersion string, targetEVEHypervisor Hypervisor, ...)
- func (d *EdgeDevice) WaitForClusterNodeIsReady(timeout time.Duration)
- func (d *EdgeDevice) WaitForUSBDevice(t gomega.Gomega, serial string, timeout, polling time.Duration) *USBDeviceInfo
- func (d *EdgeDevice) WaitUntilAppIsRunning(appUUID uuid.UUID, timeoutExcludingDownload time.Duration)
- func (d *EdgeDevice) WaitUntilHasControllerCert(certType evecerts.ZCertType, certPEM []byte, timeout time.Duration)
- func (d *EdgeDevice) WatchAppInfo(appUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoApp, stop func())
- func (d *EdgeDevice) WatchAppMetadata(appUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoAppInstMetaData, stop func())
- func (d *EdgeDevice) WatchAppMetrics(appUUID uuid.UUID) (updates <-chan *evemetrics.AppMetric, stop func())
- func (d *EdgeDevice) WatchBlobInfo() (updates <-chan *eveinfo.ZInfoBlobList, stop func())
- func (d *EdgeDevice) WatchClusterInfo() (updates <-chan *eveinfo.ZInfoKubeCluster, stop func())
- func (d *EdgeDevice) WatchClusterMetrics() (updates <-chan *evemetrics.KubeClusterMetrics, stop func())
- func (d *EdgeDevice) WatchClusterUpdateInfo() (updates <-chan *eveinfo.ZInfoKubeClusterUpdateStatus, stop func())
- func (d *EdgeDevice) WatchContentTreeInfo(ctUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoContentTree, stop func())
- func (d *EdgeDevice) WatchDeviceInfo() (updates <-chan *eveinfo.ZInfoDevice, stop func())
- func (d *EdgeDevice) WatchDeviceMetrics() (updates <-chan *evemetrics.DeviceMetric, stop func())
- func (d *EdgeDevice) WatchForCrash() *CrashWatch
- func (d *EdgeDevice) WatchHardwareInfo() (updates <-chan *eveinfo.ZInfoHardware, stop func())
- func (d *EdgeDevice) WatchLocationInfo() (updates <-chan *eveinfo.ZInfoLocation, stop func())
- func (d *EdgeDevice) WatchLogs(match LogMsgMatch) (logs <-chan LogMsg, stop func())
- func (d *EdgeDevice) WatchNTPSources() (updates <-chan *eveinfo.ZInfoNTPSources, stop func())
- func (d *EdgeDevice) WatchNetworkInstanceInfo(niUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoNetworkInstance, stop func())
- func (d *EdgeDevice) WatchNetworkInstanceMetrics(niUUID uuid.UUID) (updates <-chan *evemetrics.ZMetricNetworkInstance, stop func())
- func (d *EdgeDevice) WatchVolumeInfo(volumeUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoVolume, stop func())
- func (d *EdgeDevice) WatchVolumeMetrics(volumeUUID uuid.UUID) (updates <-chan *evemetrics.ZMetricVolume, stop func())
- func (d *EdgeDevice) WriteFile(fileName string, content []byte)
- type EdgeDeviceConfig
- func (dc *EdgeDeviceConfig) AddApplication(config ApplicationInstanceConfig) uuid.UUID
- func (dc *EdgeDeviceConfig) AddBlankVolume(displayName string, sizeBytes uint64, clearText bool) uuid.UUID
- func (dc *EdgeDeviceConfig) AddBond(config BondConfig)
- func (dc *EdgeDeviceConfig) AddContentTree(displayName string, image ApplicationImageStorage) uuid.UUID
- func (dc *EdgeDeviceConfig) AddNetwork(netConfig NetworkConfig) uuid.UUID
- func (dc *EdgeDeviceConfig) AddNetworkAdapter(config NetworkAdapterConfig)
- func (dc *EdgeDeviceConfig) AddNetworkInstance(config NetworkInstanceConfig) uuid.UUID
- func (dc *EdgeDeviceConfig) AddPhysicalIO(config PhysicalIOConfig)
- func (dc *EdgeDeviceConfig) AddSCEPProfile(profile SCEPProfile)
- func (dc *EdgeDeviceConfig) AddVLANSubinterface(config VLANSubinterfaceConfig)
- func (dc *EdgeDeviceConfig) AddVolume(displayName string, image ApplicationImageStorage, sizeBytes uint64) uuid.UUID
- func (dc *EdgeDeviceConfig) Clone() *EdgeDeviceConfig
- func (dc *EdgeDeviceConfig) DeleteApplication(appUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteBond(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteContentTree(contentTreeUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteNetwork(networkUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteNetworkAdapter(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteNetworkInstance(niUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeletePhysicalIO(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteSCEPProfile(profileName string)
- func (dc *EdgeDeviceConfig) DeleteVLANSubinterface(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteVolume(volumeUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) MakeBootstrapConfig() *eveconfig.BootstrapConfig
- func (dc *EdgeDeviceConfig) SetBaseOS(storage ApplicationImageStorage, shortVersion string)
- func (dc *EdgeDeviceConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
- func (dc *EdgeDeviceConfig) SetDisksLayout(layout DisksLayout)
- func (dc *EdgeDeviceConfig) SetLPS(config LPSConfig)
- func (dc *EdgeDeviceConfig) UpdateApplication(appUUID uuid.UUID, newConfig ApplicationInstanceConfig)
- func (dc *EdgeDeviceConfig) UpdateBond(config BondConfig)
- func (dc *EdgeDeviceConfig) UpdateNetwork(networkUUID uuid.UUID, newConfig NetworkConfig)
- func (dc *EdgeDeviceConfig) UpdateNetworkAdapter(config NetworkAdapterConfig)
- func (dc *EdgeDeviceConfig) UpdateNetworkInstance(niUUID uuid.UUID, newConfig NetworkInstanceConfig)
- func (dc *EdgeDeviceConfig) UpdateSCEPProfile(profile SCEPProfile)
- func (dc *EdgeDeviceConfig) UpdateVLANSubinterface(config VLANSubinterfaceConfig)
- type ExistingEdgeDeviceReusePolicy
- type Filesystem
- type FlowLogMatch
- type FromStringer
- type HTTPStorage
- type Hypervisor
- type IOAdapterConfig
- type InitOption
- type LPSConfig
- type LocalNetworkInstanceConfig
- type LogMsg
- type LogMsgMatch
- type ManualProxyConfig
- type MountConfig
- type NetworkAdapterConfig
- type NetworkConfig
- type NetworkInstanceConfig
- type NetworkProtocol
- type NoIPNetworkConfig
- type PACFileProxyConfig
- type PCIDevice
- type PNAC
- type PhysicalIOConfig
- type PortFwdRule
- type ProxyAutoDiscoveryConfig
- type ProxyConfig
- type ProxyServer
- type RequireCapabilities
- type RequireDirectRegistryPulls
- type RequireEdgeDevice
- type RequireIPv6OnlyRegistryMirrors
- type RequireInternetConnectivity
- type RequireNetworkModel
- type Requirement
- type SCEPProfile
- type SFTPStorage
- type StaticNetworkConfig
- type SwitchNetworkInstanceConfig
- type T
- type Tag
- type TestCase
- type TestHarness
- func (th *TestHarness) CollectInfo(ctx context.Context, req *api.EVEDeviceRequest) (*api.CollectInfoResponse, error)
- func (th *TestHarness) ConnectConsoleToEVE(stream api.Evetest_ConnectConsoleToEVEServer) error
- func (th *TestHarness) ConnectTunnelToEVE(stream api.Evetest_ConnectTunnelToEVEServer) error
- func (th *TestHarness) ConnectTunnelToSDN(stream api.Evetest_ConnectTunnelToSDNServer) error
- func (th *TestHarness) Continue(ctx context.Context, req *api.ContinueRequest) (*api.ContinueResponse, error)
- func (th *TestHarness) Exit(ctx context.Context, req *api.ExitRequest) (*api.ExitResponse, error)
- func (th *TestHarness) GetAppFlowLogs(req *api.AppRequest, stream api.Evetest_GetAppFlowLogsServer) error
- func (th *TestHarness) GetAppInfo(req *api.AppRequest, stream api.Evetest_GetAppInfoServer) error
- func (th *TestHarness) GetAppLogs(req *api.AppRequest, stream api.Evetest_GetAppLogsServer) error
- func (th *TestHarness) GetAppMetrics(req *api.AppRequest, stream api.Evetest_GetAppMetricsServer) error
- func (th *TestHarness) GetClusterInfo(req *api.ClusterRequest, stream api.Evetest_GetClusterInfoServer) error
- func (th *TestHarness) GetClusterMetrics(req *api.ClusterRequest, stream api.Evetest_GetClusterMetricsServer) error
- func (th *TestHarness) GetClusterUpdateInfo(req *api.ClusterRequest, stream api.Evetest_GetClusterUpdateInfoServer) error
- func (th *TestHarness) GetEVEConfig(ctx context.Context, req *api.EVEDeviceRequest) (*api.EVEConfigResponse, error)
- func (th *TestHarness) GetEVEConsoleOutput(ctx context.Context, req *api.EVEDeviceRequest) (*api.ConsoleOutputResponse, error)
- func (th *TestHarness) GetEVEInfo(req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVEInfoServer) error
- func (th *TestHarness) GetEVELogs(req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVELogsServer) error
- func (th *TestHarness) GetEVEMetrics(req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVEMetricsServer) error
- func (th *TestHarness) GetNIInfo(req *api.NIRequest, stream api.Evetest_GetNIInfoServer) error
- func (th *TestHarness) GetNIMetrics(req *api.NIRequest, stream api.Evetest_GetNIMetricsServer) error
- func (th *TestHarness) GetSDNConfigGraph(ctx context.Context, req *api.SDNRequest) (*api.SDNConfigGraphResponse, error)
- func (th *TestHarness) GetSDNNetworkModel(ctx context.Context, req *api.SDNRequest) (*api.SDNGetNetworkModelResponse, error)
- func (th *TestHarness) GetSDNStatus(ctx context.Context, req *api.SDNRequest) (*api.SDNStatusResponse, error)
- func (th *TestHarness) HardRebootEVEDevice(ctx context.Context, req *api.EVEDeviceRequest) (*api.EVERebootResponse, error)
- func (th *TestHarness) SoftRebootEVEDevice(ctx context.Context, req *api.EVEDeviceRequest) (*api.EVERebootResponse, error)
- func (th *TestHarness) Status(ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error)
- func (th *TestHarness) StreamSDNLogs(req *api.SDNRequest, stream api.Evetest_StreamSDNLogsServer) error
- type TestParameterDefinition
- func CPUsParameter() TestParameterDefinition
- func DiskSizeMiBParameter() TestParameterDefinition
- func EVEVersionParameter() TestParameterDefinition
- func FilesystemParameter() TestParameterDefinition
- func HypervisorParameter() TestParameterDefinition
- func RAMSizeMiBParameter() TestParameterDefinition
- func TPMParameter() TestParameterDefinition
- type TestParameterDescription
- type TestParameterValue
- type TestVariant
- type TransparentProxyConfig
- type USBDevice
- type USBDeviceInfo
- type USBDeviceList
- type UsernamePasswordAuth
- type VLANSubinterfaceConfig
- type VirtualNetworkAdapter
- type VolumeGenerationPolicy
- type WiFiNetworkConfig
Constants ¶
const ( // FaultAnswerStatus answers the request with ControllerFault.StatusCode // instead of passing it to the controller. FaultAnswerStatus = controller.FaultActionStatus // FaultCloseConn drops the connection without answering, which the device // sees as a failure to reach the controller rather than as an answer. FaultCloseConn = controller.FaultActionCloseConn // FaultDelay passes the request on after ControllerFault.Delay, to exercise // slow answers and timeouts. FaultDelay = controller.FaultActionDelay )
Ways in which the controller can be made to fail a device request.
const ( // KiB is the number of bytes in a kibibyte. KiB uint64 = 1 << (10 * iota) // MiB is the number of bytes in a mebibyte. MiB // GiB is the number of bytes in a gibibyte. GiB // TiB is the number of bytes in a tebibyte. TiB )
const ( // DefaultSFTPUsername is the username accepted by evetest's built-in // SFTP image server (see GetImageServerIPv4 / GetImageServerSFTPPort). // Use it (together with DefaultSFTPPassword) when configuring SFTPStorage. DefaultSFTPUsername = "evetest" // DefaultSFTPPassword is the password accepted by evetest's built-in // SFTP image server. DefaultSFTPPassword = "pass123" )
const ( USBHubVendorID = 0x0409 USBHubProductID = 0x55aa )
USBHubVendorID and USBHubProductID are the ids of QEMU's emulated USB hub (hw/usb/hub.c), the one AttachUSBHub plugs in; a test tells the hubs from the drives by them.
const CPUsParameterKey = "CPUS"
CPUsParameterKey is the key used for the CPUs parameter.
const DiskSizeMiBParameterKey = "DISK_SIZE_MB"
DiskSizeMiBParameterKey is the key used for the DiskSizeMiB parameter.
const EVEKubeAppNamespace = "eve-kube-app"
EVEKubeAppNamespace is the Kubernetes namespace EVE runs app workloads in; both VMIRS objects and their PVCs live there. See pkg/pillar/kubeapi.EVEKubeNameSpace.
const EVEVersionParameterKey = "EVE_VERSION"
EVEVersionParameterKey is the key used for the EVE version parameter. This is the EVETEST_EVE_VERSION environment variable, which defaults to the HEAD of the checked-out EVE repo when not set (determined by the evetest Makefile). Most tests do not need to explicitly use this parameter and will automatically get EVE device(s) running the version defined by the EVETEST_EVE_VERSION variable. Only needed when a test must start from a different EVE version and then later upgrade to the version selected by EVETEST_EVE_VERSION, or when a test suite needs to override the EVE version for a specific sub-test variant.
const FilesystemParameterKey = "FILESYSTEM"
FilesystemParameterKey is the key used for the Filesystem parameter.
const HypervisorParameterKey = "HYPERVISOR"
HypervisorParameterKey is the key used for the Hypervisor parameter.
const RAMSizeMiBParameterKey = "RAM_SIZE_MB"
RAMSizeMiBParameterKey is the key used for the RAMSizeMiB parameter.
const TPMParameterKey = "TPM"
TPMParameterKey is the key used for the TPM parameter.
const USBControllerBus = "evxhci.0"
USBControllerBus is the QEMU bus name of the USB 3.0 (xHCI) controller that every EVE device VM has on the qemu and proxmox providers, for device_add.
Variables ¶
var NilUUID = uuid.UUID{}
NilUUID is special form of UUID that is specified to have all 128 bits set to zero.
Functions ¶
func AddImageServerFile ¶
AddImageServerFile writes content to a file served by evetest's built-in image server (both over HTTP and SFTP), returning its filename for use as HTTPStorage.ImageRelativePath / SFTPStorage.ImageRelativePath.
func ArmControllerFault ¶
func ArmControllerFault(fault ControllerFault)
ArmControllerFault makes the controller fail the device requests matching the given description, until the fault is used up (ControllerFault.Count) or cleared with ClearControllerFaults. Several faults can be armed at once; the first one matching a request applies.
Requires the proxy - see WithControllerFaults. Only the requests devices make can be failed: the harness reaches the controller directly, so watching info or metrics is never disturbed by an injected fault.
For example, to make every info message fail with 503 while leaving the device config alone:
evetest.ArmControllerFault(evetest.ControllerFault{
Method: "POST",
PathSuffix: "/info",
Action: evetest.FaultAnswerStatus,
StatusCode: http.StatusServiceUnavailable,
})
func Checkpoint ¶
func Checkpoint(name string)
Checkpoint marks a significant execution point in a test.
Each checkpoint is identified by a name. If the environment variable EVETEST_PAUSE_ON_CHECKPOINT is set to the same name, test execution will pause when this checkpoint is reached.
The test can be resumed via the CLI command:
evetest continue [--until <next-checkpoint>]
This mechanism is primarily intended for interactive debugging and step-by-step inspection of long-running or complex tests.
func ClearControllerFaults ¶
func ClearControllerFaults()
ClearControllerFaults removes every armed fault, so that the controller answers device requests normally again.
func Close ¶
func Close()
Close gracefully shuts down the test harness and releases all resources created during Init and Setup.
If the test is running as part of a suite, Close performs no teardown and returns immediately, allowing shared resources (such as VMs and network infrastructure) to be reused by subsequent test cases.
Otherwise, Close stops all background goroutines, shuts down the internal gRPC server, disconnects from the broker (triggering cleanup of all associated EVE and SDN devices), removes any SDN tunnel interfaces created by the test, and stops the Adam controller.
func ControllerFaultsEnabled ¶
func ControllerFaultsEnabled() bool
ControllerFaultsEnabled reports whether the controller runs behind the fault injecting proxy. A test which arms faults has to skip when it returns false, which happens when the user turned the proxy off with EVETEST_CONTROLLER_FAULTS=false.
func CreateBlankImageFile ¶
func CreateBlankImageFile( name string, format eveconfig.Format, sizeBytes uint64) (relativePath, sha256Hex string)
CreateBlankImageFile creates an empty disk image of the given format and size, served by evetest's built-in image server (both over HTTP and SFTP), and returns its filename (for ImageRelativePath) together with the hex-encoded SHA256 of the resulting file's content (for ImageSHA256).
Requires qemu-img to be available inside the evetest container (already a build dependency of the broker).
func CreateRandomImageFile ¶
CreateRandomImageFile creates a file of sizeBytes random bytes, served by evetest's built-in image server (see AddImageServerFile), and returns its filename (for ImageRelativePath) together with the hex-encoded SHA256 of its content (for ImageSHA256).
Random (non-blank) content makes ImageSHA256 verification meaningful: a blank file's checksum can't distinguish "downloaded correctly" from "downloaded as all zeros/corrupted-but-still-blank" -- a corrupted download of random content is vanishingly unlikely to still match the checksum computed here.
func DefineTestParameters ¶
func DefineTestParameters(params ...TestParameterDefinition)
DefineTestParameters defines the set of parameters available to the currently executing test or test suite.
func DiskName ¶
DiskName returns the virtio device name (e.g. "/dev/vdc") of the zero-based extraDiskIdx-th extra (non-boot) disk requested via RequireEdgeDevice.ExtraDisks: extraDiskIdx 0 is /dev/vdb, since /dev/vda is always the device's boot disk.
func FaultForDuration ¶
func FaultForDuration(fault ControllerFault, window time.Duration, run func())
FaultForDuration is a convenience for a fault which stays armed for a window of time rather than for a number of requests.
func FetchAndServeImageFile ¶
FetchAndServeImageFile downloads url over the evetest container's own network and re-serves it from evetest's built-in image server, so a device with no outbound Internet reachability can still download it as a normal HTTP datastore -- just a local one instead of the remote url. Retries a few times on transient network failures (observed in practice: TLS handshake timeouts reaching a public CDN), since this whole path is otherwise fully deterministic. Returns name, for use as HTTPStorage.ImageRelativePath.
func GetCACertPEM ¶
func GetCACertPEM() []byte
GetCACertPEM returns the PEM encoding of the harness's own CA certificate -- the one that signed the image server's HTTPS certificate (see GetImageServerHTTPSPort). Pass it via HTTPStorage.HTTPSTrustedCACertsPEM to trust downloads from the built-in image server over HTTPS.
func GetCPUsParameterValue ¶
func GetCPUsParameterValue() uint8
GetCPUsParameterValue returns the value set for the CPUs parameter.
func GetControllerEncryptCertPEM ¶
func GetControllerEncryptCertPEM() []byte
GetControllerEncryptCertPEM returns the PEM encoding of the controller's current ECDH certificate (see RotateControllerEncryptCert). The device receives the same certificate via /certs as CERT_TYPE_CONTROLLER_ECDH_EXCHANGE.
func GetControllerHostname ¶
func GetControllerHostname() string
GetControllerHostname returns the controller hostname (stored inside /config/server)
func GetControllerIPv4 ¶
GetControllerIPv4 returns the controller (Adam) IPv4 address.
func GetControllerIPv6 ¶
GetControllerIPv6 returns the controller (Adam) IPv6 address and subnet associated with the container's default IPv6 route, if present.
func GetControllerPort ¶
func GetControllerPort() uint16
GetControllerPort returns the port number on which the controller listens.
func GetControllerSigningCertPEM ¶
func GetControllerSigningCertPEM() []byte
GetControllerSigningCertPEM returns the PEM encoding of the certificate the controller currently uses to sign API responses (see RotateControllerSigningCert). The device receives the same certificate via /certs as CERT_TYPE_CONTROLLER_SIGNING.
func GetDiskSizeMiBParameterValue ¶
func GetDiskSizeMiBParameterValue() uint32
GetDiskSizeMiBParameterValue returns the value set for the DiskSizeMiB parameter.
func GetEVEVersionParameterValue ¶
func GetEVEVersionParameterValue() string
GetEVEVersionParameterValue returns the value set for the EVE version parameter.
func GetImageServerHTTPSPort ¶
func GetImageServerHTTPSPort() uint16
GetImageServerHTTPSPort returns the port of the HTTPS listener that serves the same directory as the HTTP image server (see GetCACertPEM for the CA certificate trusting it).
func GetImageServerIPv4 ¶
GetImageServerIPv4 returns the IPv4 address of the HTTP image server.
func GetImageServerPort ¶
func GetImageServerPort() uint16
GetImageServerPort returns the port of the HTTP image server.
func GetImageServerSFTPPort ¶
func GetImageServerSFTPPort() uint16
GetImageServerSFTPPort returns the port of the SFTP server that serves the same directory as the HTTP image server (see DefaultSFTPUsername/Password).
func GetRAMSizeMiBParameterValue ¶
func GetRAMSizeMiBParameterValue() uint32
GetRAMSizeMiBParameterValue returns the value set for the RAMSizeMiB parameter.
func GetSrcIPv4ForEVEAccess ¶
GetSrcIPv4ForEVEAccess returns the IPv4 address used as the source IP when a test communicates with EVE management services or EVE applications. This is exposed to allow network-model firewall rules (when enabled) to permit traffic between the test environment and EVE/app endpoints.
func GetSrcIPv4ForInternetAccess ¶
GetSrcIPv4ForInternetAccess returns the first non-link-local IPv4 address of the interface connecting container with the docker network. This IP should be used as the source IP when tests need to access the Internet from the evetest container.
func GetSrcIPv6ForEVEAccess ¶
GetSrcIPv6ForEVEAccess returns the IPv6 address used as the source IP when a test communicates with EVE management services or EVE applications. This is exposed to allow network-model firewall rules (when enabled) to permit traffic between the test environment and EVE/app endpoints.
func GetSrcIPv6ForInternetAccess ¶
GetSrcIPv6ForInternetAccess returns the first global unicast IPv6 address assigned to the interface connecting container with the docker network. This IP should be used as the source address when tests need IPv6 Internet access from the evetest container.
func GetTPMParameterValue ¶
func GetTPMParameterValue() (useTPM bool)
GetTPMParameterValue returns the value set for the TPM parameter.
func GetTestParameter ¶
GetTestParameter returns the value of a test parameter with the given key, resolved in the following order:
- Value set explicitly by the test-suite
- Value provided via environment variable EVETEST_<KEY>
- Default value from the parameter definition
The type parameter T must match the parameter’s declared type, otherwise the test will fail.
func IPAddressWithPrefix ¶
IPAddressWithPrefix parses an IP address with a prefix length (e.g. "172.22.12.10/24") and returns it as *net.IPNet, preserving the host address. Unlike IPSubnet, the host bits are not masked.
func LocalLiveImageRequested ¶
func LocalLiveImageRequested() bool
LocalLiveImageRequested reports whether the operator selected the live transport (EVETEST_EVE_LIVE_IMAGE). An unparsable value counts as requested, so the caller surfaces the same error resolveLocalLiveImage would rather than silently treating a typo as "off".
func Logger ¶
Logger returns the logrus logger associated with the current test harness.
Tests should use this logger for all test-related logging so that output is consistently formatted and integrated with the harness lifecycle (artifacts, verbosity settings, etc.)
func MACAddress ¶
func MACAddress(macAddr string) net.HardwareAddr
MACAddress converts MAC address from string to net.HardwareAddr
func ReadAllPublications ¶
func ReadAllPublications[T any](d *EdgeDevice, fromAgent string, persistent bool) ([]T, error)
ReadAllPublications retrieves all messages from a pub-sub topic published by the specified device and agent (microservice).
Parameters:
- d: the EdgeDevice handle to read from
- fromAgent: the name of the agent/microservice publishing the topic
Returns a slice of values of type T representing all messages from the topic, or an error if reading or unmarshaling fails.
func ReadPublication ¶
func ReadPublication[T any](d *EdgeDevice, fromAgent string, persistent bool, key string, output *T) error
ReadPublication retrieves a single message from a pub-sub topic published by the specified device and agent (microservice).
Parameters:
- d: the EdgeDevice handle to read from
- fromAgent: the name of the agent/microservice publishing the topic
- key: identifies the specific message within the topic to fetch
- output: pointer to a value of type T to unmarshal the message into
Returns an error if the message does not exist yet (e.g. before the agent has first published it), cannot be read, or does not unmarshal into T. Callers waiting for a message to appear should poll until the error clears.
func RotateControllerEncryptCert ¶
func RotateControllerEncryptCert(deviceConfigs ...*EdgeDeviceConfig)
RotateControllerEncryptCert rotates the controller's ECDH certificate and private key -- the material every evetest cipher context is derived from -- and migrates the deployed configuration onto it: for every onboarded device it registers a cipher context derived from the new certificate, re-encrypts every cipher block from the retired context to the new one, and re-applies the configuration.
Pass the EdgeDeviceConfig builders the test still holds, and pass the ones it has been applying: configurations are pushed as they are, and EVE config is declarative, so a builder that is a subset of what the device has deployed silently un-deploys the difference. A builder left out keeps blocks encrypted against the retired certificate; a device with no builder given has its harness-held configuration migrated instead, and only if it holds cipher blocks.
Ordering is load-bearing: install the certificates, wait for the device to publish the new one, only then push. Reversed, the device parses a cipher context for a certificate it does not have yet and takes a failed decrypt plus domainmgr's 30s retry. The wait is on EVE's ControllerCert publication because the /certs refetch is only triggered asynchronously, by controllercert_confighash (Adam >= 0.0.81), and a fetch that fails is not re-triggered. The push is required even though nothing else changed: zedagent skips re-parsing cipher contexts while the hash over the set is unchanged.
Not safe to call while devices are still being set up: it mutates the harness-held configuration, which ApplyConfig also reads outside devicesM.
func RotateControllerSigningCert ¶
func RotateControllerSigningCert()
RotateControllerSigningCert rotates the certificate and private key with which the controller signs the AuthContainer that wraps every API response.
Nothing has to be re-encrypted and no configuration has to be pushed: evetest always derives cipher contexts from the controller's ECDH certificate, never from the signing certificate (see encryptCipherData), so object-level encryption is untouched. Use RotateControllerEncryptCert for that.
Unlike RotateControllerEncryptCert this does not wait for the device to pick the new certificate up; the caller decides what to wait for.
Adam is deliberately not restarted: it re-reads the signing certificate and key from disk on every request, whereas a restart would regenerate all keypairs and undo the rotation.
func RunParallel ¶
RunParallel runs workerFunc concurrently in numOfWorkers goroutines. workerFunc is invoked once per worker and is passed a zero-based workerIdx in the range [0, numOfWorkers). The function blocks until either:
- all workers complete successfully, or
- the test is marked as failed, in which case it returns immediately without waiting for the remaining workers.
This enables fail-fast behavior for parallel test execution.
func RunTestSuite ¶
func RunTestSuite(cases ...TestCase)
RunTestSuite executes all variants of all test cases using t.Run. Each variant is executed as a subtest with its own parameter values.
Environment variables such as EVETEST_SUITE_MAX_FAILURES may be used to control suite-wide execution behavior (e.g., early termination on excessive failures).
func Setup ¶
func Setup(requirements ...Requirement)
Setup processes the given requirements. When it returns successfully, all requirements are satisfied and the EVE device(s) is/are powered on and onboarded into the controller. Any failure during setup results in the test being failed or skipped.
func UpdateNetworkModel ¶
func UpdateNetworkModel(netModel *api.NetworkModel)
UpdateNetworkModel updates the current network model, enforcing that device network ports cannot change at runtime.
func WithControllerFault ¶
func WithControllerFault(fault ControllerFault, run func())
WithControllerFault arms a fault, runs the given function, and clears the fault afterwards even if the function fails the test.
Types ¶
type ACLAllowRule ¶
type ACLAllowRule struct {
Protocol NetworkProtocol
// Specify either remote subnet or hostname, not both.
RemoteSubnet *net.IPNet
RemoteHostname string
RemotePort uint16 // 0 means any
}
ACLAllowRule is a ACL ALLOW rule.
type AppNetworkAdapter ¶
type AppNetworkAdapter interface {
// contains filtered or unexported methods
}
AppNetworkAdapter identifies types that represent application network adapter configurations.
type ApplicationImageStorage ¶
type ApplicationImageStorage interface {
// contains filtered or unexported methods
}
ApplicationImageStorage defines a generic interface for datastore configurations that can be converted into EVE protobuf representation.
type ApplicationInstanceConfig ¶
type ApplicationInstanceConfig struct {
DisplayName string
Activate bool
ProfileList []string
Image ApplicationImageStorage
VirtualizationMode eveconfig.VmMode
CPUs uint
MemoryBytes uint64
DiskBytes uint64
EnableVNC bool
VNCDisplay uint
VNCPassword string
// RemoteConsole gates VNC access under the Kubevirt hypervisor: unlike
// KVM (where EnableVNC/VNCDisplay/VNCPassword directly configure a raw
// QEMU VNC socket reachable on the device's uplink IP), Kubevirt exposes
// VNC via zedkube's virtctl-based proxy, which only binds the VNC port
// on 127.0.0.1 and is gated by this field, not by EnableVNC. VNCDisplay
// still selects the port (5900+VNCDisplay); VNCPassword is not enforced
// -- see pkg/pillar/docs/vnc-workflows.md. zedkube only starts/stops the
// proxy on a *change* of this field, and only one remote-console session
// is allowed on the device at a time.
RemoteConsole bool
DisableLogs bool
UserData string
NetworkAdapters []AppNetworkAdapter
EnforceNetIntfOrder bool
// IOAdapters are I/O devices other than network adapters (a GPU, a USB
// controller, a serial port, ...) directly assigned to the application,
// each referencing a PhysicalIO entry added with
// EdgeDeviceConfig.AddPhysicalIO.
IOAdapters []IOAdapterConfig
// Mounts are additional volumes attached to the application alongside its
// root disk (built from Image/DiskBytes). Each entry references an
// existing, independently created volume (see EdgeDeviceConfig.AddVolume
// / AddBlankVolume) -- AddApplication/UpdateApplication only wire up (or
// rewire) the app's VolumeRefList to point at it; they never create or
// remove the volume itself.
Mounts []MountConfig
}
ApplicationInstanceConfig wraps configuration for a single application deployed on EVE.
type AuthMethod ¶
type AuthMethod interface {
// contains filtered or unexported methods
}
AuthMethod is a marker interface for application authentication methods.
type AwsS3Bucket ¶
type AwsS3Bucket struct {
ImageFormat eveconfig.Format
ImageSHA256 string
MaxDownloadBytes uint64
ImageRelativePath string
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
}
AwsS3Bucket defines path to application image stored inside AWS S3. https://<Bucket>.s3.<Region>.amazonaws.com/<ImageRelativePath>
type AzureBlob ¶
type AzureBlob struct {
ImageFormat eveconfig.Format
ImageSHA256 string
MaxDownloadBytes uint64
ImageRelativePath string
AccountName string
AccountKey string
Container string
}
AzureBlob defines path to application image stored inside Azure Blob. https://<AccountName>.blob.core.windows.net/<Container>/<ImageRelativePath>
type BaseOSDatastoreType ¶
type BaseOSDatastoreType int
BaseOSDatastoreType selects how EdgeDevice.UpgradeEVE delivers the target EVE rootfs to the device.
const ( // BaseOSDatastoreHTTP has evetest extract the raw rootfs image from the // locally-pulled EVE docker image and serve it over evetest's own // embedded HTTP image server. This is the traditional/default path and // works even when the target image is not (or cannot be) hosted on a // registry reachable from the device. BaseOSDatastoreHTTP BaseOSDatastoreType = iota // BaseOSDatastoreOCI has EVE pull the target rootfs directly from the // same OCI registry the target image was tagged in (e.g. Docker Hub), // using a container-registry Datastore. evetest still pulls the image // locally first to determine the target short version, but skips // extracting the raw rootfs and serving it over HTTP. BaseOSDatastoreOCI )
func (*BaseOSDatastoreType) FromString ¶
func (t *BaseOSDatastoreType) FromString(s string) error
FromString parses a datastore type name string and sets the BaseOSDatastoreType value.
func (BaseOSDatastoreType) String ¶
func (t BaseOSDatastoreType) String() string
type BondConfig ¶
type BondConfig struct {
LogicalLabel string
InterfaceName string
MemberLabels []string // Logical labels of aggregated PhysicalIO adapters.
BondMode evecommon.BondMode
MIIMonitor *eveconfig.MIIMonitor
ARPMonitor *eveconfig.ArpMonitor
LACPRate evecommon.LacpRate
Cost uint8
NetworkUUID uuid.UUID
StaticIP net.IP // use only in combination with StaticNetworkConfig
Usage evecommon.PhyIoMemberUsage
}
BondConfig represents a bond (link aggregation) interface.
type CSRProfile ¶
type CSRProfile struct {
// X.509 Distinguished Name (DN) attributes.
CommonName string // CN
Organization string // O
OrganizationalUnit string // OU
Country string // C
State string // ST
Locality string // L
// X.509 Subject Alternative Name (SAN) attributes.
SanDNS []string
SanIPs []net.IP
SanURIs []string
SANEmails []string
// Certificate renewal settings.
// Percentage of the certificate validity period after which
// the device should attempt renewal (e.g., 80 = renew after 80%).
RenewPeriodPercent uint8
KeyType eveconfig.KeyType
HashAlgorithm eveconfig.HashAlgorithm
}
CSRProfile : Certificate Signing Request (CSR) configuration profile. Defines subject identity, extensions, cryptographic parameters, and renewal behavior for certificate enrollment.
type CellularNetworkConfig ¶
type CellularNetworkConfig struct {
// "DHCP" is not quite accurate here since most of the time we get IP configuration
// from the cellular network via PDP context activation, not traditional DHCP.
// But other than that, all the configuration parameters are the same, so we reuse
// DHCPNetworkConfig
DHCPNetworkConfig
// SIM card slot to which this configuration applies.
// 0 - unspecified (apply to currently activated or the only available)
// 1 - config for SIM card in the first slot
// 2 - config for SIM card in the second slot
// etc.
SIMSlot uint8
// Access Point Network for the default bearer.
APN string
// The IP addressing type to use for the default bearer.
IPType evecommon.CellularIPType
// Authentication protocol used for the default bearer.
AuthProtocol evecommon.CellularAuthProtocol
// User credentials for the default bearer (when required).
UserCredentials UsernamePasswordAuth
// The set of cellular network operators that modem should preferably try to register
// and connect into.
// Network operator should be referenced by PLMN (Public Land Mobile Network) code.
PreferredPLMNs []string
// The list of preferred Radio Access Technologies (RATs) to use for connecting
// to the network.
PreferredRATs []evecommon.RadioAccessTechnology
// If true, then modem will avoid connecting to networks with roaming.
ForbidRoaming bool
// Access Point Network for the attach (aka initial) bearer.
AttachAPN string
// The IP addressing type to use for the attach bearer.
AttachIPType evecommon.CellularIPType
// Authentication protocol used for the attach bearer.
AttachAuthProtocol evecommon.CellularAuthProtocol
// User credentials for the attach bearer (when required).
AttachUserCredentials UsernamePasswordAuth
// Enable probing to detect broken connection.
EnableProbing bool
// User-defined connectivity probing method.
UserDefinedProbe pillartypes.ConnectivityProbe
// Some LTE modems have GNSS receiver integrated and can be used
// for device location tracking.
// Enable this option to have location info periodically obtained
// from this modem and published by wwan microservice via topic WwanLocationInfo.
LocationTracking bool
}
CellularNetworkConfig represents a cellular network configuration.
type ClientCertAuth ¶
type ClientCertAuth struct {
KeyPEM string
}
ClientCertAuth represents client certificate–based authentication.
type ClusterApplicationInstanceConfig ¶
type ClusterApplicationInstanceConfig struct {
ApplicationInstanceConfig
// DesignatedNodeName is the device name of the cluster node where
// the application should be placed. This field is mandatory.
DesignatedNodeName string
// Affinity determines how strictly the designated node preference
// is enforced. The default zero value is AFFINITY_TYPE_PREFERRED.
Affinity eveconfig.AffinityType
}
ClusterApplicationInstanceConfig wraps ApplicationInstanceConfig with cluster-specific fields required when deploying an application across a cluster of edge nodes.
type ClusterBlankVolumeConfig ¶
type ClusterBlankVolumeConfig struct {
DisplayName string
SizeBytes uint64
// ClearText creates the volume outside the vault. See
// EdgeDeviceConfig.AddBlankVolume.
ClearText bool
// DesignatedNodeName sets the volume's designated node. Empty leaves it
// unset, so each node that gets the volume treats itself as its owner.
DesignatedNodeName string
// GenerationCount is the volume's generation. A controller raises it to
// rebuild a volume from scratch. A test can start a volume above zero to
// stand for one that was rebuilt, whose earlier generation is gone.
GenerationCount int64
// NodeNames lists the nodes whose config carries the volume. Empty means
// every node. A controller need not send a volume to every node of a
// cluster, and a test can use this to do the same.
NodeNames []string
// VolumeUUID is the volume's UUID. Zero generates one. A test sets it to
// create objects under the UUID before the volume is sent.
VolumeUUID uuid.UUID
}
ClusterBlankVolumeConfig describes a standalone blank volume for EdgeClusterConfig.AddBlankVolume.
type ClusterNode ¶
type ClusterNode struct {
DevName string
ClusterIP *net.IPNet
ClusterInterface string
BootstrapNode bool
// TieBreaker marks this node as the cluster tie-breaker: the third
// node of an HA cluster, which exists only to give etcd a quorum
// vote. EVE keeps it cordoned, runs no workloads on it and places no
// Longhorn replicas there, which also lowers the replica count of
// the storage class used for new volumes.
//
// Leave it false on every node to configure no tie-breaker at all.
TieBreaker bool
}
ClusterNode identifies one node participating in the cluster. ClusterIP is the IP address (with prefix) assigned to this node on the cluster interface. ClusterInterface is the logical label of the physical port used for intra-cluster communication on this node. Exactly one node should have BootstrapNode set to true — its ClusterIP is used as the join server IP for all nodes. At most one node may have TieBreaker set to true.
type ControllerFault ¶
type ControllerFault = controller.FaultRule
ControllerFault describes which of the requests a device sends to the controller should fail, and how. See ArmControllerFault.
type CrashWatch ¶
type CrashWatch struct {
// contains filtered or unexported fields
}
CrashWatch tells whether the device crashed since the watch started: an agent died with a fatal, the watchdog gave up on a process, or the device rebooted without being asked to. A test waiting for something a crash would prevent polls Reason to fail at once, naming the cause, instead of waiting out its timeout.
func (*CrashWatch) Reason ¶
func (w *CrashWatch) Reason() string
Reason returns why the device is known to have crashed, or "" while it is not known to have. The serial console tells within seconds, whatever becomes of the device afterwards; the other signs register only once the device is back up and talking to the controller, since a fatal log line travels with the next log upload and an unexpected reboot is recognized from the boot time in the device's info messages.
type DHCPNetworkConfig ¶
type DHCPNetworkConfig struct {
NetworkType evecommon.NetworkType
MTU uint16
NTPServers []string
IgnoreNTPFromDHCP bool
// DNSServers are static DNS server IPs to configure in addition to (or
// instead of) the DHCP-provided DNS servers. When IgnoreDNSFromDHCP is
// false (the default), these are appended to the DHCP-provided servers.
// When IgnoreDNSFromDHCP is true, only these are used.
DNSServers []net.IP
// IgnoreDNSFromDHCP controls whether DHCP-provided DNS servers are ignored.
// When true, only the statically configured DNSServers are used.
// Corresponds to DhcpOptionsIgnore.DnsConfigExclusively in the EVE API.
IgnoreDNSFromDHCP bool
ProxyConfig ProxyConfig
}
DHCPNetworkConfig represents a network configuration for Ethernet interface, with DHCP used for IP assignment.
type DNSLogMatch ¶
type DNSLogMatch struct {
VirtualNetAdapter string // logical label
NetworkInstance uuid.UUID
// NotBefore and NotAfter relates to DnsRequest.requestTime
NotBefore time.Time
NotAfter time.Time
}
DNSLogMatch defines filtering criteria for matching application DNS logs.
type DirectlyAssignedNetworkAdapter ¶
DirectlyAssignedNetworkAdapter represents network adapter directly assigned to an application (e.g. using PCI passthrough).
type DiskLayoutType ¶
type DiskLayoutType int
DiskLayoutType is the desired ZFS/RAID disk-array layout for EdgeDeviceConfig.SetDisksLayout.
const ( // DiskLayoutUnspecified leaves EVE's automatic (default) disk selection // in place -- no explicit layout is configured. DiskLayoutUnspecified DiskLayoutType = iota // DiskLayoutRAID1 mirrors 2 disks. DiskLayoutRAID1 // DiskLayoutRAID10 stripes 2 RAID1 mirrors (4 disks total). DiskLayoutRAID10 )
type DisksLayout ¶
type DisksLayout struct {
LayoutType DiskLayoutType
// OfflineDisks marks disk slots as ZFS_OFFLINE.
OfflineDisks []uint
// UnusedDisks marks disk slots as UNUSED (removed from the array).
UnusedDisks []uint
// ReplaceDisks requests replacing the disk currently at the given slot
// with a spare disk, selected in order from the device's extra disks
// beyond what the layout itself occupies (e.g. for RAID1, slot 0's
// replacement is the device's 3rd extra disk).
ReplaceDisks []uint
}
DisksLayout describes the desired ZFS/RAID disk-array layout of a device's extra (non-boot) virtio disks (see RequireEdgeDevice.ExtraDisks), mirroring eden's own disks-layout model (pkg/device/disksLayout.go in the eden repo, adapted here since evetest's broker only ever attaches virtio disks -- see DiskName). Disk slot indices below (0..3 for RAID10, 0..1 for RAID1) refer to positions within the layout, not the device's overall extra-disk list.
type DockerContainer ¶
type DockerContainer struct {
Domain string // default: "index.docker.io"
ImageName string
Tag string
// TrustedCACertsPEM lists CA certificates EVE should trust when connecting
// to Domain over HTTPS, in addition to its normal trust store -- e.g. the
// harness's own CA (GetCACertPEM) when Domain points at evetest's embedded
// OCI registry (see PushDockerImageToLocalRegistry), or an enterprise
// registry's own internal CA. Mirrors HTTPStorage.HTTPSTrustedCACertsPEM;
// leave unset for a registry already trusted via the normal chain (e.g.
// Docker Hub).
TrustedCACertsPEM []string
}
DockerContainer defines path to application image stored inside a docker image registry.
func PushDockerImageToLocalRegistry ¶
func PushDockerImageToLocalRegistry(imageName string) (DockerContainer, error)
PushDockerImageToLocalRegistry copies a Docker image -- pulling it first if not already present locally -- from the local Docker daemon into evetest's own embedded OCI registry, and returns the DockerContainer fields that point an EVE datastore at that copy.
This is what lets an OCI/container datastore be exercised (an EVE upgrade via BaseOSDatastoreOCI, or a DockerContainer volume/app image) without the image under test already being published to a real, externally reachable registry: evetest re-serves whatever the local Docker daemon has under imageName ("<repo>:<tag>", e.g. as returned by utils.EVEDockerImageName) as a datastore of its own.
func PushImageWithMissingLayersToLocalRegistry ¶
func PushImageWithMissingLayersToLocalRegistry(repo, tag string, numLayers int) ( image DockerContainer, layerDigests []string, err error)
PushImageWithMissingLayersToLocalRegistry publishes, under repo:tag in evetest's embedded OCI registry, an image of numLayers layers of which only the manifest and the config blob are uploaded: the layer blobs never are. A pull of the image resolves the tag and fetches the manifest and the config without trouble, then fails on every layer with the registry's BLOB_UNKNOWN. That is the shape of a registry, or a pull-through mirror, that has lost or never received the blobs a manifest refers to, and of a registry that becomes unreachable right after serving the manifest: every layer fails on its own, and from every management port the downloader tries it from.
Every layer is a few bytes of random gzip, so no two images published this way share a digest and nothing pulled earlier can stand in for a layer. The layers' digests are returned as volumemgr names them (lowercase hex, no "sha256:" prefix), in manifest order, for a test to recognize them in what EVE reports. The returned DockerContainer points an EVE datastore at the image, as PushDockerImageToLocalRegistry does.
type EdgeCluster ¶
type EdgeCluster struct {
// contains filtered or unexported fields
}
EdgeCluster represents a cluster of edge devices and provides operations that span across all cluster nodes (e.g. applying config, waiting for application deployment, running scripts inside cluster-scheduled apps).
func NewEdgeCluster ¶
func NewEdgeCluster(clusterName string) *EdgeCluster
NewEdgeCluster creates an EdgeCluster handle for the given cluster name. The typical workflow is to create the handle, then call ApplyConfig to push the cluster configuration to all devices, and finally interact with the cluster (e.g. WaitUntilNodesAreReady, deploy applications, etc.).
func (*EdgeCluster) ActivateApplication ¶
func (ec *EdgeCluster) ActivateApplication(appUUID uuid.UUID, waitUntilActivated bool, timeout time.Duration)
ActivateApplication activates the specified application across the cluster. The activate flag is set on all devices, but the wait (if requested) is performed only on the device hosting the application.
func (*EdgeCluster) ApplyConfig ¶
func (ec *EdgeCluster) ApplyConfig(clusterConfig *EdgeClusterConfig, waitUntilFetched, waitUntilConfirmed bool, excludeFromWait ...string)
ApplyConfig applies the configuration from the given EdgeClusterConfig to all cluster devices in parallel. The waitUntilFetched and waitUntilConfirmed arguments are forwarded to each device's ApplyConfig; see EdgeDevice.ApplyConfig for their semantics. excludeFromWait names devices the config is still pushed to, but without waiting on either flag -- e.g. a device deliberately powered off for the test, which would otherwise block waitUntilFetched/waitUntilConfirmed forever. The set of cluster devices is collected from the EdgeClusterConfig nodes and stored for use by subsequent methods.
func (*EdgeCluster) DeactivateApplication ¶
func (ec *EdgeCluster) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
DeactivateApplication deactivates the specified application across the cluster. The activate flag is cleared on all devices, but the wait (if requested) is performed only on the device hosting the application.
func (*EdgeCluster) FindDeviceHostingApp ¶
func (ec *EdgeCluster) FindDeviceHostingApp(appUUID uuid.UUID, timeout time.Duration, excludeDevNames ...string) *EdgeDevice
FindDeviceHostingApp finds the cluster device that hosts the given application. It returns the device the newest stored ZInfoKubeCluster report places the app on (matched by display name in EveApps or EveVmApps), or else waits for a new report that does.
Only the newest report is trusted: only the stats leader publishes cluster info, and a node that loses the lease stops publishing without retracting its last report, so an older report can name a node the app has left.
Pass excludeDevNames to wait for the app to move OFF the named devices, which is what a failover test needs. Excluded devices are skipped as a source of cluster info and are never returned, so the answer can only come from a device that is still up.
func (*EdgeCluster) GetAppLogs ¶
func (ec *EdgeCluster) GetAppLogs(appUUID uuid.UUID, match LogMsgMatch) []LogMsg
GetAppLogs collects log messages for the specified application from all cluster devices (since the app may have migrated between nodes during its lifespan) and returns them sorted by timestamp.
func (*EdgeCluster) PurgeApplication ¶
func (ec *EdgeCluster) PurgeApplication(appUUID uuid.UUID, volumeGen VolumeGenerationPolicy, waitUntilPurged bool, timeout time.Duration, excludeDevNames ...string)
PurgeApplication purges the specified application across the cluster. The purge counter is incremented on all devices, but the wait (if requested) is performed only on the device hosting the application. See EdgeDevice.PurgeApplication for volumeGen.
Name in excludeDevNames any node that must not be taken for the host, such as one the caller has powered off: the cluster info it published before going down still names it as the host, and waiting there never completes.
func (*EdgeCluster) RebootApplication ¶
func (ec *EdgeCluster) RebootApplication(appUUID uuid.UUID, waitUntilRebooted bool, timeout time.Duration)
RebootApplication reboots the specified application across the cluster. The reboot counter is incremented on all devices, but the wait (if requested) is performed only on the device hosting the application.
func (*EdgeCluster) RunShellScriptInsideApp ¶
func (ec *EdgeCluster) RunShellScriptInsideApp(appUUID uuid.UUID, auth AuthMethod, script string, timeout time.Duration, stdoutWatchdogTimeout time.Duration) (stdout, stderr string, err error)
RunShellScriptInsideApp locates the cluster node hosting the specified application and executes a shell script inside it over SSH.
func (*EdgeCluster) WaitForFreshNodesReady ¶
func (ec *EdgeCluster) WaitForFreshNodesReady(timeout time.Duration)
WaitForFreshNodesReady is WaitUntilNodesAreReady, except that it counts only reports that arrive after the call. Use it after a node reboots or is powered off and on. The leader's report can show a powered-off node Ready until Kubernetes marks it NotReady, so call it only once an outage has lasted that long.
func (*EdgeCluster) WaitUntilAppIsHostedOn ¶
func (ec *EdgeCluster) WaitUntilAppIsHostedOn(appUUID uuid.UUID, devName string, timeout time.Duration) *EdgeDevice
WaitUntilAppIsHostedOn waits until the newest cluster info report places the app on devName and on no other node, and returns that device.
Use it to verify placement after the app has moved. Like FindDeviceHostingApp it starts from the newest stored report, because EVE sends cluster info only when it changes, so a placement that settled before the call may never be reported again. Requiring the app on devName alone rides out the window where the VMI being replaced is still listed next to its successor.
func (*EdgeCluster) WaitUntilAppIsRunning ¶
func (ec *EdgeCluster) WaitUntilAppIsRunning( appUUID uuid.UUID, timeoutExcludingDownload time.Duration)
WaitUntilAppIsRunning waits until the specified application is running on one of the cluster nodes. It first locates the destination device via cluster info, then delegates to that device's WaitUntilAppIsRunning.
func (*EdgeCluster) WaitUntilClusterInfoSatisfies ¶
func (ec *EdgeCluster) WaitUntilClusterInfoSatisfies(timeout time.Duration, freshOnly bool, description string, pred func(*eveinfo.ZInfoKubeCluster) bool)
WaitUntilClusterInfoSatisfies waits until any device in the cluster reports a ZInfoKubeCluster satisfying pred. Only the elected leader node publishes cluster info, and which device that is can change over the cluster's lifetime (e.g. after a quorum recovery promotes a different node), so every device is watched in parallel and the function succeeds as soon as any single one satisfies pred. It fails if the timeout expires before that happens. With freshOnly, reports received before the call are ignored. description is used only for logging.
func (*EdgeCluster) WaitUntilNodesAreReady ¶
func (ec *EdgeCluster) WaitUntilNodesAreReady(timeout time.Duration)
WaitUntilNodesAreReady waits until any device in the cluster reports all cluster nodes as Ready via ZInfoKubeCluster. Only the elected leader node publishes cluster info, so the function succeeds as soon as any single device reports all nodes ready. It fails if the timeout expires before that happens.
It accepts the last report already received. After a node reboots, that report can predate the reboot and still show the node Ready, so use WaitForFreshNodesReady there.
type EdgeClusterConfig ¶
type EdgeClusterConfig struct {
ClusterID uuid.UUID
Token string // plaintext join token
// contains filtered or unexported fields
}
EdgeClusterConfig manages device configurations for a cluster of edge nodes. Methods that create UUID-identified objects (networks, network instances, applications, etc.) generate the UUID once and apply the same object to every node. Encrypted data (e.g. cluster join token, datastore credentials) is encrypted individually per device because each device has its own encryption key. For per-device customization, use GetDeviceConfig.
func NewEdgeClusterConfig ¶
func NewEdgeClusterConfig( clusterType eveconfig.ClusterType, nodes ...ClusterNode) *EdgeClusterConfig
NewEdgeClusterConfig constructs an EdgeClusterConfig. It creates an EdgeDeviceConfig for each node, generates a shared cluster UUID and join token, and sets the cluster configuration on every device. The join token is encrypted individually per device.
func (*EdgeClusterConfig) AddApplication ¶
func (cc *EdgeClusterConfig) AddApplication( config ClusterApplicationInstanceConfig) uuid.UUID
AddApplication adds an application to all devices. The same UUIDs (app, volume, content tree, datastore) are used across all devices. DesignatedNodeName is resolved to the device UUID and set on the AppInstanceConfig, Volume and ContentTree, along with the Affinity field on the app.
func (*EdgeClusterConfig) AddBlankVolume ¶
func (cc *EdgeClusterConfig) AddBlankVolume(config ClusterBlankVolumeConfig) uuid.UUID
AddBlankVolume adds one standalone blank volume, under a single UUID, to the configs of the selected cluster nodes, and returns that UUID.
func (*EdgeClusterConfig) AddNetwork ¶
func (cc *EdgeClusterConfig) AddNetwork(netConfig NetworkConfig) uuid.UUID
AddNetwork adds a network configuration to all devices. The same UUID is used across all devices.
func (*EdgeClusterConfig) AddNetworkAdapter ¶
func (cc *EdgeClusterConfig) AddNetworkAdapter(config NetworkAdapterConfig)
AddNetworkAdapter adds a network adapter to all devices.
func (*EdgeClusterConfig) AddNetworkInstance ¶
func (cc *EdgeClusterConfig) AddNetworkInstance(config NetworkInstanceConfig) uuid.UUID
AddNetworkInstance adds a network instance to all devices. The same UUID is used across all devices.
func (*EdgeClusterConfig) AddNode ¶
func (cc *EdgeClusterConfig) AddNode(node ClusterNode)
AddNode extends a built cluster configuration with one more node, which is how a test grows a running cluster. The device must already be onboarded; call EdgeCluster.ApplyConfig afterwards to push the result.
The new node is cloned from the first node, so it shares its networks, adapters, network instances and applications under the same UUIDs -- which is what makes it a peer rather than a lookalike. Only the cluster IP and the per-device secrets are rebuilt. Two consequences:
- Only the first node is the template, so a GetDeviceConfig customization made on another node is not carried over.
- The new node is never the bootstrap node, and never the tie-breaker: that has to be named at construction, since every node is told which node it is.
func (*EdgeClusterConfig) AddSCEPProfile ¶
func (cc *EdgeClusterConfig) AddSCEPProfile(profile SCEPProfile)
AddSCEPProfile adds a SCEP profile to all devices. Encryption is performed individually per device.
func (*EdgeClusterConfig) AddVLANSubinterface ¶
func (cc *EdgeClusterConfig) AddVLANSubinterface(config VLANSubinterfaceConfig)
AddVLANSubinterface adds a VLAN sub-interface to all devices.
func (*EdgeClusterConfig) DeleteApplication ¶
func (cc *EdgeClusterConfig) DeleteApplication(appUUID uuid.UUID)
DeleteApplication removes an application from all devices.
func (*EdgeClusterConfig) DeleteNetwork ¶
func (cc *EdgeClusterConfig) DeleteNetwork(networkUUID uuid.UUID)
DeleteNetwork removes a network from all devices.
func (*EdgeClusterConfig) DeleteNetworkAdapter ¶
func (cc *EdgeClusterConfig) DeleteNetworkAdapter(logicalLabel string)
DeleteNetworkAdapter removes a network adapter from all devices.
func (*EdgeClusterConfig) DeleteNetworkInstance ¶
func (cc *EdgeClusterConfig) DeleteNetworkInstance(niUUID uuid.UUID)
DeleteNetworkInstance removes a network instance from all devices.
func (*EdgeClusterConfig) DeleteSCEPProfile ¶
func (cc *EdgeClusterConfig) DeleteSCEPProfile(profileName string)
DeleteSCEPProfile removes a SCEP profile from all devices.
func (*EdgeClusterConfig) DeleteVLANSubinterface ¶
func (cc *EdgeClusterConfig) DeleteVLANSubinterface(logicalLabel string)
DeleteVLANSubinterface removes a VLAN sub-interface from all devices.
func (*EdgeClusterConfig) GetDeviceConfig ¶
func (cc *EdgeClusterConfig) GetDeviceConfig(devName string) *EdgeDeviceConfig
GetDeviceConfig returns the EdgeDeviceConfig for a specific device, allowing per-device customization.
func (*EdgeClusterConfig) SetConfigProperties ¶
func (cc *EdgeClusterConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
SetConfigProperties sets configuration properties on all devices.
func (*EdgeClusterConfig) SetLPS ¶
func (cc *EdgeClusterConfig) SetLPS(config LPSConfig)
SetLPS sets the Local Profile Server configuration on all devices.
func (*EdgeClusterConfig) SetNativeK8SOrchestration ¶
func (cc *EdgeClusterConfig) SetNativeK8SOrchestration(enabled bool)
SetNativeK8SOrchestration enables native Kubernetes orchestration of user workloads ("base mode"), the opt-in that replaced CLUSTER_TYPE_K3S_BASE: EVE then serves EVE-API-scheduled and natively-applied workloads side by side.
The EVE API only accepts it on CLUSTER_TYPE_REPLICATED_STORAGE, so any other type fails here rather than being rejected by EVE. AddNode inherits it.
func (*EdgeClusterConfig) SetRegistrationManifest ¶
func (cc *EdgeClusterConfig) SetRegistrationManifest(manifestYAML []byte)
SetRegistrationManifest attaches a manifest for the cluster to apply to itself once up -- how a controller registers an EVE-K cluster.
It shares the join token's cipher block, so this re-encrypts that block for every node. Only the bootstrap node acts on it: zedkube writes /persist/vault/manifests/registration.yaml, kube-init stages it into the k3s server-manifests dir, and k3s applies it as the "persist-registration" AddOn.
Pass nil to remove it. AddNode inherits whatever is set at that point.
func (*EdgeClusterConfig) SetWitness ¶
func (cc *EdgeClusterConfig) SetWitness(witnessIP net.IP)
SetWitness configures the 2-node-HA witness's virtual etcd IP on every device's cluster config. The witness always co-locates with whichever device currently owns JoinServerIp - there is no separate placement field (matches config.EdgeNodeClusterWitness's design).
func (*EdgeClusterConfig) UpdateApplication ¶
func (cc *EdgeClusterConfig) UpdateApplication( appUUID uuid.UUID, newConfig ClusterApplicationInstanceConfig)
UpdateApplication updates an application on all devices. DesignatedNodeName is resolved to the device UUID and updated on the AppInstanceConfig, Volume and ContentTree, along with the Affinity field.
func (*EdgeClusterConfig) UpdateNetwork ¶
func (cc *EdgeClusterConfig) UpdateNetwork(networkUUID uuid.UUID, newConfig NetworkConfig)
UpdateNetwork updates an existing network on all devices.
func (*EdgeClusterConfig) UpdateNetworkAdapter ¶
func (cc *EdgeClusterConfig) UpdateNetworkAdapter(config NetworkAdapterConfig)
UpdateNetworkAdapter updates a network adapter on all devices.
func (*EdgeClusterConfig) UpdateNetworkInstance ¶
func (cc *EdgeClusterConfig) UpdateNetworkInstance( niUUID uuid.UUID, newConfig NetworkInstanceConfig)
UpdateNetworkInstance updates a network instance on all devices.
func (*EdgeClusterConfig) UpdateSCEPProfile ¶
func (cc *EdgeClusterConfig) UpdateSCEPProfile(profile SCEPProfile)
UpdateSCEPProfile updates a SCEP profile on all devices.
func (*EdgeClusterConfig) UpdateVLANSubinterface ¶
func (cc *EdgeClusterConfig) UpdateVLANSubinterface(config VLANSubinterfaceConfig)
UpdateVLANSubinterface updates a VLAN sub-interface on all devices.
type EdgeDevice ¶
type EdgeDevice struct {
// contains filtered or unexported fields
}
EdgeDevice represents a single onboarded EVE device and provides operations to manage its lifecycle, configuration, applications, and runtime state.
func GetAllEdgeDevices ¶
func GetAllEdgeDevices() (devices []*EdgeDevice)
GetAllEdgeDevices returns handles for all EdgeDevices currently known to the test th.
func GetEdgeDevice ¶
func GetEdgeDevice(devName string) *EdgeDevice
GetEdgeDevice returns a handle to an onboarded EdgeDevice identified by devName.
func (*EdgeDevice) ActivateApplication ¶
func (d *EdgeDevice) ActivateApplication(appUUID uuid.UUID, waitUntilActivated bool, timeout time.Duration)
ActivateApplication activates the specified application instance.
func (*EdgeDevice) ApplyConfig ¶
func (d *EdgeDevice) ApplyConfig(config *EdgeDeviceConfig, waitUntilFetched bool, waitUntilConfirmed bool)
ApplyConfig applies a device configuration and optionally waits for confirmation that it was received and/or processed by the device.
If waitUntilFetched is true, the function blocks until EVE fetches the new config from the controller. This is reliable even when the config changes the management port, because EVE downloads the config before activating the new port — the wait completes while connectivity is still intact.
If waitUntilConfirmed is true, the function additionally waits until EVE reports LastProcessedConfig >= the config's timestamp in device metrics, which indicates that zedagent has parsed the config and distributed it to other microservices. Do not combine this with configs that change the management port: the device may lose controller connectivity right after applying the change, delaying the metrics publish indefinitely. While a reboot declared with ExpectAdditionalReboots has not been observed yet, the wait is extended by the reboot timeout, since such a config is often confirmed only after the device boots again.
The two flags are evaluated in order: fetch first, then confirm.
func (*EdgeDevice) AttachUSBHub ¶
func (d *EdgeDevice) AttachUSBHub(id, parentHubID string) string
AttachUSBHub plugs a QEMU usb-hub into the running device, into the lowest free port of the hub parentHubID, or of the xHCI controller when that is "", and returns its port path, e.g. "1" or "1.2". Hubs and drives plugged into it name it by id (AttachUSBHub, AttachUSBStorageBehind). The hub is a full-speed USB 1.1 hub with eight ports, so Linux enumerates it and everything below it on the controller's USB 2 bus, and QEMU accepts chains of up to five hubs. Fails the test on error.
Requires RequireCapabilities{CAPABILITY_QMP}.
func (*EdgeDevice) AttachUSBStorage ¶
func (d *EdgeDevice) AttachUSBStorage(id string, sizeBytes uint64) string
AttachUSBStorage plugs a blank USB flash drive of the given size into the running device: a scratch image on the hypervisor host, a raw block node on top of it and a usb-storage device on the VM's xHCI controller (USBControllerBus). id is the QEMU device id, the block node name, the scratch image name and the drive's USB serial number, so that ListUSBDevices finds the drive with FindBySerial(id). Fails the test on error, undoing the steps already done.
The drive goes into the lowest free port of the controller, and a drive re-plugged under the same id goes back into the port it left while that is free (see usbPortAllocator), like a physical re-plug into the same receptacle; a device-model entry claiming it by bus and port thus keeps matching. The controller has four ports on both providers. Returns the port, e.g. "2".
Requires RequireCapabilities{CAPABILITY_QMP}.
func (*EdgeDevice) AttachUSBStorageBehind ¶
func (d *EdgeDevice) AttachUSBStorageBehind(hubID, id string, sizeBytes uint64) string
AttachUSBStorageBehind is AttachUSBStorage into the lowest free port of the hub hubID (see AttachUSBHub) instead of the controller. Returns the drive's port path, e.g. "2.1" for the first port of a hub in port 2.
func (*EdgeDevice) ConsoleOutput ¶
func (d *EdgeDevice) ConsoleOutput() (string, error)
ConsoleOutput returns everything the device has written to its serial console so far in this test. The console log is opened in append mode, so output from earlier boots is still present: this is the only way a test can see what ran before pillar started, which is where storage-init and the offline resizer live. Returns an error rather than failing the test, so a caller can treat missing console output as inconclusive rather than fatal.
func (*EdgeDevice) CreatePersistPartition ¶
func (d *EdgeDevice) CreatePersistPartition(extraDiskIdx uint)
CreatePersistPartition writes a fresh GPT on the extraDiskIdx-th extra disk (see RequireEdgeDevice.ExtraDisks), with a single partition spanning it, typed and named as EVE's /persist.
This is how a test gives a device a /persist on a disk of its own. Pair it with DeletePartition("P3") on the boot disk: EVE locates /persist by partition label across every disk, so with the boot disk's copy gone it adopts this one, and the space freed on the boot disk becomes a tail an in-field repartition can grow into.
The partition is left unformatted, and EVE formats it on the next boot just as it would a factory-fresh disk -- so the filesystem under test is EVE's own, not a lookalike built by the harness.
The device must be powered off (PowerOff), and the test must have declared RequireCapabilities{CAPABILITY_EDIT_DEVICE_DISK}.
func (*EdgeDevice) CreateScratchImage ¶
func (d *EdgeDevice) CreateScratchImage(name string, sizeBytes uint64) string
CreateScratchImage creates a blank, sparse raw disk image of the given size for the device on the hypervisor host and returns its path there, for use in QMP commands such as blockdev-add. name identifies the image within the device for DeleteScratchImage; it must follow QEMU's id rules (a letter followed by up to 30 letters, digits, '-' or '_'), so that it can double as block node name and device id. The image is removed with the device at the latest.
Requires RequireCapabilities{CAPABILITY_QMP}.
func (*EdgeDevice) DeactivateApplication ¶
func (d *EdgeDevice) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
DeactivateApplication deactivates the specified application instance.
func (*EdgeDevice) DeleteFile ¶
func (d *EdgeDevice) DeleteFile(fileName string)
DeleteFile removes a file from the device.
func (*EdgeDevice) DeletePartition ¶
func (d *EdgeDevice) DeletePartition(partitionLabel string)
DeletePartition removes the named GPT partition (e.g. "P3", EVE's /persist) from the device's boot disk, leaving the space it occupied unallocated.
Distinct from DestroyPartitionFilesystem, which keeps the partition and only ruins its contents: this removes the partition itself, so EVE does not find one at all and looks elsewhere.
The device must be powered off (PowerOff), and the test must have declared RequireCapabilities{CAPABILITY_EDIT_DEVICE_DISK}.
func (*EdgeDevice) DeleteScratchImage ¶
func (d *EdgeDevice) DeleteScratchImage(name string)
DeleteScratchImage removes an image created by CreateScratchImage.
func (*EdgeDevice) DestroyPartitionFilesystem ¶
func (d *EdgeDevice) DestroyPartitionFilesystem(partitionLabel string)
DestroyPartitionFilesystem makes the filesystem on the named GPT partition (e.g. "P3", EVE's /persist) unrecoverable, so that EVE reformats it on the next boot. The partition table is left intact, which is the state a real filesystem loss leaves behind.
The device must be powered off (PowerOff), and the test must have declared RequireCapabilities{CAPABILITY_EDIT_DEVICE_DISK}.
func (*EdgeDevice) DetachUSBHub ¶
func (d *EdgeDevice) DetachUSBHub(id string)
DetachUSBHub unplugs a hub attached by AttachUSBHub. Everything plugged into it has to be detached first: QEMU would take it down together with the hub, but the block nodes and scratch images of drives would stay behind.
func (*EdgeDevice) DetachUSBStorage ¶
func (d *EdgeDevice) DetachUSBStorage(id string)
DetachUSBStorage unplugs a drive attached by AttachUSBStorage and deletes its image. device_del completes asynchronously, so releasing the block node is retried for a short while.
func (*EdgeDevice) DialViaSSH ¶
func (d *EdgeDevice) DialViaSSH(network, address string) (net.Conn, error)
DialViaSSH opens a TCP connection to address, tunneled through an SSH connection to this device (an SSH direct-tcpip channel), as if address is dialed from the device itself. Useful for reaching services that only listen on the device's own loopback interface, e.g. the Kubevirt VNC proxy gated by ApplicationInstanceConfig.RemoteConsole.
func (*EdgeDevice) DisableRebootAccounting ¶
func (d *EdgeDevice) DisableRebootAccounting(reason string)
DisableRebootAccounting stops the teardown check that a device's observed reboot count matches the expected one, recording why.
A hard power-cycle is what this exists for. Following one the device sometimes republishes the reboot time the harness counts from and sometimes does not (see PowerOn), so the same test lands on different counts from run to run and no fixed declaration can be right. Use it only where the count is genuinely unknowable; a test whose reboots are merely more numerous than the harness assumes should declare them with ExpectAdditionalReboots instead.
func (*EdgeDevice) ExecuteQMP ¶
func (d *EdgeDevice) ExecuteQMP(execute string, arguments any) json.RawMessage
ExecuteQMP runs one QMP command on the hypervisor running the device and returns the command's "return" member ("{}" for a command that returns nothing). arguments is marshaled into the command's "arguments" object: a map, a struct, or nil for a command without arguments. The test fails if the command is refused or cannot be delivered; see TryExecuteQMP for callers that expect refusals.
Power control belongs to PowerOff, PowerOn and HardReboot, which keep the broker's view of the device in step; QMP commands such as quit or system_powerdown bypass that.
Requires RequireCapabilities{CAPABILITY_QMP}.
func (*EdgeDevice) ExpectAdditionalReboots ¶
func (d *EdgeDevice) ExpectAdditionalReboots(count int)
ExpectAdditionalReboots declares that the device will reboot count more times on its own, as a required consequence of a configuration change rather than at the test's request.
Additional, because it adds to the running total rather than stating what the total should be: the framework's own reboot-driven flows have already contributed to it.
Close audits observed reboots against expected ones, so a reboot EVE performs by design is reported as a failure unless it is declared. The reboot-driven flows the framework itself drives (RequestReboot, SoftReboot, HardReboot, UpgradeEVE) declare their own; this is for flows where the trigger is a config change and the reboot is EVE's chosen means of carrying it out — converting a cluster member back to a single node, for instance, which reboots to restore the pre-cluster /var/lib before k3s starts.
Declare it before applying the config that causes it: the audit only compares totals, but a declaration that races the observation reads as an accident in the log.
A cross-flavor boot-disk conversion is the other case: it runs an offline shrink/grow across more reboots than UpgradeEVE accounts for, and how many is known only to the test driving it, since a plain kvm<->k conversion with no resize reboots differently than a shrink+grow.
func (*EdgeDevice) FileExists ¶
func (d *EdgeDevice) FileExists(fileName string) bool
FileExists checks whether a file exists on the device.
func (*EdgeDevice) GetAppDNSLogs ¶
func (d *EdgeDevice) GetAppDNSLogs( appUUID uuid.UUID, match DNSLogMatch) []*eveflowlog.DnsRequest
GetAppDNSLogs returns DNS request logs for the specified application matching the provided criteria.
func (*EdgeDevice) GetAppFlowLogs ¶
func (d *EdgeDevice) GetAppFlowLogs( appUUID uuid.UUID, match FlowLogMatch) []*eveflowlog.FlowRecord
GetAppFlowLogs returns flow records for the specified application matching the provided criteria.
func (*EdgeDevice) GetAppInfo ¶
func (d *EdgeDevice) GetAppInfo(appUUID uuid.UUID) *eveinfo.ZInfoApp
GetAppInfo returns the last recorded runtime information for the specified application, or nil if no info message for that app has been received yet.
func (*EdgeDevice) GetAppLogs ¶
func (d *EdgeDevice) GetAppLogs(appUUID uuid.UUID, match LogMsgMatch) []LogMsg
GetAppLogs returns application log messages matching the provided criteria.
func (*EdgeDevice) GetAppMetadata ¶
func (d *EdgeDevice) GetAppMetadata(appUUID uuid.UUID) *eveinfo.ZInfoAppInstMetaData
GetAppMetadata returns the last recorded metadata associated with the specified application instance, or nil if none has been received yet.
func (*EdgeDevice) GetAppMetrics ¶
func (d *EdgeDevice) GetAppMetrics(appUUID uuid.UUID) *evemetrics.AppMetric
GetAppMetrics returns the last recorded metrics for the specified application, or nil if no metrics message for that app has been received yet.
func (*EdgeDevice) GetArch ¶
func (d *EdgeDevice) GetArch() string
GetArch returns the CPU architecture of the device ("amd64" or "arm64"), as determined during Setup (see TestHarness.selectArch) -- not merely the preferred architecture requested via EVETEST_PREFERRED_ARCH, which can differ from the device's actual one on a broker that does not support it (selectArch falls back to whatever the broker does support).
func (*EdgeDevice) GetBlobInfo ¶
func (d *EdgeDevice) GetBlobInfo() *eveinfo.ZInfoBlobList
GetBlobInfo returns the last recorded information about stored blobs on the device, or nil if no blob info message has been received yet.
func (*EdgeDevice) GetClusterInfo ¶
func (d *EdgeDevice) GetClusterInfo() (*eveinfo.ZInfoKubeCluster, time.Time)
GetClusterInfo returns the last recorded information about the Kubernetes cluster and the time the device stamped it, so that snapshots from different devices can be ordered. Returns nil and a zero time if no such info message has been received yet.
The snapshot may be arbitrarily old: only the elected leader publishes cluster info, so a device that has lost the election (or has been powered off) keeps reporting whatever it last sent, indefinitely.
func (*EdgeDevice) GetClusterMetrics ¶
func (d *EdgeDevice) GetClusterMetrics() *evemetrics.KubeClusterMetrics
GetClusterMetrics returns the last recorded metrics for the Kubernetes cluster, or nil if no cluster metrics message has been received yet.
func (*EdgeDevice) GetClusterUpdateInfo ¶
func (d *EdgeDevice) GetClusterUpdateInfo() *eveinfo.ZInfoKubeClusterUpdateStatus
GetClusterUpdateInfo returns the last recorded information regarding the Kubernetes cluster update, or nil if no such info message has been received yet.
func (*EdgeDevice) GetConfig ¶
func (d *EdgeDevice) GetConfig() *EdgeDeviceConfig
GetConfig returns the current device configuration.
func (*EdgeDevice) GetContentTreeInfo ¶
func (d *EdgeDevice) GetContentTreeInfo(ctUUID uuid.UUID) *eveinfo.ZInfoContentTree
GetContentTreeInfo returns the last recorded information about the specified content tree, or nil if no info message for it has been received yet.
func (*EdgeDevice) GetDeviceIPAddress ¶
func (d *EdgeDevice) GetDeviceIPAddress(netAdapterLogicalLabel string) []net.IP
GetDeviceIPAddress returns IP addresses assigned to the specified network adapter. If netAdapterLogicalLabel is empty, IP addresses from all adapters are returned.
func (*EdgeDevice) GetDeviceInfo ¶
func (d *EdgeDevice) GetDeviceInfo() *eveinfo.ZInfoDevice
GetDeviceInfo returns the last recorded device information, or nil if no info message has been received yet.
func (*EdgeDevice) GetDeviceMetrics ¶
func (d *EdgeDevice) GetDeviceMetrics() *evemetrics.DeviceMetric
GetDeviceMetrics returns the last recorded device-level metrics, or nil if no metrics message has been received yet.
func (*EdgeDevice) GetHardwareInfo ¶
func (d *EdgeDevice) GetHardwareInfo() *eveinfo.ZInfoHardware
GetHardwareInfo returns the last recorded hardware inventory information, or nil if no hardware info message has been received yet.
func (*EdgeDevice) GetLocationInfo ¶
func (d *EdgeDevice) GetLocationInfo() *eveinfo.ZInfoLocation
GetLocationInfo returns the last recorded device location information, or nil if no location info message has been received yet.
func (*EdgeDevice) GetLogs ¶
func (d *EdgeDevice) GetLogs(match LogMsgMatch) []LogMsg
GetLogs returns device log messages matching the provided criteria.
func (*EdgeDevice) GetNTPSources ¶
func (d *EdgeDevice) GetNTPSources() *eveinfo.ZInfoNTPSources
GetNTPSources returns the last recorded NTP sources configured on the device, or nil if no NTP sources info message has been received yet.
func (*EdgeDevice) GetNetworkInstanceInfo ¶
func (d *EdgeDevice) GetNetworkInstanceInfo(niUUID uuid.UUID) *eveinfo.ZInfoNetworkInstance
GetNetworkInstanceInfo returns the last recorded information about the specified network instance, or nil if no info message for it has been received yet.
func (*EdgeDevice) GetNetworkInstanceMetrics ¶
func (d *EdgeDevice) GetNetworkInstanceMetrics( niUUID uuid.UUID) *evemetrics.ZMetricNetworkInstance
GetNetworkInstanceMetrics returns the last recorded metrics for the specified network instance, or nil if no metrics message for it has been received yet.
func (*EdgeDevice) GetState ¶
func (d *EdgeDevice) GetState() api.EVEDeviceState
GetState returns the current lifecycle state of the device.
func (*EdgeDevice) GetVolumeInfo ¶
func (d *EdgeDevice) GetVolumeInfo(volumeUUID uuid.UUID) *eveinfo.ZInfoVolume
GetVolumeInfo returns the last recorded information about the specified storage volume, or nil if no info message for it has been received yet.
func (*EdgeDevice) GetVolumeMetrics ¶
func (d *EdgeDevice) GetVolumeMetrics(volumeUUID uuid.UUID) *evemetrics.ZMetricVolume
GetVolumeMetrics returns the last recorded metrics for the specified storage volume, or nil if no metrics message for it has been received yet.
func (*EdgeDevice) GrowDisk ¶
func (d *EdgeDevice) GrowDisk(newSizeBytes uint64)
GrowDisk enlarges the device's boot disk to newSizeBytes, leaving the added space unallocated past the last partition rather than extending any partition into it.
That free tail is the precondition for EVE's in-field repartition to grow into slack instead of shrinking /persist to make room, and it cannot be arranged at device creation: EVE's own image generator sizes the partitions to fill whatever disk it is given.
The device must be powered off (PowerOff), and the test must have declared RequireCapabilities{CAPABILITY_EDIT_DEVICE_DISK}.
func (*EdgeDevice) HardReboot ¶
func (d *EdgeDevice) HardReboot(waitUntilRebooted bool)
HardReboot triggers device reboot through the broker.
func (*EdgeDevice) KubectlListNames ¶
func (d *EdgeDevice) KubectlListNames(resource string) ([]string, error)
KubectlListNames returns the name of every object of one resource type in the EVE app namespace. An error means the device was unreachable, k3s was down, or the output did not parse. A caller in Eventually must retry each of these.
func (*EdgeDevice) ListAppVMIRS ¶
ListAppVMIRS returns the sorted names of every VMIRS belonging to appUUID, whichever purge generation each one is. A VMIRS name embeds the app's purge counter (base.GetAppKubeNameWithPurge), which makes this the one vantage point from which a stale generation surviving a purge is observable at all: pillar's own DomainStatus is keyed by app UUID and so can only ever describe one of them.
Attribution is by the appDomainNameLabel selector rather than the name, since the label value also carries a version and an appnum that do not matter here. An empty list with a nil error means the app has no VMIRS; an error means the list could not be read, which a caller inside an Eventually should retry rather than fail on.
func (*EdgeDevice) ListDirEntries ¶
func (d *EdgeDevice) ListDirEntries(dir string) ([]string, error)
ListDirEntries returns the sorted names of the entries in a directory on the device.
A directory that does not exist yields an empty list and no error: EVE creates many of its directories lazily, when a particular hypervisor, storage backend or agent first needs one, so "not there yet" is a normal observation rather than a failure. An error means the listing itself could not be run.
func (*EdgeDevice) ListUSBDevices ¶
func (d *EdgeDevice) ListUSBDevices() (USBDeviceList, error)
ListUSBDevices returns the USB devices EVE sees, read from /sys/bus/usb/devices over SSH. It returns an error instead of failing the test, so it can be polled from Eventually while a device is still enumerating.
func (*EdgeDevice) ListUSBDevicesInsideApp ¶
func (d *EdgeDevice) ListUSBDevicesInsideApp(appUUID uuid.UUID, auth AuthMethod) (USBDeviceList, error)
ListUSBDevicesInsideApp is ListUSBDevices for the guest of an application: the USB devices its kernel enumerates, read over SSH into the application (see RunShellScriptInsideApp for how it is reached). A device passed through from EVE shows up here with the ids and serial number it has on EVE, but on the guest's own bus and port.
func (*EdgeDevice) PathExists ¶
func (d *EdgeDevice) PathExists(target string) (bool, error)
PathExists checks whether a path exists on the device, whatever kind of node it is - a directory, a symlink or a device node, not just a regular file.
Two differences from FileExists, which is otherwise equivalent: this accepts any node type, and it reports a failure of the check itself as an error instead of failing the test. That makes it usable from inside Eventually, where a device may be rebooting or still converging and the caller wants to retry rather than fail.
func (*EdgeDevice) PowerOff ¶
func (d *EdgeDevice) PowerOff()
PowerOff hard-powers off the device through the broker (bypassing any graceful ACPI shutdown). The broker RPC blocks until the provider confirms the VM is stopped, so no separate wait parameter is needed.
func (*EdgeDevice) PowerOn ¶
func (d *EdgeDevice) PowerOn(waitUntilOnline bool)
PowerOn powers the device back on through the broker and optionally waits until it boots and reports back to the controller.
TODO: following a true hard power-off, nodeagent does not reliably republish an updated ZInfoDevice.LastRebootTime (the reboot-reason detection that rebootAndWait's wait relies on appears to assume a cooperative in-place OS reboot, not an external power-cycle). Until that's root-caused on the EVE side, pass waitUntilOnline=false here and confirm recovery some other way (e.g. via WaitUntilAppIsRunning on the relevant apps).
func (*EdgeDevice) PrepareShutdown ¶
func (d *EdgeDevice) PrepareShutdown()
PrepareShutdown signals a graceful shutdown via EdgeDevConfig.Shutdown: pillar deactivates every app instance on the device in response. Unlike Reboot/PowerOff, this has no power effect of its own -- the device stays up, which is why callers pair it with a separate power-off step.
func (*EdgeDevice) PurgeApplication ¶
func (d *EdgeDevice) PurgeApplication(appUUID uuid.UUID, volumeGen VolumeGenerationPolicy, waitUntilPurged bool, timeout time.Duration)
PurgeApplication purges the specified application instance and its state. See VolumeGenerationPolicy for volumeGen.
func (*EdgeDevice) ReachableAddress ¶
func (d *EdgeDevice) ReachableAddress(port uint16) (string, error)
ReachableAddress returns the host:port through which the given TCP port of the device can be reached from the test process, for handing an endpoint of the device, such as its SSH port, to a tool the test runs.
func (*EdgeDevice) ReadFile ¶
func (d *EdgeDevice) ReadFile(fileName string) ([]byte, error)
ReadFile reads the contents of a file from the device.
func (*EdgeDevice) RebootApplication ¶
func (d *EdgeDevice) RebootApplication(appUUID uuid.UUID, waitUntilRebooted bool, timeout time.Duration)
RebootApplication requests a reboot of the specified application instance.
func (*EdgeDevice) RequestReboot ¶
func (d *EdgeDevice) RequestReboot(waitUntilFetched bool, waitUntilRebooted bool)
RequestReboot requests a device reboot via configuration.
If waitUntilFetched is true, the function blocks until the device has fetched the config carrying the incremented reboot counter, so the caller knows the request reached the device before, e.g., cutting its connectivity. If waitUntilRebooted is true, it additionally waits until the reboot completes; see rebootAndWait.
func (*EdgeDevice) RequestRefusedEVEUpgrade ¶
func (d *EdgeDevice) RequestRefusedEVEUpgrade(targetEVEVersion string, targetEVEHypervisor Hypervisor, datastoreType BaseOSDatastoreType)
RequestRefusedEVEUpgrade applies a base-OS update that EVE is expected to reject outright, and returns as soon as the configuration is applied.
A rejection is not a failed upgrade. EVE refuses in place -- before it writes a partition and before it reboots -- so there is nothing to wait for and no reboot to account for, which is what separates this from UpgradeEVE's expectRevert: that one waits out two reboots for an image that was installed and then rolled back. What the rejection looks like is the caller's to assert: the reported error, and that the device is still running what it was.
func (*EdgeDevice) RunKubectl ¶
RunKubectl runs kubectl on the device with the given arguments and returns its trimmed standard output. The call goes through "eve exec kube" because kubectl exists only in the kube container, so the device has to be an EVE-K node.
The returned error carries kubectl's own standard error, which says why the command was refused. A caller polling a cluster that is still coming up should treat any error as a retryable "not yet": kubectl fails this way while k3s is starting, and that is indistinguishable here from a real refusal.
func (*EdgeDevice) RunShellScript ¶
func (d *EdgeDevice) RunShellScript(script string, timeout time.Duration, stdoutWatchdogTimeout time.Duration) (stdout, stderr string, err error)
RunShellScript executes the provided shell script on the device over SSH and returns its standard output and standard error as strings.
If timeout is non-zero, execution is bounded by the given duration and will be canceled if the timeout expires. If timeout is zero, no explicit deadline is applied.
If stdoutWatchdogTimeout is non-zero, the script will be terminated if it produces no output on stdout for longer than the specified duration. This acts as a "watchdog" to detect stalled scripts.
func (*EdgeDevice) RunShellScriptInsideApp ¶
func (d *EdgeDevice) RunShellScriptInsideApp(appUUID uuid.UUID, auth AuthMethod, script string, timeout time.Duration, stdoutWatchdogTimeout time.Duration) (stdout, stderr string, err error)
RunShellScriptInsideApp executes a shell script inside an application instance over SSH and returns its standard output and standard error.
The method discovers SSH endpoints for the application by inspecting:
- Port-forwarding ACL rules (port 22 mapped through a local network instance) -- the device IP on the uplink adapter plus the external port.
- Switch network instance interfaces -- the app IP at port 22 (directly bridged, reachable on the SDN network).
- RoutesTowardsEve entries in the SDN network model -- if any SDN network's router has a route towards the EVE device that covers a VIF's IP, that IP:22 is tried. This makes air-gap NI apps reachable once the app acting as their gateway has IP forwarding enabled.
auth specifies how to authenticate with the application's SSH server (username/password or client certificate). timeout and stdoutWatchdogTimeout behave the same as in RunShellScript.
func (*EdgeDevice) SoftReboot ¶
func (d *EdgeDevice) SoftReboot(waitUntilRebooted bool)
SoftReboot reboots the device from the console/SSH.
func (*EdgeDevice) SyncDisks ¶
func (d *EdgeDevice) SyncDisks()
SyncDisks flushes the device's filesystem caches. Call this before PowerOff: test devices mount /persist without dirsync (Setup adds set_no_dirsync), so a hard power-off can otherwise leave an app's image layers as zero-length files.
func (*EdgeDevice) TryExecuteQMP ¶
func (d *EdgeDevice) TryExecuteQMP(execute string, arguments any) (json.RawMessage, error)
TryExecuteQMP is ExecuteQMP returning the error instead of failing the test, for commands whose refusal is an expected outcome, e.g. blockdev-del while the node is still in use by a device being unplugged.
func (*EdgeDevice) UnexpectedRebootCount ¶
func (d *EdgeDevice) UnexpectedRebootCount() int
UnexpectedRebootCount is how many times the device has been seen rebooting beyond what the test asked for (RequestReboot, SoftReboot, HardReboot, UpgradeEVE, ExpectAdditionalReboots): the same count Close audits at the end of every test, exposed so that a test waiting for something a crash would prevent can fail at once, naming the cause, instead of waiting out its timeout. A reboot is recognized from the boot time the device reports in its info messages, so it registers once the device is back up and talking to the controller, not at the moment it goes down.
func (*EdgeDevice) UpgradeEVE ¶
func (d *EdgeDevice) UpgradeEVE(targetEVEVersion string, targetEVEHypervisor Hypervisor, datastoreType BaseOSDatastoreType, waitUntilUpgraded bool, expectRevert bool, timeout ...time.Duration)
UpgradeEVE upgrades the EVE OS to the specified version and optionally waits until the upgrade completes or reverts. datastoreType selects how the target rootfs is delivered to the device -- see BaseOSDatastoreType. When expectRevert is true, the upgrade is expected to fail and EVE to revert to the previous version -- the function then waits for the target version to show a FAILED status instead of waiting for it to become active. A reverted upgrade causes two reboots (one to try the new version, one to revert), so the expected reboot count is incremented accordingly.
An optional timeout bounds the wait instead of the default, which is sized for an ordinary base-OS upgrade: download, one reboot, done. A cross-flavor boot-disk conversion is a different animal -- it also runs an offline shrink+grow across several reboots and then brings up a whole container-cluster stack -- and it lands close enough to the default that a healthy conversion and an expired budget are separated by a couple of minutes of host load. A test driving one should pass a longer timeout, otherwise it reports a conversion that was still progressing as a failure.
func (*EdgeDevice) WaitForClusterNodeIsReady ¶
func (d *EdgeDevice) WaitForClusterNodeIsReady(timeout time.Duration)
WaitForClusterNodeIsReady waits until this device's own ZInfoKubeCluster report shows this device as a Ready node with healthy cluster storage.
Only the elected leader node publishes cluster info, so this is only meaningful when called on a single-node cluster (where the sole device is necessarily the leader) or on a device already known to be the leader; for a multi-node cluster where the leader isn't known in advance, use EdgeCluster.WaitUntilNodesAreReady instead.
It accepts the last report already received, which after a reboot can predate it. See EdgeCluster.WaitForFreshNodesReady. A report for another cluster, such as one a reused device sent during the previous test, is never accepted (see clusterReportMatches).
func (*EdgeDevice) WaitForUSBDevice ¶
func (d *EdgeDevice) WaitForUSBDevice(t gomega.Gomega, serial string, timeout, polling time.Duration) *USBDeviceInfo
WaitForUSBDevice polls ListUSBDevices until a device with the serial number is enumerated and returns it, failing the test through t if timeout passes first. A listing error counts as not enumerated yet and is retried.
func (*EdgeDevice) WaitUntilAppIsRunning ¶
func (d *EdgeDevice) WaitUntilAppIsRunning( appUUID uuid.UUID, timeoutExcludingDownload time.Duration)
WaitUntilAppIsRunning waits until the specified application reaches the running state or fails.
Safe to call even if the app already has RUNNING history from an earlier phase: it subscribes to live updates before checking the current snapshot, so a stale historical record can never be mistaken for a new transition.
timeoutExcludingDownload is the maximum time to wait excluding any period spent actively downloading (i.e. in DOWNLOAD_STARTED state with advancing progress). If a download stalls for downloadStalledTimeout the function fails immediately regardless of this timeout.
func (*EdgeDevice) WaitUntilHasControllerCert ¶
func (d *EdgeDevice) WaitUntilHasControllerCert( certType evecerts.ZCertType, certPEM []byte, timeout time.Duration)
WaitUntilHasControllerCert blocks until the device publishes the given controller certificate of the given type.
The device side is the only place this can be observed: /certs is an unauthenticated pull carrying no device UUID, so the controller does not even record the request, and the device never acknowledges which certificates it accepted. The ControllerCert publication is ephemeral (/run), which makes the observation inherently fresh across a reboot.
Certificates are matched on the PEM rather than on the hash, because the hash is truncated on its way to the device (Adam serves only the first 16 bytes, flagged SHA256_16BYTES) and comparing lengths that differ by truncation is easy to get wrong. The PEM is compared trimmed, matching Adam's own normalization. The type is part of the match because a certificate is only ever meaningful for the role it was served under.
func (*EdgeDevice) WatchAppInfo ¶
func (d *EdgeDevice) WatchAppInfo( appUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoApp, stop func())
WatchAppInfo subscribes to info updates for the specified application and returns a buffered channel that receives each new ZInfoApp as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchAppMetadata ¶
func (d *EdgeDevice) WatchAppMetadata( appUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoAppInstMetaData, stop func())
WatchAppMetadata subscribes to metadata updates for the specified application instance and returns a buffered channel that receives each new ZInfoAppInstMetaData as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchAppMetrics ¶
func (d *EdgeDevice) WatchAppMetrics( appUUID uuid.UUID) (updates <-chan *evemetrics.AppMetric, stop func())
WatchAppMetrics subscribes to metrics updates for the specified application and returns a buffered channel that receives each new AppMetric as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchBlobInfo ¶
func (d *EdgeDevice) WatchBlobInfo() (updates <-chan *eveinfo.ZInfoBlobList, stop func())
WatchBlobInfo subscribes to blob info updates and returns a buffered channel that receives each new ZInfoBlobList as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchClusterInfo ¶
func (d *EdgeDevice) WatchClusterInfo() ( updates <-chan *eveinfo.ZInfoKubeCluster, stop func())
WatchClusterInfo subscribes to Kubernetes cluster info updates and returns a buffered channel that receives each new ZInfoKubeCluster as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchClusterMetrics ¶
func (d *EdgeDevice) WatchClusterMetrics() ( updates <-chan *evemetrics.KubeClusterMetrics, stop func())
WatchClusterMetrics subscribes to Kubernetes cluster metrics updates and returns a buffered channel that receives each new KubeClusterMetrics as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchClusterUpdateInfo ¶
func (d *EdgeDevice) WatchClusterUpdateInfo() ( updates <-chan *eveinfo.ZInfoKubeClusterUpdateStatus, stop func())
WatchClusterUpdateInfo subscribes to Kubernetes cluster-update info messages and returns a buffered channel that receives each new ZInfoKubeClusterUpdateStatus as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchContentTreeInfo ¶
func (d *EdgeDevice) WatchContentTreeInfo( ctUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoContentTree, stop func())
WatchContentTreeInfo subscribes to info updates for the specified content tree and returns a buffered channel that receives each new ZInfoContentTree as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchDeviceInfo ¶
func (d *EdgeDevice) WatchDeviceInfo() (updates <-chan *eveinfo.ZInfoDevice, stop func())
WatchDeviceInfo subscribes to device info updates and returns a buffered channel that receives each new ZInfoDevice as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchDeviceMetrics ¶
func (d *EdgeDevice) WatchDeviceMetrics() ( updates <-chan *evemetrics.DeviceMetric, stop func())
WatchDeviceMetrics subscribes to device-level metrics updates and returns a buffered channel that receives each new DeviceMetric as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchForCrash ¶
func (d *EdgeDevice) WatchForCrash() *CrashWatch
WatchForCrash starts a CrashWatch on the device. Call Stop when done.
func (*EdgeDevice) WatchHardwareInfo ¶
func (d *EdgeDevice) WatchHardwareInfo() ( updates <-chan *eveinfo.ZInfoHardware, stop func())
WatchHardwareInfo subscribes to hardware info updates and returns a buffered channel that receives each new ZInfoHardware as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchLocationInfo ¶
func (d *EdgeDevice) WatchLocationInfo() ( updates <-chan *eveinfo.ZInfoLocation, stop func())
WatchLocationInfo subscribes to location info updates and returns a buffered channel that receives each new ZInfoLocation as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchLogs ¶
func (d *EdgeDevice) WatchLogs(match LogMsgMatch) (logs <-chan LogMsg, stop func())
WatchLogs subscribes to device log entries and returns a buffered channel that receives each new matching LogMsg as it arrives. Call the returned stop function to unsubscribe and close the channel.
func (*EdgeDevice) WatchNTPSources ¶
func (d *EdgeDevice) WatchNTPSources() ( updates <-chan *eveinfo.ZInfoNTPSources, stop func())
WatchNTPSources subscribes to NTP sources updates and returns a buffered channel that receives each new ZInfoNTPSources as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchNetworkInstanceInfo ¶
func (d *EdgeDevice) WatchNetworkInstanceInfo( niUUID uuid.UUID) (updates <-chan *eveinfo.ZInfoNetworkInstance, stop func())
WatchNetworkInstanceInfo subscribes to info updates for the specified network instance and returns a buffered channel that receives each new ZInfoNetworkInstance as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchNetworkInstanceMetrics ¶
func (d *EdgeDevice) WatchNetworkInstanceMetrics( niUUID uuid.UUID) (updates <-chan *evemetrics.ZMetricNetworkInstance, stop func())
WatchNetworkInstanceMetrics subscribes to metrics updates for the specified network instance and returns a buffered channel that receives each new ZMetricNetworkInstance as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchVolumeInfo ¶
func (d *EdgeDevice) WatchVolumeInfo(volumeUUID uuid.UUID) ( updates <-chan *eveinfo.ZInfoVolume, stop func())
WatchVolumeInfo subscribes to info updates for the specified storage volume and returns a buffered channel that receives each new ZInfoVolume as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WatchVolumeMetrics ¶
func (d *EdgeDevice) WatchVolumeMetrics( volumeUUID uuid.UUID) (updates <-chan *evemetrics.ZMetricVolume, stop func())
WatchVolumeMetrics subscribes to metrics updates for the specified storage volume and returns a buffered channel that receives each new ZMetricVolume as it arrives. Call the returned close function to stop watching and close the channel.
func (*EdgeDevice) WriteFile ¶
func (d *EdgeDevice) WriteFile(fileName string, content []byte)
WriteFile writes content to a file on the device.
type EdgeDeviceConfig ¶
type EdgeDeviceConfig struct {
*eveconfig.EdgeDevConfig
// contains filtered or unexported fields
}
EdgeDeviceConfig allows to build EdgeDevConfig. It provides some helper functions, but it is also possible to access the EdgeDevConfig directly (to maybe create and test invalid device config).
func NewEdgeDeviceConfig ¶
func NewEdgeDeviceConfig(devName string) *EdgeDeviceConfig
NewEdgeDeviceConfig constructs an EdgeDeviceConfig. When creating a configuration prior to Setup (e.g. for bootstrap), do not include secrets that require encryption in a CipherBlock (such as datastore credentials or application cloud-init metadata). These values must be added only after evetest.Setup completes and the device is onboarded, when cryptographic material for object-level encryption becomes available.
func (*EdgeDeviceConfig) AddApplication ¶
func (dc *EdgeDeviceConfig) AddApplication(config ApplicationInstanceConfig) uuid.UUID
AddApplication adds a new application instance to the device configuration and returns its generated UUID.
func (*EdgeDeviceConfig) AddBlankVolume ¶
func (dc *EdgeDeviceConfig) AddBlankVolume( displayName string, sizeBytes uint64, clearText bool) uuid.UUID
AddBlankVolume adds a standalone empty (VCOT_BLANK) volume of the requested size to the device configuration and returns its UUID.
A blank volume is created by volumemgr as an empty block device of the given size, with no content downloaded into it and no application reference required (volumemgr creates standalone volumes; see the VolumeConfig.HasNoAppReferences handling in volumemgr). On a device whose /persist is ZFS, a non-container, non-ISO volume is backed by a ZFS zvol whose "volsize" property equals sizeBytes (rounded up to the ZFS volblocksize). That volsize is the provisioned size volumemgr reports in AppDiskMetric.ProvisionedBytes, which zedagent surfaces to the controller as ZMetricVolume.TotalBytes and VolumeResources.MaxSizeBytes.
clearText selects whether the volume is created outside the vault. A clear-text volume can be created while the vault is still locked, which isolates a test from vault readiness; an encrypted one exercises the vault-dependent path instead. Tests that are not about encryption should say which they mean rather than relying on a default, since the choice changes what the volume creation actually exercises.
func (*EdgeDeviceConfig) AddBond ¶
func (dc *EdgeDeviceConfig) AddBond(config BondConfig)
AddBond adds a bond (link aggregation) interface to the device configuration.
func (*EdgeDeviceConfig) AddContentTree ¶
func (dc *EdgeDeviceConfig) AddContentTree( displayName string, image ApplicationImageStorage) uuid.UUID
AddContentTree adds a ContentTree that no Volume and no application refers to, and returns its UUID.
volumemgr downloads a ContentTree eagerly, so the image blobs land in the content-addressable store without a Volume, a PVC or a CDI import ever being created. A test whose subject is the blobs themselves -- that they survive an event, or that a later deployment reuses them instead of downloading again -- wants exactly that, since going through AddVolume would drag the storage pipeline into the result.
func (*EdgeDeviceConfig) AddNetwork ¶
func (dc *EdgeDeviceConfig) AddNetwork(netConfig NetworkConfig) uuid.UUID
AddNetwork : add new network configuration. This can be then referenced from NetworkAdapterConfig.
func (*EdgeDeviceConfig) AddNetworkAdapter ¶
func (dc *EdgeDeviceConfig) AddNetworkAdapter(config NetworkAdapterConfig)
AddNetworkAdapter adds a new physical network adapter to the device configuration.
func (*EdgeDeviceConfig) AddNetworkInstance ¶
func (dc *EdgeDeviceConfig) AddNetworkInstance(config NetworkInstanceConfig) uuid.UUID
AddNetworkInstance adds a new network instance to the device configuration and returns its generated UUID.
func (*EdgeDeviceConfig) AddPhysicalIO ¶
func (dc *EdgeDeviceConfig) AddPhysicalIO(config PhysicalIOConfig)
AddPhysicalIO adds a raw PhysicalIO (assignable I/O) device to the device configuration. Use it for non-network devices and for device-model inconsistencies that AddNetworkAdapter cannot express. A given logical label is owned by exactly one of AddNetworkAdapter or AddPhysicalIO.
func (*EdgeDeviceConfig) AddSCEPProfile ¶
func (dc *EdgeDeviceConfig) AddSCEPProfile(profile SCEPProfile)
AddSCEPProfile adds a new SCEP profile into the device configuration.
func (*EdgeDeviceConfig) AddVLANSubinterface ¶
func (dc *EdgeDeviceConfig) AddVLANSubinterface(config VLANSubinterfaceConfig)
AddVLANSubinterface adds a VLAN subinterface to the device configuration.
func (*EdgeDeviceConfig) AddVolume ¶
func (dc *EdgeDeviceConfig) AddVolume( displayName string, image ApplicationImageStorage, sizeBytes uint64) uuid.UUID
AddVolume adds a standalone (app-unreferenced) VCOT_DOWNLOAD volume of the requested size, with content sourced from image, and returns its UUID.
Unlike AddBlankVolume, the volume's content is populated by a real download (e.g. from a docker registry, or evetest's built-in HTTP/SFTP image server -- see CreateBlankImageFile), so this exercises the download and (for non-raw formats) disk-format conversion path in volumemgr, rather than the empty zero-content path.
func (*EdgeDeviceConfig) Clone ¶
func (dc *EdgeDeviceConfig) Clone() *EdgeDeviceConfig
Clone creates a deep copy of the EdgeDeviceConfig.
func (*EdgeDeviceConfig) DeleteApplication ¶
func (dc *EdgeDeviceConfig) DeleteApplication(appUUID uuid.UUID)
DeleteApplication removes an application instance identified by its UUID and its root volume (the one created together with it from ApplicationInstanceConfig.Image/DiskBytes). Any volumes referenced through Mounts are left untouched -- their lifecycle is independent of the application (see MountConfig); remove them explicitly with DeleteVolume.
func (*EdgeDeviceConfig) DeleteBond ¶
func (dc *EdgeDeviceConfig) DeleteBond(logicalLabel string)
DeleteBond removes a bond identified by its logical label from the device configuration.
func (*EdgeDeviceConfig) DeleteContentTree ¶
func (dc *EdgeDeviceConfig) DeleteContentTree(contentTreeUUID uuid.UUID)
DeleteContentTree removes a ContentTree added by AddContentTree, and the Datastore it referenced, from the device configuration.
func (*EdgeDeviceConfig) DeleteNetwork ¶
func (dc *EdgeDeviceConfig) DeleteNetwork(networkUUID uuid.UUID)
DeleteNetwork : remove previously added network configuration.
func (*EdgeDeviceConfig) DeleteNetworkAdapter ¶
func (dc *EdgeDeviceConfig) DeleteNetworkAdapter(logicalLabel string)
DeleteNetworkAdapter removes a network adapter identified by its logical label from the device configuration.
func (*EdgeDeviceConfig) DeleteNetworkInstance ¶
func (dc *EdgeDeviceConfig) DeleteNetworkInstance(niUUID uuid.UUID)
DeleteNetworkInstance removes a network instance identified by its UUID from the device configuration.
func (*EdgeDeviceConfig) DeletePhysicalIO ¶
func (dc *EdgeDeviceConfig) DeletePhysicalIO(logicalLabel string)
DeletePhysicalIO removes an I/O device added with AddPhysicalIO, identified by its logical label, from the device configuration. Network adapters are removed with DeleteNetworkAdapter instead. The device must not be assigned to any application any more (ApplicationInstanceConfig.IOAdapters); delete or update the application first.
func (*EdgeDeviceConfig) DeleteSCEPProfile ¶
func (dc *EdgeDeviceConfig) DeleteSCEPProfile(profileName string)
DeleteSCEPProfile removes SCEP profile from the device configuration.
func (*EdgeDeviceConfig) DeleteVLANSubinterface ¶
func (dc *EdgeDeviceConfig) DeleteVLANSubinterface(logicalLabel string)
DeleteVLANSubinterface removes a VLAN subinterface identified by its logical label from the device configuration.
func (*EdgeDeviceConfig) DeleteVolume ¶
func (dc *EdgeDeviceConfig) DeleteVolume(volumeUUID uuid.UUID)
DeleteVolume removes a standalone volume (created via AddVolume or AddBlankVolume) and its associated ContentTree/Datastore, if any, from the device configuration. The volume must not currently be referenced by any application; detach it first with DetachVolume.
func (*EdgeDeviceConfig) MakeBootstrapConfig ¶
func (dc *EdgeDeviceConfig) MakeBootstrapConfig() *eveconfig.BootstrapConfig
MakeBootstrapConfig : wrap device configuration into BootstrapConfig, which is used to carry the initial device configuration and gets installed into the /config partition.
func (*EdgeDeviceConfig) SetBaseOS ¶
func (dc *EdgeDeviceConfig) SetBaseOS(storage ApplicationImageStorage, shortVersion string)
SetBaseOS configures an EVE OS upgrade from the given image storage source. shortVersion is the full EVE short version string (e.g. "12.1.0-kvm-amd64") that EVE will report in ZInfoDevSW.ShortVersion after the upgrade. Calling this again on the same config replaces the previously set BaseOS entry.
func (*EdgeDeviceConfig) SetConfigProperties ¶
func (dc *EdgeDeviceConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
SetConfigProperties : add configuration properties into the device configuration.
func (*EdgeDeviceConfig) SetDisksLayout ¶
func (dc *EdgeDeviceConfig) SetDisksLayout(layout DisksLayout)
SetDisksLayout configures the device's ZFS/RAID disk-array layout for its extra (non-boot) virtio disks (see RequireEdgeDevice.ExtraDisks).
Both DiskLayoutRAID1 and DiskLayoutRAID10 are represented, at the EVE API level, as a top-level DisksConfig with ArrayType RAID0 (stripe) whose Children are the individual RAID1 mirrors -- a single mirror for RAID1, two mirrors for RAID10 -- exactly matching how eden itself builds this structure (pkg/device/disksLayout.go, GetDisksConfig).
func (*EdgeDeviceConfig) SetLPS ¶
func (dc *EdgeDeviceConfig) SetLPS(config LPSConfig)
SetLPS configures the Local Profile Server (LPS) settings for the device.
func (*EdgeDeviceConfig) UpdateApplication ¶
func (dc *EdgeDeviceConfig) UpdateApplication( appUUID uuid.UUID, newConfig ApplicationInstanceConfig)
UpdateApplication updates an existing application instance identified by its UUID.
func (*EdgeDeviceConfig) UpdateBond ¶
func (dc *EdgeDeviceConfig) UpdateBond(config BondConfig)
UpdateBond updates an existing bond identified by its logical label.
func (*EdgeDeviceConfig) UpdateNetwork ¶
func (dc *EdgeDeviceConfig) UpdateNetwork(networkUUID uuid.UUID, newConfig NetworkConfig)
UpdateNetwork : update already added network configuration.
func (*EdgeDeviceConfig) UpdateNetworkAdapter ¶
func (dc *EdgeDeviceConfig) UpdateNetworkAdapter(config NetworkAdapterConfig)
UpdateNetworkAdapter updates an existing network adapter identified by its logical label.
func (*EdgeDeviceConfig) UpdateNetworkInstance ¶
func (dc *EdgeDeviceConfig) UpdateNetworkInstance( niUUID uuid.UUID, newConfig NetworkInstanceConfig)
UpdateNetworkInstance updates an existing network instance identified by its UUID.
func (*EdgeDeviceConfig) UpdateSCEPProfile ¶
func (dc *EdgeDeviceConfig) UpdateSCEPProfile(profile SCEPProfile)
UpdateSCEPProfile updates an existing SCEP profile.
func (*EdgeDeviceConfig) UpdateVLANSubinterface ¶
func (dc *EdgeDeviceConfig) UpdateVLANSubinterface(config VLANSubinterfaceConfig)
UpdateVLANSubinterface updates an existing VLAN subinterface identified by its logical label.
type ExistingEdgeDeviceReusePolicy ¶
type ExistingEdgeDeviceReusePolicy int
ExistingEdgeDeviceReusePolicy defines how to reuse an existing EdgeDevice that already satisfies test requirements. Only one strategy can be selected. This helps control whether to reuse as-is, reset, or recreate the edge device before test execution.
const ( // UseAsIs : do nothing special, keep existing state. UseAsIs ExistingEdgeDeviceReusePolicy = iota // RebootEdgeDevice : just reboot edge device matching the requirements. RebootEdgeDevice // ResetDeviceConfig : reset the device configuration by clearing all // application-related settings while preserving the device network configuration. ResetDeviceConfig // ResetDeviceConfigAndReboot : combines ResetDeviceConfig with RebootEdgeDevice. ResetDeviceConfigAndReboot // ReonboardEdgeDevice forces re-onboarding of the device, even if it was previously // onboarded. // It removes the OnboardingStatus and edge device certificate, clears TPM, recreates // the device entry in the controller, resets device configuration (see ResetDeviceConfig) // and then reboots the device. ReonboardEdgeDevice // CreateFromScratchWithInstaller : re-create VM even if already exists using // EVE installer image. CreateFromScratchWithInstaller // CreateFromScratchWithLiveImage : re-create VM even if already exists using // EVE live image. CreateFromScratchWithLiveImage // CreateFromScratchWithNetworkBoot : re-create VM even if already exists, // with no boot disk image attached (only a blank target disk sized // MinDiskSizeInMiB). The device is expected to boot over the network // (see the network model's DHCP.netboot_server_ip), install EVE onto // the blank disk, and reboot into it. CreateFromScratchWithNetworkBoot )
type Filesystem ¶
type Filesystem int
Filesystem identifies the filesystem type required or detected on an EVE device.
const ( // FilesystemUndefined indicates no specific filesystem is required or detected. FilesystemUndefined Filesystem = iota // FilesystemEXT4 represents the ext4 filesystem. FilesystemEXT4 // FilesystemZFS represents the ZFS filesystem. FilesystemZFS )
func GetFilesystemParameterValue ¶
func GetFilesystemParameterValue() Filesystem
GetFilesystemParameterValue returns the value set for the Filesystem parameter.
func (*Filesystem) FromString ¶
func (f *Filesystem) FromString(s string) error
FromString parses a filesystem name string and sets the Filesystem value.
func (Filesystem) String ¶
func (f Filesystem) String() string
type FlowLogMatch ¶
type FlowLogMatch struct {
Flow *eveflowlog.IpFlow // match every non-zero value from the 5-tuple
Inbound bool
VirtualNetAdapter string // logical label
NetworkInstance uuid.UUID
// NotBefore and NotAfter relates to FlowRecord.startTime
NotBefore time.Time
NotAfter time.Time
}
FlowLogMatch defines filtering criteria for matching application flow logs.
type FromStringer ¶
FromStringer should be implemented by a test parameter if its type is not a basic Go type.
type HTTPStorage ¶
type HTTPStorage struct {
ImageFormat eveconfig.Format
ImageSHA256 string
MaxDownloadBytes uint64
ImageRelativePath string
ServerAddress string
ServerPort uint16 // if not defined, we assume port 80 (HTTP) / 443 (HTTPS)
UseHTTPS bool // true = HTTPS, false = HTTP
HTTPSTrustedCACertsPEM []string
// OmitPort leaves the port out of the datastore FQDN (the scheme's default
// port is then used). Required for a local datastore: EVE recognizes it by
// the FQDN ending with ".local", which a ":port" suffix would hide.
OmitPort bool
}
HTTPStorage defines the location of an application image stored on an HTTP datastore.
type Hypervisor ¶
type Hypervisor int
Hypervisor identifies the hypervisor type required or detected on an EVE device.
const ( // HypervisorUndefined indicates no specific hypervisor is required or detected. HypervisorUndefined Hypervisor = iota // HypervisorKVM represents the KVM hypervisor. HypervisorKVM // HypervisorXen represents the Xen hypervisor. HypervisorXen // HypervisorKubevirt represents the KubeVirt hypervisor. HypervisorKubevirt )
func GetHypervisorParameterValue ¶
func GetHypervisorParameterValue() Hypervisor
GetHypervisorParameterValue returns the value set for the Hypervisor parameter.
func (*Hypervisor) FromString ¶
func (h *Hypervisor) FromString(s string) error
FromString parses a hypervisor name string and sets the Hypervisor value.
func (Hypervisor) String ¶
func (h Hypervisor) String() string
type IOAdapterConfig ¶
IOAdapterConfig represents an I/O device other than a network adapter directly assigned to an application, e.g. a GPU (PhyIoHDMI) or a USB controller (PhyIoUSBController). LogicalLabel names the PhysicalIO entry (see EdgeDeviceConfig.AddPhysicalIO) and Type must match its type.
type InitOption ¶
type InitOption func(*initOptions)
InitOption customizes how Init sets up the test harness.
func WithControllerFaults ¶
func WithControllerFaults() InitOption
WithControllerFaults makes Init run the controller behind the fault injecting proxy, for tests which call ArmControllerFault. It only supplies the default: EVETEST_CONTROLLER_FAULTS, when the user sets it, decides either way, so that the proxy can still be forced off to check that these tests skip, or forced on for every test.
func WithTags ¶
func WithTags(tags ...Tag) InitOption
WithTags attaches tags to the test or suite whose Init call it is passed to. It has no effect at run time: list-tests reads the tags statically from the source, shows them, and hands the ones of suites to CI. Pass constants from this package directly, e.g.
evetest.Init(test, evetest.WithTags(evetest.TagHeavyTest))
type LPSConfig ¶
type LPSConfig struct {
GlobalProfile string
Address string // IP[:port] or hostname[:port]
AuthToken string
}
LPSConfig contains configuration for the Local Profile Server.
type LocalNetworkInstanceConfig ¶
type LocalNetworkInstanceConfig struct {
DisplayName string
Port string // logical label or shared label
Subnet *net.IPNet
DHCPRange pillartypes.IPRange
Gateway net.IP
Domain string
NTPServers []string
DNSServers []net.IP
StaticDNSEntries []pillartypes.DNSNameToIP
PropagateConnectedRoutes bool
StaticRoutes []pillartypes.IPRouteConfig
EnableFlowlog bool
MTU uint16
ForwardLLDP bool
ClusterWide bool
}
LocalNetworkInstanceConfig represents Local (L3, NAT-ed) Network Instance.
type LogMsg ¶
type LogMsg struct {
Severity string
Source string
Filename string
Message string
Timestamp time.Time
}
LogMsg represents a single log message emitted by the device or an application.
type LogMsgMatch ¶
type LogMsgMatch struct {
Severity string
Source string
Filename string
MsgHasSubstring string
MsgMatchesRegexp regexp.Regexp
NotBefore time.Time
NotAfter time.Time
}
LogMsgMatch defines filtering criteria for matching log messages.
type ManualProxyConfig ¶
type ManualProxyConfig struct {
Proxies []ProxyServer
ProxyCertsPEM []string
Exceptions []string // IP address or hostname or wildcard domain (e.g. *.local)
}
ManualProxyConfig represents a manually specified proxy configuration.
type MountConfig ¶
type MountConfig struct {
// VolumeUUID is the UUID of an existing volume, as returned by AddVolume
// or AddBlankVolume.
VolumeUUID uuid.UUID
// MountDir is the path where the volume is mounted inside the guest.
// Empty means the volume is attached as a raw block device instead: no
// guest-side mount is performed, and the disk shows up as a plain block
// device (e.g. /dev/sdX for a VM, or a device node under
// /dev/eve/volumes/by-id for a container) -- see VolumeRefConfig.MountDir
// handling in pillar's zedmanager/domainmgr/containerd.
MountDir string
// ReadOnly marks the volume as read-only inside the guest. This sets
// Volume.Readonly, a property of the volume itself (the EVE API has no
// separate per-reference read-only flag) -- so mounting the same volume
// read-write from one application and read-only from another is not
// possible; the last MountConfig applied wins.
ReadOnly bool
}
MountConfig attaches an existing volume to an application, in addition to its root disk. The volume must already exist in the device configuration (created via EdgeDeviceConfig.AddVolume or AddBlankVolume) -- AddApplication/UpdateApplication fail if VolumeUUID does not reference one. The volume's lifecycle is independent of any application that mounts it: deleting the application does not delete it (use DeleteVolume explicitly), and DeleteVolume itself fails while any application still mounts it.
type NetworkAdapterConfig ¶
type NetworkAdapterConfig struct {
LogicalLabel string
PhysicalLabel string
InterfaceName string
PCIAddress string
USBAddress string
WirelessType evecommon.WirelessType
Usage evecommon.PhyIoMemberUsage
PNAC PNAC
// AssignmentGroup overrides the PhysicalIO assignment group. Defaults to
// LogicalLabel when empty.
AssignmentGroup string
// ParentAssignmentGroup sets the parent assignment group (empty if none).
ParentAssignmentGroup string
// AllowLocalModifications enables the Local Profile Server (LPS) to modify
// the network configuration of this adapter.
AllowLocalModifications bool
// Parameters below should be left empty if:
// - Usage is PhyIoUsageDedicated or PhyIoUsageDisabled, or
// - the (ethernet) adapter is used in VLANs-only mode
// - the (ethernet) adapter is a member of a bond
Cost uint8
NetworkUUID uuid.UUID
StaticIP net.IP // use only in combination with StaticNetworkConfig
}
NetworkAdapterConfig represents configuration for NIC (ethernet or wireless)
type NetworkConfig ¶
type NetworkConfig interface {
// contains filtered or unexported methods
}
NetworkConfig defines a generic interface for converting a network config into its corresponding EVE protobuf representation.
type NetworkInstanceConfig ¶
type NetworkInstanceConfig interface {
// contains filtered or unexported methods
}
NetworkInstanceConfig defines a generic interface for network-instance configurations that can be converted into EVE protobuf representation.
type NetworkProtocol ¶
type NetworkProtocol uint8
NetworkProtocol defined for ACL rules.
const ( // NetworkProtocolAny indicates that an ACL rule matches any network protocol. NetworkProtocolAny NetworkProtocol = iota // NetworkProtocolICMP indicates that an ACL rule matches ICMP traffic. NetworkProtocolICMP // NetworkProtocolTCP indicates that an ACL rule matches TCP traffic. NetworkProtocolTCP // NetworkProtocolUDP indicates that an ACL rule matches UDP traffic. NetworkProtocolUDP )
func (NetworkProtocol) String ¶
func (p NetworkProtocol) String() string
String returns string representation of the network protocol.
type NoIPNetworkConfig ¶
type NoIPNetworkConfig struct {
MTU uint16
}
NoIPNetworkConfig represents configuration for an Ethernet interface without assigning an IP address (no static IP and no DHCP client). It is typically used for L2-only setups (e.g., bridge members) or for cluster networks, where IP addresses are assigned from the cluster configuration.
type PACFileProxyConfig ¶
type PACFileProxyConfig struct {
// PACScript is the JavaScript of the PAC file, i.e. its FindProxyForURL.
PACScript string
ProxyCertsPEM []string
}
PACFileProxyConfig represents a proxy configuration given as a proxy auto-config (PAC) script that EVE evaluates for every URL it opens on the port. EVE receives the script the way a controller sends it, base64-encoded inside the network's proxy config.
type PNAC ¶
type PNAC struct {
Enable bool
EAPIdentity string
EAPMethod eveconfig.EAPMethod
// Name of the certificate enrollment profile used for authentication
// (for example, a SCEP profile). Applicable only if the selected EAP
// method requires a client certificate (e.g., EAP-TLS).
CertEnrollmentProfileName string
}
PNAC : configuration for Port-based Network Access Control.
type PhysicalIOConfig ¶
type PhysicalIOConfig struct {
LogicalLabel string
PhysicalLabel string
Type evecommon.PhyIoType
// AssignmentGroup defaults to LogicalLabel when empty.
AssignmentGroup string
ParentAssignmentGroup string
Usage evecommon.PhyIoMemberUsage
// Physical addresses; every non-empty field is written into Phyaddrs.
PCIAddress string
USBAddress string
InterfaceName string
Serial string
}
PhysicalIOConfig represents a raw PhysicalIO (assignable I/O) device in the device model. Use it for non-network devices and for deliberately inconsistent device models that AddNetworkAdapter cannot express (a specific Ptype, a phantom device at a chosen PCI address, a custom assignment group, etc.). A given logical label is owned by exactly one of AddNetworkAdapter or AddPhysicalIO.
type PortFwdRule ¶
type PortFwdRule struct {
Protocol NetworkProtocol
EdgeNodePort uint16
AppPort uint16
// AdapterLabel, when non-empty, restricts this port-forwarding rule to
// ports that carry this shared label (generates an "adapter" ACE match).
AdapterLabel string
}
PortFwdRule is a port forwarding rule.
type ProxyAutoDiscoveryConfig ¶
type ProxyAutoDiscoveryConfig struct {
ProxyCertsPEM []string
}
ProxyAutoDiscoveryConfig represents a proxy configuration that enables automatic discovery of network proxy settings using WPAD & PAC.
type ProxyConfig ¶
type ProxyConfig interface {
// contains filtered or unexported methods
}
ProxyConfig defines a generic interface for proxy configuration types that can be converted into EVE protobuf representation.
type ProxyServer ¶
type ProxyServer struct {
Proto evecommon.ProxyProto
Address string // IP or hostname
Port uint16
}
ProxyServer defines a single proxy server with protocol, address, and port.
type RequireCapabilities ¶
type RequireCapabilities struct {
Capabilities []api.Capability
}
RequireCapabilities : requirement for one or more optional, provider-specific capabilities (e.g. forwarding of link-local L2 protocols). A test declaring this requirement is skipped when the active device provider does not advertise all of the listed capabilities.
type RequireDirectRegistryPulls ¶
type RequireDirectRegistryPulls struct{}
RequireDirectRegistryPulls : requirement to skip applying configured REGISTRY_MIRROR_* mirrors, everywhere evetest would otherwise use them (K3s/containerd config on kubevirt devices, app datastore FQDNs), so every image pull goes to the real registry instead of a mirror's own address.
type RequireEdgeDevice ¶
type RequireEdgeDevice struct {
// Logical name used to reference the device within the evetest framework.
Name string
// Zero values mean that the test does not care about the particular resource size.
// None of these will be ever created with zero count - not even ethernet interfaces.
MinCPUs uint8 // Default will be 4.
MinRAMInMiB uint32 // Default will be 8 GiB (8192 MiB).
MinDiskSizeInMiB uint32 // Default will be 64 GiB (65536 MiB).
WithEVEVersion string
// WithEVERepo overrides the repo WithEVEVersion is pulled from; empty
// means EVETEST_EVE_REPO. For a device that must use a different repo
// than the one under test (e.g. TestEVEUpgrade's pre-upgrade device).
WithEVERepo string
WithHypervisor Hypervisor
WithTPM bool
// Active host TPM PCR banks. Empty uses the provider default.
// Requires WithTPM and provider support.
WithTPMPCRBanks []api.TPMPCRBank
WithFilesystem Filesystem
// Mount the vault (or the entire persist partition when using ext4) with the
// DIRSYNC flag, which makes all directory-entry updates synchronous.
// This incurs significant I/O overhead in virtualized environments,
// most noticeably during container image unpacking, so it is disabled by
// default. Enable it only when the test explicitly exercises durability under
// sudden failure conditions such as power loss or kernel crashes.
WithDirSync bool
// Configuration injected into the /config partition.
WithSoftSerial string
WithGrubOptions []string
WithInjectedBootstrapConfig *EdgeDeviceConfig
WithInjectedNetworkOverride *pillartypes.DevicePortConfig
// framework automatically adds SSH key and enables console
WithInjectedConfigProperties *pillartypes.ConfigItemValueMap
// USB/PCI devices to passthrough into the edge device VM.
WithUSBPassthrough []USBDevice // TODO
WithPCIPassthrough []PCIDevice // TODO
// ExtraDisks specifies additional blank disks (size in bytes each) to
// attach to the device's VM, beyond its main boot disk (MinDiskSizeInMiB).
// Each entry becomes one extra virtio-blk disk, in the given order (i.e.
// the first extra disk is the device's second disk overall). Intended for
// tests that configure EVE-level disk layout/RAID via
// EdgeDeviceConfig.SetDisksConfig.
ExtraDisks []uint64
// What to do if EdgeDevice is already available (and still manageable)
// from the previous test:
DeviceReusePolicy ExistingEdgeDeviceReusePolicy
}
RequireEdgeDevice : requirement to deploy single EVE device.
type RequireIPv6OnlyRegistryMirrors ¶
type RequireIPv6OnlyRegistryMirrors struct{}
RequireIPv6OnlyRegistryMirrors : requirement to only use IPv6 addresses of configured OCI registry mirrors when building app image datastore configs (for tests where the device itself is IPv6-only). A registry with no IPv6 mirror address configured is simply not mirrored for that app (falls back to pulling from the real, un-mirrored registry) rather than failing or skipping the test -- a missing mirror is only a performance optimization.
type RequireInternetConnectivity ¶
type RequireInternetConnectivity struct {
RequireIPv6 bool
}
RequireInternetConnectivity : requirement to provide IPv4/IPv6 Internet connectivity.
type RequireNetworkModel ¶
type RequireNetworkModel struct {
// NetworkModel.ControllerConfig is filled by the framework, do not set from the test.
*api.NetworkModel
}
RequireNetworkModel : required Evetest-SDN network model.
type Requirement ¶
type Requirement interface {
// contains filtered or unexported methods
}
Requirement is a marker interface for all test requirements (e.g. device, hypervisor, filesystem).
type SCEPProfile ¶
type SCEPProfile struct {
Name string
// Full SCEP server URL, including scheme, host, and path.
// Example: https://ca.example.com/scep
SCEPServerURL string
// If true, SCEP requests are sent via the controller-provided SCEP proxy.
// If false, the device connects directly to the SCEP server.
UseControllerProxy bool
ChallengePassword string
CACertsPEM []string
CSR CSRProfile
}
SCEPProfile : SCEP (Simple Certificate Enrollment Protocol) configuration profile. Defines how a device enrolls for X.509 certificates using SCEP, including server connectivity, trust anchors, and CSR parameters.
type SFTPStorage ¶
type SFTPStorage struct {
ImageFormat eveconfig.Format
ImageSHA256 string
MaxDownloadBytes uint64
ImageRelativePath string
ServerAddress string
ServerPort uint16 // if not defined, we assume port 22
Username string
Password string
}
SFTPStorage defines the location and access parameters for an application image stored on an SFTP datastore
type StaticNetworkConfig ¶
type StaticNetworkConfig struct {
NetworkType evecommon.NetworkType
MTU uint16
Subnet *net.IPNet
Gateway net.IP
Domain string
NTPServers []string
DNSServers []net.IP
ProxyConfig ProxyConfig
}
StaticNetworkConfig represents a statically assigned IP configuration to an Ethernet interface.
type SwitchNetworkInstanceConfig ¶
type SwitchNetworkInstanceConfig struct {
DisplayName string
Port string // logical label or shared label
EnableFlowlog bool
STPConfig pillartypes.STPConfig // only applied for Switch NI with multiple ports
MTU uint16 // used only for airgap switch NI
ForwardLLDP bool
VlanAccessPorts []pillartypes.VlanAccessPort // VLAN access port assignments; empty = no VLAN filtering
ClusterWide bool
}
SwitchNetworkInstanceConfig represents Switch (L2, bridged) Network Instance.
type T ¶
T wraps testing.T and adds evetest-specific failure handling.
The wrapper augments test failures with:
- automatic stacktrace logging
- optional pause-on-failure support (controlled by EVETEST_PAUSE_ON_FAILURE)
T is returned by evetest.Init(*testing.T) and MUST be used instead of the original *testing.T. Calling failure methods on the original *testing.T bypasses this additional behavior.
func Init ¶
func Init(t *testing.T, opts ...InitOption) *T
Init initializes the test harness and must be called exactly once per test. When used inside a test suite, Init may be called multiple times, once per test case, but only a single harness instance will be created.
Options only take effect for the Init call that creates the harness: a test that may run standalone passes the options it needs, and inside a suite the ones given to the suite's own Init apply.
func (*T) Error ¶
func (t *T) Error(args ...interface{})
Error logs the provided arguments, marks the test as failed, and continues execution.
This is equivalent to Log + Fail, with additional stacktrace logging and optional pause-on-failure behavior.
func (*T) Errorf ¶
Errorf formats the message, marks the test as failed, and continues execution.
This is equivalent to Logf + Fail, with additional stacktrace logging and optional pause-on-failure behavior.
func (*T) Fail ¶
func (t *T) Fail()
Fail marks the test as failed but allows execution to continue.
This mirrors testing.T.Fail, with the addition of stacktrace logging and optional pause-on-failure behavior.
func (*T) FailNow ¶
func (t *T) FailNow()
FailNow marks the test as failed and stops execution immediately.
Like testing.T.FailNow, this only stops the test in the goroutine from which it is called.
func (*T) Fatal ¶
func (t *T) Fatal(args ...interface{})
Fatal logs the provided arguments, marks the test as failed, and stops execution immediately.
Like testing.T.Fatal, this only stops the test in the goroutine from which it is called.
type Tag ¶
type Tag string
Tag labels a test or a test suite for tools that schedule or filter them.
const ( // TagHeavyTest marks a test or suite that needs a powerful host: one focused // on EVE-k, or one that takes more than about 90 minutes on a strong host. // CI schedules whole suites, so a suite with this tag is run only on the // strong runners, never on the weak ones. TagHeavyTest Tag = "heavy" )
type TestCase ¶
type TestCase struct {
// Test is the test function to execute.
Test func(t *testing.T)
// Variants defines multiple configurations under which the test
// should be executed. Each variant is run as a subtest.
Variants []TestVariant
}
TestCase represents a single logical test along with optional variants. If no variants are provided, the test is executed once with default parameters.
type TestHarness ¶
type TestHarness struct {
api.UnimplementedEvetestServer
// contains filtered or unexported fields
}
TestHarness is the central runtime state for executing tests and test suites. It owns the gRPC server lifecycle and tracks the currently executing test and optional test-suite context.
func (*TestHarness) CollectInfo ¶
func (th *TestHarness) CollectInfo( ctx context.Context, req *api.EVEDeviceRequest) (*api.CollectInfoResponse, error)
CollectInfo retrieves debug information from a device (eve-info tarball).
func (*TestHarness) ConnectConsoleToEVE ¶
func (th *TestHarness) ConnectConsoleToEVE( stream api.Evetest_ConnectConsoleToEVEServer) error
ConnectConsoleToEVE carries an interactive serial-console session over gRPC. The client sends an EVEDeviceRequest as the first message; the server opens a broker console stream, forwards ConsoleProperties, then relays raw bytes bidirectionally between the CLI and the broker.
func (*TestHarness) ConnectTunnelToEVE ¶
func (th *TestHarness) ConnectTunnelToEVE( stream api.Evetest_ConnectTunnelToEVEServer) error
ConnectTunnelToEVE carries a single TCP connection to an EVE device port over gRPC. The client sends an EVETunnelConnect as the first message; the server dials EVE, replies with TunnelConnected, then relays raw bytes bidirectionally.
func (*TestHarness) ConnectTunnelToSDN ¶
func (th *TestHarness) ConnectTunnelToSDN( stream api.Evetest_ConnectTunnelToSDNServer) error
ConnectTunnelToSDN carries a TCP connection to the SDN SSH port over gRPC. The client sends an SDNRequest as the first message; the server dials the SDN SSH endpoint, replies with TunnelConnected, then relays raw bytes bidirectionally.
func (*TestHarness) Continue ¶
func (th *TestHarness) Continue( ctx context.Context, req *api.ContinueRequest) (*api.ContinueResponse, error)
Continue test execution until the end/failure or another checkpoint.
func (*TestHarness) Exit ¶
func (th *TestHarness) Exit( ctx context.Context, req *api.ExitRequest) (*api.ExitResponse, error)
Exit the test early. If the test is paused at a checkpoint or on failure, it will be marked as skipped. Otherwise, the process is terminated with os.Exit(0).
func (*TestHarness) GetAppFlowLogs ¶
func (th *TestHarness) GetAppFlowLogs( req *api.AppRequest, stream api.Evetest_GetAppFlowLogsServer) error
GetAppFlowLogs streams flow logs and DNS request logs for an application.
func (*TestHarness) GetAppInfo ¶
func (th *TestHarness) GetAppInfo( req *api.AppRequest, stream api.Evetest_GetAppInfoServer) error
GetAppInfo streams application-specific info from a device (ZInfoApp).
func (*TestHarness) GetAppLogs ¶
func (th *TestHarness) GetAppLogs( req *api.AppRequest, stream api.Evetest_GetAppLogsServer) error
GetAppLogs streams logs from an EVE-managed application.
func (*TestHarness) GetAppMetrics ¶
func (th *TestHarness) GetAppMetrics( req *api.AppRequest, stream api.Evetest_GetAppMetricsServer) error
GetAppMetrics streams application-level metrics from a device (appMetric).
func (*TestHarness) GetClusterInfo ¶
func (th *TestHarness) GetClusterInfo( req *api.ClusterRequest, stream api.Evetest_GetClusterInfoServer) error
GetClusterInfo streams summary information for the entire Kubernetes cluster from all devices.
func (*TestHarness) GetClusterMetrics ¶
func (th *TestHarness) GetClusterMetrics( req *api.ClusterRequest, stream api.Evetest_GetClusterMetricsServer) error
GetClusterMetrics streams metrics for the Kubernetes cluster (KubeClusterMetrics) from all devices.
func (*TestHarness) GetClusterUpdateInfo ¶
func (th *TestHarness) GetClusterUpdateInfo( req *api.ClusterRequest, stream api.Evetest_GetClusterUpdateInfoServer) error
GetClusterUpdateInfo streams information about ongoing cluster updates.
func (*TestHarness) GetEVEConfig ¶
func (th *TestHarness) GetEVEConfig( ctx context.Context, req *api.EVEDeviceRequest) (*api.EVEConfigResponse, error)
GetEVEConfig fetches the current configuration submitted to the EVE device.
func (*TestHarness) GetEVEConsoleOutput ¶
func (th *TestHarness) GetEVEConsoleOutput( ctx context.Context, req *api.EVEDeviceRequest) (*api.ConsoleOutputResponse, error)
GetEVEConsoleOutput returns the full console output from the EVE device.
func (*TestHarness) GetEVEInfo ¶
func (th *TestHarness) GetEVEInfo( req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVEInfoServer) error
GetEVEInfo streams real-time system info from EVE device (ZInfoDevice).
func (*TestHarness) GetEVELogs ¶
func (th *TestHarness) GetEVELogs( req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVELogsServer) error
GetEVELogs streams logs from EVE device (agent logs, kernel logs, etc).
func (*TestHarness) GetEVEMetrics ¶
func (th *TestHarness) GetEVEMetrics( req *api.EVEDeviceStreamableRequest, stream api.Evetest_GetEVEMetricsServer) error
GetEVEMetrics streams real-time metrics from EVE device (deviceMetric).
func (*TestHarness) GetNIInfo ¶
func (th *TestHarness) GetNIInfo( req *api.NIRequest, stream api.Evetest_GetNIInfoServer) error
GetNIInfo streams info (ZInfoNetworkInstance) about a network instance (NI).
func (*TestHarness) GetNIMetrics ¶
func (th *TestHarness) GetNIMetrics( req *api.NIRequest, stream api.Evetest_GetNIMetricsServer) error
GetNIMetrics streams metrics (ZMetricNetworkInstance) for a network instance.
func (*TestHarness) GetSDNConfigGraph ¶
func (th *TestHarness) GetSDNConfigGraph( ctx context.Context, req *api.SDNRequest) (*api.SDNConfigGraphResponse, error)
GetSDNConfigGraph returns the SDN configuration visualized as a Graphviz dot-formatted graph.
func (*TestHarness) GetSDNNetworkModel ¶
func (th *TestHarness) GetSDNNetworkModel( ctx context.Context, req *api.SDNRequest) (*api.SDNGetNetworkModelResponse, error)
GetSDNNetworkModel returns the SDN's abstract model of the network.
func (*TestHarness) GetSDNStatus ¶
func (th *TestHarness) GetSDNStatus( ctx context.Context, req *api.SDNRequest) (*api.SDNStatusResponse, error)
GetSDNStatus returns the overall SDN (network emulator) status.
func (*TestHarness) HardRebootEVEDevice ¶
func (th *TestHarness) HardRebootEVEDevice( ctx context.Context, req *api.EVEDeviceRequest) (*api.EVERebootResponse, error)
HardRebootEVEDevice forces immediate power cycle of the EVE device.
func (*TestHarness) SoftRebootEVEDevice ¶
func (th *TestHarness) SoftRebootEVEDevice( ctx context.Context, req *api.EVEDeviceRequest) (*api.EVERebootResponse, error)
SoftRebootEVEDevice request a clean OS-level reboot on the EVE device.
func (*TestHarness) Status ¶
func (th *TestHarness) Status( ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error)
Status returns current test execution state and active devices.
func (*TestHarness) StreamSDNLogs ¶
func (th *TestHarness) StreamSDNLogs( req *api.SDNRequest, stream api.Evetest_StreamSDNLogsServer) error
StreamSDNLogs streams logs from the SDN VM to the gRPC client. This method acts as a simple forwarder: it subscribes to the SDN log stream and relays all received log messages to the caller over the gRPC stream. If the SDN client is not initialized, an error is returned. The stream will terminate when either the SDN closes the stream (EOF) or the context is canceled.
type TestParameterDefinition ¶
type TestParameterDefinition struct {
// Key is the unique identifier of the parameter.
Key string
// DefaultValue is the value used if the parameter is not explicitly set.
DefaultValue interface{}
// Description provides human-readable metadata about the parameter.
Description TestParameterDescription
}
TestParameterDefinition describes a parameter that a test or test-suite can accept. Parameters may have a default value, can be overridden by test-suites, or via environment variables.
func CPUsParameter ¶
func CPUsParameter() TestParameterDefinition
CPUsParameter is a predefined TestParameterDefinition for the device vCPU count. A value of 0 means the framework default (4 vCPUs) is used, unless the test raises it to a floor of its own.
func DiskSizeMiBParameter ¶
func DiskSizeMiBParameter() TestParameterDefinition
DiskSizeMiBParameter is a predefined TestParameterDefinition for the device disk size. A value of 0 means the framework default (65536 MiB) is used.
func EVEVersionParameter ¶
func EVEVersionParameter() TestParameterDefinition
EVEVersionParameter is a predefined TestParameterDefinition for the EVE version.
func FilesystemParameter ¶
func FilesystemParameter() TestParameterDefinition
FilesystemParameter is a predefined TestParameterDefinition for the Filesystem parameter.
func HypervisorParameter ¶
func HypervisorParameter() TestParameterDefinition
HypervisorParameter is a predefined TestParameterDefinition for the Hypervisor parameter.
func RAMSizeMiBParameter ¶
func RAMSizeMiBParameter() TestParameterDefinition
RAMSizeMiBParameter is a predefined TestParameterDefinition for the device RAM size. A value of 0 means the framework default (8192 MiB) is used, unless the test raises it to a floor of its own.
func TPMParameter ¶
func TPMParameter() TestParameterDefinition
TPMParameter is a predefined TestParameterDefinition for the TPM parameter.
type TestParameterDescription ¶
type TestParameterDescription struct {
// Summary is a human-readable explanation of what the parameter controls.
Summary string
// Default is the default value expressed as a human-readable string
// (e.g. "kvm", "false", "42").
// IMPORTANT: this field must be set to a string literal so that
// list-tests can extract it via static AST analysis. Do not use
// computed expressions such as method calls or variable references.
Default string
// AllowedValues describes the set of accepted values in human-readable form.
// For enum parameters the recommended format is "<val1>|<val2>|<val3>".
// For numeric ranges you might write "<minval>-<maxval>".
// Leave empty if unrestricted (any value of the given type is allowed).
// Same constraint as Default: must be a string literal.
AllowedValues string
}
TestParameterDescription provides metadata for a test parameter, used when listing available tests (see "make list-tests").
type TestParameterValue ¶
type TestParameterValue struct {
// Key is the identifier of the parameter.
Key string
// Value is the concrete value assigned to the parameter.
Value interface{}
}
TestParameterValue represents a concrete value assigned to a test parameter, typically by a test-suite when running parameterized tests.
type TestVariant ¶
type TestVariant struct {
// Name is the name of the test variant.
Name string
// Parameters contains the concrete parameter values applied for this variant.
Parameters []TestParameterValue
}
TestVariant represents a named variation of a test case with a specific set of parameter values. Variants are typically used to run the same test logic under different configurations.
type TransparentProxyConfig ¶
type TransparentProxyConfig struct {
ProxyCertsPEM []string
}
TransparentProxyConfig represents configuration for transparent proxying.
type USBDeviceInfo ¶
type USBDeviceInfo struct {
Bus uint16 // kernel-assigned bus number, not stable across boots
Port string // port path below the root hub, e.g. "2" or "2.3"
VendorID uint16
ProductID uint16
Serial string // empty when the device reports none
}
USBDeviceInfo is one USB device as EVE's kernel enumerates it under /sys/bus/usb/devices. (USBDevice, the vendor/product pair, is a requirement type; see requirements.go.)
func (USBDeviceInfo) String ¶
func (d USBDeviceInfo) String() string
String formats the device as "<bus>-<port> <vendor>:<product>", the sysfs name followed by the ids as lsusb prints them, plus the serial if any.
type USBDeviceList ¶
type USBDeviceList []USBDeviceInfo
USBDeviceList is what ListUSBDevices returns. It prints itself, so it can be the subject of matchers.SatisfyPredicate.
func (USBDeviceList) FindBySerial ¶
func (l USBDeviceList) FindBySerial(serial string) *USBDeviceInfo
FindBySerial returns the device with the given serial number, or nil.
func (USBDeviceList) String ¶
func (l USBDeviceList) String() string
type UsernamePasswordAuth ¶
UsernamePasswordAuth represents username/password authentication.
type VLANSubinterfaceConfig ¶
type VLANSubinterfaceConfig struct {
LogicalLabel string
InterfaceName string
ParentLogicalLabel string
VlanID uint16
Cost uint8
NetworkUUID uuid.UUID
StaticIP net.IP // use only in combination with StaticNetworkConfig
Usage evecommon.PhyIoMemberUsage
}
VLANSubinterfaceConfig represents a single VLAN sub-interface.
type VirtualNetworkAdapter ¶
type VirtualNetworkAdapter struct {
LogicalLabel string
NetworkInstanceUUID uuid.UUID
StaticIP net.IP
MAC net.HardwareAddr
AccessVLAN uint16
PortFwdRules []PortFwdRule
ACLAllowRules []ACLAllowRule
InterfaceOrder *uint32
}
VirtualNetworkAdapter represents application virtual network adapters (e.g., virtio, e1000).
type VolumeGenerationPolicy ¶
type VolumeGenerationPolicy int
VolumeGenerationPolicy controls how PurgeApplication treats the GenerationCount on the app's referenced volumes, modeling the two shapes a real controller's purge can take depending on the volume being purged.
const ( // BumpVolumeGeneration increments GenerationCount on every volume the // app references: a purge that rebuilds the app's storage from scratch // alongside its domain. Per eve-api's storage.proto, "generationCount // indicates the mutated volume needs to be purged and built from // scratch." BumpVolumeGeneration VolumeGenerationPolicy = iota // ReplaceVolumeConfig gives every volume the app references a fresh // UUID (GenerationCount reset to 0) rather than bumping the counter on // the one EVE already has, cycling the domain the same as // BumpVolumeGeneration. ReplaceVolumeConfig )
type WiFiNetworkConfig ¶
type WiFiNetworkConfig struct {
// WiFi with static IP config is rather uncommon
DHCPNetworkConfig
SSID string
KeyScheme evecommon.WiFiKeyScheme
Identity string
// The password must be supplied in pre-hashed form, as generated by `wpa_passphrase`.
// (`PBKDF2-HMAC-SHA1` hash derived from the plaintext password and the SSID).
Password string
Priority int32
}
WiFiNetworkConfig represents a Wi-Fi configuration.
Source Files
¶
- cipherdata.go
- clusterconfig.go
- collectinfo.go
- controllerfaults.go
- devconfig.go
- devstate.go
- diskimages.go
- edgecluster.go
- edgedevice.go
- grpcserver.go
- harness.go
- localimage.go
- localregistry.go
- netboot.go
- qmp.go
- requirements.go
- restartfailed.go
- setup.go
- sftpserver.go
- skip.go
- ssh.go
- tags.go
- teardown.go
- testing.go
- testparam.go
- testsuite.go
- tftpserver.go
- usbdevices.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
list-tests
command
list-tests scans the evetest test suite under ./tests and prints all available test functions grouped into two sections:
|
list-tests scans the evetest test suite under ./tests and prints all available test functions grouped into two sections: |
|
grpcapi
|
|
|
go
revive:disable -- this file lives alongside protobuf-generated code in a directory named "go"
|
revive:disable -- this file lives alongside protobuf-generated code in a directory named "go" |
|
Package instances implements a small on-disk registry of running evetest instances (containers), so that the evetest CLI can find an instance without the user having to know its automatically assigned API port.
|
Package instances implements a small on-disk registry of running evetest instances (containers), so that the evetest CLI can find an instance without the user having to know its automatically assigned API port. |
|
Package orchestrator runs several evetest tests or suites as parallel evetest instances (containers), each on its own API port.
|
Package orchestrator runs several evetest tests or suites as parallel evetest instances (containers), each on its own API port. |
|
tests
|
|
|
portscan
Package portscan scans EVE devices from the network side with nmap and checks that whatever they expose is HTTPS-only and refuses anonymous access.
|
Package portscan scans EVE devices from the network side with nmap and checks that whatever they expose is HTTPS-only and refuses anonymous access. |


