sut

package
v0.0.0-...-0e5df24 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Passive is indicating the system passive partition
	Passive = 0
	// Active is indicating the system active partition
	Active = iota
	// Recovery is indicating the system recovery partition
	Recovery = iota
	// LiveCD is indicating the livecd boot environment
	LiveCD = iota
	// UnknownBoot means that the boot typology could have not been determined
	UnknownBoot = iota

	// TimeoutRawDiskTest aimeout to connect for recovery_raw_disk_test
	TimeoutRawDiskTest = 600
)

Variables

This section is empty.

Functions

func DialWithDeadline

func DialWithDeadline(network string, addr string, config *ssh.ClientConfig, timeout bool) (*ssh.Client, error)

DialWithDeadline Dials SSH with a deadline to avoid Read timeouts

Types

type DiskLayout

type DiskLayout struct {
	BlockDevices []PartitionEntry `json:"blockdevices"`
}

DiskLayout is the struct that contains the disk output from lsblk

func (DiskLayout) GetPartition

func (d DiskLayout) GetPartition(label string) (PartitionEntry, error)

type PartitionEntry

type PartitionEntry struct {
	Label  string `json:"label,omitempty"`
	Size   int    `json:"size,omitempty"`
	FsType string `json:"fstype,omitempty"`
}

PartitionEntry represents a partition entry

type SUT

type SUT struct {
	Host        string
	Username    string
	Password    string
	Timeout     int
	GreenRepo   string
	TestVersion string
	CDLocation  string
}

func NewSUT

func NewSUT() *SUT

func (*SUT) BootFrom

func (s *SUT) BootFrom() int

BootFrom returns the booting partition of the SUT

func (*SUT) ChangeBoot

func (s *SUT) ChangeBoot(b int) error

func (*SUT) ChangeBootOnce

func (s *SUT) ChangeBootOnce(b int) error

func (*SUT) Command

func (s *SUT) Command(cmd string) (string, error)

Command sends a command to the SUIT and waits for reply

func (*SUT) EjectCOSCD

func (s *SUT) EjectCOSCD()

EjectCOSCD force removes the DVD so we can boot from disk directly on EFI VMs

func (*SUT) EmptyDisk

func (s *SUT) EmptyDisk(disk string)

EmptyDisk will try to trash the disk given so on reboot the disk is empty and we are forced to use the cd to boot used mainly for installer testing booting from iso

func (*SUT) EventuallyConnects

func (s *SUT) EventuallyConnects(t ...int)

func (SUT) GatherAllLogs

func (s SUT) GatherAllLogs(services []string, logFiles []string)

GatherAllLogs will try to gather as much info from the system as possible, including services, dmesg and os related info

func (SUT) GatherLog

func (s SUT) GatherLog(logPath string)

GatherLog will try to scp the given log from the machine to a local file

func (*SUT) GetArch

func (s *SUT) GetArch() string

func (SUT) GetDiskLayout

func (s SUT) GetDiskLayout(disk string) DiskLayout

func (*SUT) GetOSRelease

func (s *SUT) GetOSRelease(ss string) string

func (*SUT) Reboot

func (s *SUT) Reboot(t ...int)

Reboot reboots the system under test

func (*SUT) Reset

func (s *SUT) Reset()

Reset runs reboots cOS into Recovery and runs cos-reset. It will boot back the system from the Active partition afterwards

func (*SUT) RestoreCOSCD

func (s *SUT) RestoreCOSCD()

RestoreCOSCD reattaches the cOS iso to the VM

func (*SUT) SendFile

func (s *SUT) SendFile(src, dst, permission string) error

func (*SUT) SetCOSCDLocation

func (s *SUT) SetCOSCDLocation()

SetCOSCDLocation gets the location of the iso attached to the vbox vm and stores it for later remount

func (*SUT) SquashFSRecovery

func (s *SUT) SquashFSRecovery() bool

SquashFSRecovery returns true if we are in recovery mode and booting from squashfs

func (*SUT) WriteInlineFile

func (s *SUT) WriteInlineFile(content, path string)

Jump to

Keyboard shortcuts

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