Documentation
¶
Index ¶
- Constants
- Variables
- func ChangeSigningCert(newSignCertPEM string) error
- func Checkpoint(name string)
- func Close() error
- func DefineTestParameters(params ...TestParameterDefinition)
- func GetControllerHostname() string
- func GetControllerIPv4() net.IP
- func GetControllerIPv6() net.IP
- func GetControllerPort() uint16
- 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 Logger() *logrus.Logger
- func MACAddress(macAddr string) net.HardwareAddr
- func ReadAllPublications[T any](d *EdgeDevice, fromAgent string, persistent bool) []T
- func ReadPublication[T any](d *EdgeDevice, fromAgent string, persistent bool, key string, output *T)
- func RunParallel(numOfWorkers int, workerFunc func(workerIdx int))
- func RunTestSuite(cases ...TestCase)
- func Setup(requirements ...Requirement)
- func SkipIfHypervisorKubevirt()
- func UpdateNetworkModel(netModel *api.NetworkModel)
- type ACLAllowRule
- type AppNetworkAdapter
- type ApplicationImageStorage
- type ApplicationInstanceConfig
- type AuthMethod
- type AwsS3Bucket
- type AzureBlob
- type BondConfig
- type CSRProfile
- type CellularNetworkConfig
- type ClientCertAuth
- type ClusterApplicationInstanceConfig
- type ClusterNode
- type DHCPNetworkConfig
- type DNSLogMatch
- type DirectlyAssignedNetworkAdapter
- type DockerContainer
- type EdgeCluster
- func (ec *EdgeCluster) ActivateApplication(appUUID uuid.UUID, waitUntilActivated bool, timeout time.Duration)
- func (ec *EdgeCluster) ApplyConfig(clusterConfig *EdgeClusterConfig, waitUntilFetched bool, ...)
- func (ec *EdgeCluster) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
- func (ec *EdgeCluster) FindDeviceHostingApp(appUUID uuid.UUID, timeout time.Duration) *EdgeDevice
- func (ec *EdgeCluster) GetAppLogs(appUUID uuid.UUID, match LogMsgMatch) []LogMsg
- func (ec *EdgeCluster) PurgeApplication(appUUID uuid.UUID, waitUntilPurged bool, timeout time.Duration)
- 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) WaitUntilAppIsRunning(appUUID uuid.UUID, timeoutExcludingDownload time.Duration)
- func (ec *EdgeCluster) WaitUntilNodesAreReady(timeout time.Duration)
- type EdgeClusterConfig
- func (cc *EdgeClusterConfig) AddApplication(config ClusterApplicationInstanceConfig) 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) 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) 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) DeactivateApplication(appUUID uuid.UUID, waitUntilDeactivated bool, timeout time.Duration)
- func (d *EdgeDevice) DeleteFile(fileName string)
- 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) GetBlobInfo() *eveinfo.ZInfoBlobList
- func (d *EdgeDevice) GetClusterInfo() *eveinfo.ZInfoKubeCluster
- 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) HardReboot(waitUntilRebooted bool)
- func (d *EdgeDevice) PurgeApplication(appUUID uuid.UUID, waitUntilPurged bool, timeout time.Duration)
- func (d *EdgeDevice) ReadFile(fileName string) []byte
- func (d *EdgeDevice) RebootApplication(appUUID uuid.UUID, waitUntilRebooted bool, timeout time.Duration)
- func (d *EdgeDevice) RequestReboot(waitUntilRebooted bool)
- 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) UpgradeEVE(eveVersion string, waitUntilUpgraded bool)
- func (d *EdgeDevice) WaitUntilAppIsRunning(appUUID uuid.UUID, timeoutExcludingDownload 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) WatchHardwareInfo() (updates <-chan *eveinfo.ZInfoHardware, stop func())
- func (d *EdgeDevice) WatchLocationInfo() (updates <-chan *eveinfo.ZInfoLocation, 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) AddBond(config BondConfig)
- 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) AddSCEPProfile(profile SCEPProfile)
- func (dc *EdgeDeviceConfig) AddVLANSubinterface(config VLANSubinterfaceConfig)
- func (dc *EdgeDeviceConfig) Clone() *EdgeDeviceConfig
- func (dc *EdgeDeviceConfig) DeleteApplication(appUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteBond(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteNetwork(networkUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteNetworkAdapter(logicalLabel string)
- func (dc *EdgeDeviceConfig) DeleteNetworkInstance(niUUID uuid.UUID)
- func (dc *EdgeDeviceConfig) DeleteSCEPProfile(profileName string)
- func (dc *EdgeDeviceConfig) DeleteVLANSubinterface(logicalLabel string)
- func (dc *EdgeDeviceConfig) MakeBootstrapConfig() *eveconfig.BootstrapConfig
- func (dc *EdgeDeviceConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
- 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 LPSConfig
- type LocalNetworkInstanceConfig
- type LogMsg
- type LogMsgMatch
- type ManualProxyConfig
- type NetworkAdapterConfig
- type NetworkConfig
- type NetworkInstanceConfig
- type NetworkProtocol
- type NoIPNetworkConfig
- type PCIDevice
- type PNAC
- type PortFwdRule
- type ProxyAutoDiscoveryConfig
- type ProxyConfig
- type ProxyServer
- type RequireEdgeDevice
- type RequireInternetConnectivity
- type RequireNetworkModel
- type Requirement
- type SCEPProfile
- type SFTPStorage
- type StaticNetworkConfig
- type SwitchNetworkInstanceConfig
- type T
- 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
- type TestParameterDescription
- type TestParameterValue
- type TestVariant
- type TransparentProxyConfig
- type USBDevice
- type UsernamePasswordAuth
- type VLANSubinterfaceConfig
- type VirtualNetworkAdapter
- type WiFiNetworkConfig
Constants ¶
const ( // KB is the number of bytes in a kilobyte. KB uint64 = 1 << (10 * iota) // MB is the number of bytes in a megabyte. MB // GB is the number of bytes in a gigabyte. GB // TB is the number of bytes in a terabyte. TB )
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 TPMParameterKey = "TPM"
TPMParameterKey is the key used for the TPM parameter.
Variables ¶
var NilUUID = uuid.UUID{}
NilUUID is special form of UUID that is specified to have all 128 bits set to zero.
Functions ¶
func ChangeSigningCert ¶
ChangeSigningCert replaces the controller signing certificate with the provided one.
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 Close ¶
func Close() error
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 DefineTestParameters ¶
func DefineTestParameters(params ...TestParameterDefinition)
DefineTestParameters defines the set of parameters available to the currently executing test or test suite.
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 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 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
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)
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 topic or message does not exist, cannot be read, or fails to unmarshal into the provided output type.
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 evaluates and enforces the provided test requirements and prepares the test environment accordingly.
The function first validates all supplied requirements. Next, it prepares (or generates) a network model, provisions and configures the required EVE device(s), and ensures that the SDN and broker infrastructure are running and reachable.
Depending on the test context, Setup will start or reuse existing EVE and SDN virtual machines, establish connectivity to the SDN gRPC service using a broker-proxied IP-over-TCP tunnel, and apply the requested network model.
When Setup 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 SkipIfHypervisorKubevirt ¶
func SkipIfHypervisorKubevirt()
SkipIfHypervisorKubevirt skips the current test if the resolved HYPERVISOR parameter is HypervisorKubevirt. Kubevirt is only supported by tests under `evetest/tests/cluster`; non-cluster tests should call this helper right after defining the HypervisorParameter to ensure they are not accidentally exercised on a Kubevirt-flavored EVE build.
func UpdateNetworkModel ¶
func UpdateNetworkModel(netModel *api.NetworkModel)
UpdateNetworkModel updates the current network model, enforcing that device network ports cannot change at runtime.
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
DisableLogs bool
UserData string
NetworkAdapters []AppNetworkAdapter
EnforceNetIntfOrder bool
}
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 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 ClusterNode ¶
type ClusterNode struct {
DevName string
ClusterIP *net.IPNet
ClusterInterface string
BootstrapNode 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.
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 ¶
type DirectlyAssignedNetworkAdapter struct {
LogicalLabel string
}
DirectlyAssignedNetworkAdapter represents network adapter directly assigned to an application (e.g. using PCI passthrough).
type DockerContainer ¶
type DockerContainer struct {
Domain string // default: "index.docker.io"
ImageName string
Tag string
}
DockerContainer defines path to application image stored inside a docker image registry.
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 bool, waitUntilConfirmed bool)
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. 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) *EdgeDevice
FindDeviceHostingApp finds the cluster device that hosts the given application. It watches ZInfoKubeCluster updates from all devices and returns the device whose cluster info reports the app (matched by display name) in EveApps or EveVmApps with a non-empty NodeName.
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, waitUntilPurged bool, timeout time.Duration)
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.
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) 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) 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.
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) 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) 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) 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.
The two flags are evaluated in order: fetch first, then confirm.
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) 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) 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
GetClusterInfo returns the last recorded information about the Kubernetes cluster, or nil if no such info message has been received yet.
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) HardReboot ¶
func (d *EdgeDevice) HardReboot(waitUntilRebooted bool)
HardReboot triggers device reboot through the broker.
func (*EdgeDevice) PurgeApplication ¶
func (d *EdgeDevice) PurgeApplication(appUUID uuid.UUID, waitUntilPurged bool, timeout time.Duration)
PurgeApplication purges the specified application instance and its state.
func (*EdgeDevice) ReadFile ¶
func (d *EdgeDevice) ReadFile(fileName string) []byte
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(waitUntilRebooted bool)
RequestReboot requests a device reboot via configuration and optionally waits until the reboot completes.
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) UpgradeEVE ¶
func (d *EdgeDevice) UpgradeEVE(eveVersion string, waitUntilUpgraded bool)
UpgradeEVE upgrades the EVE OS to the specified version and optionally waits until the upgrade completes.
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.
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) 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) 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) 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) AddBond ¶
func (dc *EdgeDeviceConfig) AddBond(config BondConfig)
AddBond adds a bond (link aggregation) interface to the device configuration.
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) 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) 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 cleans up all associated resources.
func (*EdgeDeviceConfig) DeleteBond ¶
func (dc *EdgeDeviceConfig) DeleteBond(logicalLabel string)
DeleteBond removes a bond identified by its logical label 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) 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) 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) SetConfigProperties ¶
func (dc *EdgeDeviceConfig) SetConfigProperties(configProps *pillartypes.ConfigItemValueMap)
SetConfigProperties : add configuration properties into the device configuration.
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 )
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
}
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 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
}
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 NetworkAdapterConfig ¶
type NetworkAdapterConfig struct {
LogicalLabel string
PhysicalLabel string
InterfaceName string
PCIAddress string
USBAddress string
WirelessType evecommon.WirelessType
Usage evecommon.PhyIoMemberUsage
PNAC PNAC
// 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 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 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 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.
MinRAMInMB uint32 // Default will be 8192 MB.
MinDiskSizeInMB uint32 // Default will be 28576 MB.
WithEVEVersion string
WithHypervisor Hypervisor
WithTPM bool
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
// 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 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
}
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 ¶
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.
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 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 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 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 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
}
VirtualNetworkAdapter represents application virtual network adapters (e.g., virtio, e1000).
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
¶
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" |


