Documentation ¶
Index ¶
- Constants
- func SSHDialTimeout(network, addr string, config *ssh.ClientConfig, timeout time.Duration) (*ssh.Client, error)
- func SystemdUnitIsActive(s string, st *SUT)
- func SystemdUnitIsStarted(s string, st *SUT)
- type Conn
- type DiskLayout
- type PartitionEntry
- type SUT
- func (s SUT) AssertBootedFrom(b string)
- func (s *SUT) BootFrom() string
- func (s *SUT) ChangeBoot(b string) error
- func (s *SUT) ChangeBootOnce(b string) error
- func (s *SUT) Command(cmd string) (string, error)
- func (s *SUT) EjectCD()
- func (s SUT) ElementalCmd(args ...string) string
- func (s *SUT) EmptyDisk(disk string)
- func (s *SUT) EventuallyConnects(t ...int)
- func (s SUT) GatherAllLogs()
- func (s SUT) GatherLog(logPath string)
- func (s *SUT) GetArch() string
- func (s SUT) GetDiskLayout(disk string) DiskLayout
- func (s *SUT) GetOSRelease(ss string) string
- func (s *SUT) IsVMRunning() bool
- func (s *SUT) PowerOff()
- func (s *SUT) Reboot(t ...int)
- func (s *SUT) Reset()
- func (s *SUT) RestoreCD()
- func (s *SUT) RestoreSnapshot() error
- func (s *SUT) SendFile(src, dst, permission string) error
- func (s *SUT) SetCDLocation()
- func (s *SUT) Snapshot() error
- func (s *SUT) Start()
Constants ¶
const ( Passive = "passive" Active = "active" Recovery = "recovery" LiveCD = "liveCD" UnknownBoot = "unknown" TimeoutRawDiskTest = 600 // Timeout to connect for recovery_raw_disk_test Ext2 = "ext2" Ext3 = "ext3" Ext4 = "ext4" Cos = "cos" )
Variables ¶
This section is empty.
Functions ¶
func SSHDialTimeout ¶
func SystemdUnitIsActive ¶
func SystemdUnitIsStarted ¶
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 TestVersion string CDLocation string MachineID string VMPid int // contains filtered or unexported fields }
func (SUT) AssertBootedFrom ¶
AssertBootedFrom asserts that we booted from the proper type and adds a helpful message
func (*SUT) ChangeBoot ¶
func (*SUT) ChangeBootOnce ¶
func (*SUT) EjectCD ¶
func (s *SUT) EjectCD()
EjectCD force removes the DVD so we can boot from disk directly on EFI VMs
func (SUT) ElementalCmd ¶
ElementalCmd will run the default elemental binary with some default flags useful for testing and the given args it allows overriding the default args just in case
func (*SUT) EmptyDisk ¶
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 (SUT) GatherAllLogs ¶
func (s SUT) GatherAllLogs()
GatherAllLogs will try to gather as much info from the system as possible, including services, dmesg and os related info
func (SUT) GetDiskLayout ¶
func (s SUT) GetDiskLayout(disk string) DiskLayout
func (*SUT) GetOSRelease ¶
func (*SUT) IsVMRunning ¶
func (*SUT) Reset ¶
func (s *SUT) Reset()
Reset runs reboots cOS into Recovery and runs elemental reset. It will boot back the system from the Active partition afterwards
func (*SUT) RestoreCD ¶
func (s *SUT) RestoreCD()
RestoreCD reattaches the previously mounted iso to the VM
func (*SUT) RestoreSnapshot ¶
func (*SUT) SetCDLocation ¶
func (s *SUT) SetCDLocation()
SetCDLocation gets the location of the iso attached to the vbox vm and stores it for later remount