expect

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACE

type ACE struct {
	Endpoint string
	Drop     bool
}

ACE is an access control entry (a single entry of ACL).

type ACLs

type ACLs map[string][]ACE // network instance -> ACL (list of ACEs)

ACLs is a map of access control lists assigned to network instances.

type AppExpectation

type AppExpectation struct {
	// contains filtered or unexported fields
}

AppExpectation is description of app, expected to run on EVE

func AppExpectationFromURL

func AppExpectationFromURL(ctrl controller.Cloud, device *device.Ctx, appLink string, podName string, opts ...ExpectationOption) (expectation *AppExpectation)

AppExpectationFromURL init AppExpectation with defined:

appLink - docker url to pull or link to qcow2 image or path to qcow2 image file
podName - name of app
device - device to set updates in volumes and content trees
opts can be used to modify parameters of expectation

func (*AppExpectation) Application

func (exp *AppExpectation) Application() *config.AppInstanceConfig

Application expectation gets or creates Image definition, gets or create NetworkInstance definition, gets AppInstanceConfig and returns it or creates AppInstanceConfig, adds it into internal controller and returns it

func (*AppExpectation) BaseOS added in v1.0.0

func (exp *AppExpectation) BaseOS(baseOSVersion string) (baseOS *config.BaseOS)

BaseOS expectation gets or creates BaseOS definition, adds contentTree into internal controller and returns BaseOS if version is not empty will use it as BaseOSVersion

func (*AppExpectation) BaseOSConfig added in v1.0.0

func (exp *AppExpectation) BaseOSConfig(baseOSVersion string) (baseOSConfig *config.BaseOSConfig)

BaseOSConfig expectation gets or creates BaseOSConfig definition, adds it into internal controller and returns it if version is not empty will use it as BaseOSVersion

func (*AppExpectation) DataStore

func (exp *AppExpectation) DataStore() (datastore *config.DatastoreConfig)

DataStore expects datastore in controller it gets DatastoreConfig with defined in AppExpectation params, or creates new one, if not exists

func (*AppExpectation) Image

func (exp *AppExpectation) Image() (image *config.Image)

Image expects image in controller it gets Image with defined in AppExpectation params, or creates new one, if not exists

func (*AppExpectation) NetworkInstances

func (exp *AppExpectation) NetworkInstances() (networkInstances map[*NetInstanceExpectation]*config.NetworkInstanceConfig)

NetworkInstances expects network instances in cloud it iterates over NetworkInstanceConfigs from exp.netInstances, gets or creates new one, if not exists

func (*AppExpectation) Volume

func (exp *AppExpectation) Volume() *config.Volume

Volume generates volume for provided expectation

type ExpectationOption

type ExpectationOption func(expectation *AppExpectation)

ExpectationOption is type to use for creation of AppExpectation

func AddNetInstanceAndPortPublish

func AddNetInstanceAndPortPublish(subnetCidr, networkType, netInstanceName string, portPublish []string, uplinkAdapter string) ExpectationOption

AddNetInstanceAndPortPublish adds NetInstance with defined subnet cidr, networkType, netInstanceName and ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func AddNetInstanceNameAndPortPublish

func AddNetInstanceNameAndPortPublish(netInstance string, portPublish []string) ExpectationOption

AddNetInstanceNameAndPortPublish adds NetInstance with defined name and ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func WithACL

func WithACL(acl ACLs) ExpectationOption

WithACL sets access only for defined hosts

func WithAdditionalDisks

func WithAdditionalDisks(disks []string) ExpectationOption

WithAdditionalDisks adds disks to application

func WithAppAdapters

func WithAppAdapters(appadapters []string) ExpectationOption

WithAppAdapters assigns adapters for created apps

func WithDatastoreOverride

func WithDatastoreOverride(datastoreOverride string) ExpectationOption

WithDatastoreOverride set override for datastore for app

func WithDiskSize

func WithDiskSize(diskSizeBytes int64) ExpectationOption

WithDiskSize set disk size for created app (equals with image size if not defined)

