Documentation
¶
Index ¶
- func CheckError(id string, t *testing.T, expected error, actual error)
- func CheckErrorGlob(id string, t *testing.T, pattern error, actual error)
- func CheckOutput(id string, t *testing.T, expected interface{}, actual interface{}, ...)
- func ExpectErr(id string, t *testing.T, shouldExpectErr bool, err error)
- func Safe[T any](t *T) T
- type Binary
- type ExecRunner
- type ExecRunnerFactory
- type MockIncrementError
- type MockIncrementErrorType
- type MockRunner
- type MockRunnerFactory
- type NotImeplementedError
- type Runner
- type RunnerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckOutput ¶
Types ¶
type Binary ¶
type Binary string
const ( Lsblk Binary = "lsblk" MkfsExt4 Binary = "mkfs.ext4" E2Label Binary = "e2label" MkfsXfs Binary = "mkfs.xfs" XfsAdmin Binary = "xfs_admin" Mount Binary = "mount" Umount Binary = "umount" BlockDev Binary = "blockdev" Tune2fs Binary = "tune2fs" XfsInfo Binary = "xfs_info" Resize2fs Binary = "resize2fs" XfsGrowfs Binary = "xfs_growfs" Pvs Binary = "pvs" PvCreate Binary = "pvcreate" PvResize Binary = "pvresize" Vgs Binary = "vgs" VgCreate Binary = "vgcreate" Lvs Binary = "lvs" LvCreate Binary = "lvcreate" LvChange Binary = "lvchange" LvExtend Binary = "lvextend" )
type ExecRunner ¶
type ExecRunner struct {
// contains filtered or unexported fields
}
func NewExecRunner ¶
func NewExecRunner(binary Binary) *ExecRunner
type ExecRunnerFactory ¶
type ExecRunnerFactory struct {
// contains filtered or unexported fields
}
func NewExecRunnerFactory ¶
func NewExecRunnerFactory() *ExecRunnerFactory
func (*ExecRunnerFactory) Select ¶
func (rc *ExecRunnerFactory) Select(binary Binary) Runner
Caching behaviour is implemented for ExecRunnerFactory as we do not need to validate an ExecRunner more than once
type MockIncrementError ¶
type MockIncrementError struct {
// contains filtered or unexported fields
}
func NewMockIncrementError ¶
func NewMockIncrementError(id string, errorType MockIncrementErrorType, trigger uint32) *MockIncrementError
func (*MockIncrementError) Error ¶
func (mie *MockIncrementError) Error() string
func (*MockIncrementError) Trigger ¶
func (mie *MockIncrementError) Trigger() error
type MockIncrementErrorType ¶
type MockIncrementErrorType string
const ( ErrorUntilTrigger MockIncrementErrorType = "ErrorUntilTrigger" SuccessUntilTrigger MockIncrementErrorType = "SuccessUntilTrigger" )
type MockRunner ¶
type MockRunner struct {
// contains filtered or unexported fields
}
func NewMockRunner ¶
func NewMockRunner(expectedArgs []string, output string, err error) *MockRunner
type MockRunnerFactory ¶
type MockRunnerFactory struct {
// contains filtered or unexported fields
}
func NewMockRunnerFactory ¶
func NewMockRunnerFactory(expectedBinary Binary, expectedArgs []string, output string, err error) *MockRunnerFactory
func (*MockRunnerFactory) Select ¶
func (mrf *MockRunnerFactory) Select(binary Binary) Runner
type NotImeplementedError ¶
type NotImeplementedError struct {
Id string
}
func NewNotImeplementedError ¶
func NewNotImeplementedError(id string) *NotImeplementedError
func (*NotImeplementedError) Error ¶
func (e *NotImeplementedError) Error() string
type RunnerFactory ¶
Click to show internal directories.
Click to hide internal directories.