operations

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactoryResetOp

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

FactoryResetOp is a factory reset operation.

func (*FactoryResetOp) Operate

func (s *FactoryResetOp) Operate(t testing.TB)

Operate performs the FactoryReset operation.

func (*FactoryResetOp) String

func (s *FactoryResetOp) String() string

String representation of the method.

func (*FactoryResetOp) WithFactoryOS

func (s *FactoryResetOp) WithFactoryOS(factoryOS bool) *FactoryResetOp

WithFactoryOS instructs the device to rollback to its original OS version.

func (*FactoryResetOp) WithZeroFill

func (s *FactoryResetOp) WithZeroFill(zeroFill bool) *FactoryResetOp

WithZeroFill instructs the device to zero fill persistent storage state data.

type InstallOp

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

InstallOp is an OS install operation.

func (*InstallOp) Operate

func (i *InstallOp) Operate(t testing.TB)

Operate performs the Install operation.

func (*InstallOp) String

func (i *InstallOp) String() string

func (*InstallOp) WithPackageFile

func (i *InstallOp) WithPackageFile(path string) *InstallOp

WithPackageFile specifies the content of the OS package to be installed, in the form of path to an image file. It may be omitted if the device already has the package.

func (*InstallOp) WithPackageReader

func (i *InstallOp) WithPackageReader(reader io.Reader) *InstallOp

WithPackageReader specifies the content of the OS package to be installed, in the form of a reader of its bytes. It may be omitted if the device already has the package. The specified function must return io.EOF when all the content has been read.

func (*InstallOp) WithStandbySupervisor

func (i *InstallOp) WithStandbySupervisor(standby bool) *InstallOp

WithStandbySupervisor specifies whether the installation applies to the Standby Supervisor instead of the Active Supervisor.

func (*InstallOp) WithVersion

func (i *InstallOp) WithVersion(version string) *InstallOp

WithVersion specifies the version of the install operation.

type KillProcessOp

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

KillProcessOp is an operation that kills a process on a device.

func (*KillProcessOp) Operate

func (r *KillProcessOp) Operate(t testing.TB)

Operate performs the kill process operation.

func (*KillProcessOp) String

func (r *KillProcessOp) String() string

func (*KillProcessOp) WithName

func (r *KillProcessOp) WithName(name string) *KillProcessOp

WithName sets the name of the process to be killed.

func (*KillProcessOp) WithPID

func (r *KillProcessOp) WithPID(pid uint32) *KillProcessOp

WithPID sets the PID to be killed.

func (*KillProcessOp) WithRestart

func (r *KillProcessOp) WithRestart(restart bool) *KillProcessOp

WithRestart sets whether the process should restart after being killed.

func (*KillProcessOp) WithSIGHUP

func (r *KillProcessOp) WithSIGHUP() *KillProcessOp

WithSIGHUP sets the kill signal to SIGHUP.

func (*KillProcessOp) WithSIGKILL

func (r *KillProcessOp) WithSIGKILL() *KillProcessOp

WithSIGKILL sets the kill signal to SIGKILL.

func (*KillProcessOp) WithSIGTERM

func (r *KillProcessOp) WithSIGTERM() *KillProcessOp

WithSIGTERM sets the kill signal to SIGTERM.

type Operations

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

Operations is the device operations API.

func New

func New(dut binding.DUT) *Operations

New constructs a new instance of the operations API. Tests must not call this directly

func (*Operations) NewFactoryReset

func (o *Operations) NewFactoryReset() *FactoryResetOp

NewFactoryReset creates a new Factory Reset Operation. By default the FactoryReset is performed without zero_fill and factory_os.

func (*Operations) NewInstall

func (o *Operations) NewInstall() *InstallOp

NewInstall creates a new install operation.

func (*Operations) NewKillProcess

func (o *Operations) NewKillProcess() *KillProcessOp

NewKillProcess creates a new kill process operation. By default the process is killed with a SIGTERM signal.

func (*Operations) NewPing

func (o *Operations) NewPing() *PingOp

NewPing creates a new ping operation.

func (*Operations) NewReboot

func (o *Operations) NewReboot() *RebootOp

NewReboot creates a new reboot operation.

func (*Operations) NewSwitchControlProcessor

func (o *Operations) NewSwitchControlProcessor() *SwitchControlProcessorOp

NewSwitchControlProcessor creates a new switch control processor operation.

func (*Operations) Time

func (o *Operations) Time(t testing.TB) time.Time

Time returns the current system time.

type PingOp

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

PingOp is a ping operation.

func (*PingOp) Operate

func (p *PingOp) Operate(t testing.TB)

Operate performs the Ping operation.

func (*PingOp) String

func (p *PingOp) String() string

func (*PingOp) WithCount

func (p *PingOp) WithCount(count int32) *PingOp

WithCount specifies the number of packets used by a Ping operation.

func (*PingOp) WithDestination

func (p *PingOp) WithDestination(dest string) *PingOp

WithDestination specifies the destination address of the Ping operation.

func (*PingOp) WithPacketSize

func (p *PingOp) WithPacketSize(packetSize int32) *PingOp

WithPacketSize specifies the size of each packet (in bytes) used by a Ping operation.

type RebootOp

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

RebootOp is a reboot operation.

func (*RebootOp) Operate

func (r *RebootOp) Operate(t testing.TB)

Operate performs the Reboot operation.

func (*RebootOp) String

func (r *RebootOp) String() string

func (*RebootOp) WithTimeout

func (r *RebootOp) WithTimeout(timeout time.Duration) *RebootOp

WithTimeout specifies the timeout on the reboot operation.

type SwitchControlProcessorOp

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

SwitchControlProcessorOp is an operation that switches from the current route procesor to a provided destination route processor.

func (*SwitchControlProcessorOp) Operate

func (s *SwitchControlProcessorOp) Operate(t testing.TB)

Operate performs the SwitchControlProcessor operation.

func (*SwitchControlProcessorOp) String

func (s *SwitchControlProcessorOp) String() string

func (*SwitchControlProcessorOp) WithDestination

func (s *SwitchControlProcessorOp) WithDestination(dest string) *SwitchControlProcessorOp

WithDestination sets the destination route processor.

Jump to

Keyboard shortcuts

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