func WithFlowlog added in v1.0.0

func WithFlowlog(networkName string) ExpectationOption

WithFlowlog enables flow logging for the given network instance.

func WithHTTPDirectLoad

func WithHTTPDirectLoad(direct bool) ExpectationOption

WithHTTPDirectLoad use eserver only for SHA calculation

func WithImageFormat

func WithImageFormat(format string) ExpectationOption

WithImageFormat sets app format

func WithMetadata

func WithMetadata(metadata string) ExpectationOption

WithMetadata sets metadata for created apps if existing file provided, use its content

func WithOldApp

func WithOldApp(appName string) ExpectationOption

WithOldApp sets old app name to get info from

func WithOpenStackMetadata

func WithOpenStackMetadata(openStackMetadata bool) ExpectationOption

WithOpenStackMetadata use openstackMetadata for VM

func WithPinCpus added in v1.0.0

func WithPinCpus(pinCpus bool) ExpectationOption

WithPinCpus set pin-cpus option

func WithPortsPublish

func WithPortsPublish(portPublish []string) ExpectationOption

WithPortsPublish sets ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func WithProfiles

func WithProfiles(profiles []string) ExpectationOption

WithProfiles set profileList for appInstance

func WithRegistry

func WithRegistry(registry string) ExpectationOption

WithRegistry sets registry to use (remote/local)

func WithResources

func WithResources(cpus uint32, memory uint32) ExpectationOption

WithResources sets cpu count and memory for app

func WithSFTPLoad

func WithSFTPLoad(sftp bool) ExpectationOption

WithSFTPLoad force eserver to serve image via sftp

func WithStartDelay added in v1.0.0

func WithStartDelay(startDelay uint32) ExpectationOption

WithStartDelay set start delay option

func WithStaticDNSEntries

func WithStaticDNSEntries(networkName string, dnsEntries []string) ExpectationOption

WithStaticDNSEntries extends network configuration with static DNS entries in format ["HOSTNAME:IP_ADDRESS,IP_ADDRESS,..."]

func WithVLANs

func WithVLANs(vlans map[string]int) ExpectationOption

WithVLANs sets access VLAN IDs for application interfaces

func WithVirtualizationMode

func WithVirtualizationMode(virtualizationMode config.VmMode) ExpectationOption

WithVirtualizationMode sets virtualizationMode for app

func WithVnc

func WithVnc(vncDisplay uint32) ExpectationOption

WithVnc enables VNC and sets VNC display number

func WithVncPassword

func WithVncPassword(password string) ExpectationOption

WithVncPassword sets VNC password

func WithVolumeSize

func WithVolumeSize(volumeSizeBytes int64) ExpectationOption

WithVolumeSize set volume size for created app

func WithVolumeType

func WithVolumeType(volumesType VolumeType) ExpectationOption

WithVolumeType sets empty volumes type for app

type NetInstanceExpectation

type NetInstanceExpectation struct {
	// contains filtered or unexported fields
}

NetInstanceExpectation stores options for create NetworkInstanceConfigs for apps

type VolumeType

type VolumeType string

VolumeType defines type of empty volumes to use

var VolumeISO VolumeType = "iso"

VolumeISO use ISO image for volumes

var VolumeNone VolumeType = "none"

VolumeNone use no volumes

var VolumeOCI VolumeType = "oci"

VolumeOCI use empty oci image for volumes

var VolumeQcow VolumeType = "qcow"

VolumeQcow use empty raw image for volumes

var VolumeQcow2 VolumeType = "qcow2"

VolumeQcow2 use empty qcow2 image for volumes

var VolumeRaw VolumeType = "raw"

VolumeRaw use empty raw image for volumes

var VolumeVHDX VolumeType = "vhdx"

VolumeVHDX use empty raw image for volumes

var VolumeVMDK VolumeType = "vmdk"

VolumeVMDK use empty raw image for volumes

func VolumeTypeByName

func VolumeTypeByName(name string) VolumeType

VolumeTypeByName returns VolumeType by name

Jump to

Keyboard shortcuts

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