Documentation ¶
Index ¶
- type CmdRet
- type Shell
- func (l *Shell) CheckOnly(cmd string) error
- func (l *Shell) CheckRCTimeout(cmd string, rc int, timeout time.Duration) (CmdRet, error)
- func (l *Shell) Logout() error
- func (l *Shell) Poweroff() error
- func (l *Shell) Reboot() error
- func (l *Shell) Run(cmd string) CmdRet
- func (l *Shell) RunTimeout(cmd string, timeout time.Duration) CmdRet
- func (l *Shell) WaitForBooted() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdRet ¶
CmdRet - a command execution result.
func (*CmdRet) AssertMatches ¶
AssertMatches - regexp 'match' is not found in string 'msg'
func (*CmdRet) StringIndent ¶
StringIndent - get a cmdRet String with indentation.
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
Shell - A login shell, set to execute comands.
func (*Shell) CheckRCTimeout ¶
CheckRCTimeout - execute cmd, return a CmdRet, and error if rc != cmdR.RC
func (*Shell) Poweroff ¶
Poweroff - just power off the machine and wait for the final "Power down" message. This is its own helper because you could not use RunBash for the obvious reason.
func (*Shell) RunTimeout ¶
RunTimeout - pass 'cmd' to bash.
Fatalf on command execution error or timeout. return error if CmdRet.RC != 0
func (*Shell) WaitForBooted ¶
WaitForBooted - after system is logged in, wait until systemd says it is ready.
Click to show internal directories.
Click to hide internal directories.