platformtest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, rk RunKind, rootds string, stmtsStr string)

func WithLogger

func WithLogger(ctx context.Context, logger Logger) context.Context

Types

type Context

type Context struct {
	context.Context
	RootDataset string
}

func (*Context) Errorf

func (c *Context) Errorf(format string, args ...interface{})

func (*Context) FailNow

func (c *Context) FailNow()

type DestroyRootOp

type DestroyRootOp struct {
	Path string
}

func (*DestroyRootOp) Run

func (o *DestroyRootOp) Run(ctx context.Context, e Execer) error

type Execer

type Execer interface {
	RunExpectSuccessNoOutput(ctx context.Context, cmd string, args ...string) error
	RunExpectFailureNoOutput(ctx context.Context, cmd string, args ...string) error
}

func NewEx

func NewEx(log Logger) Execer

type FSOp

type FSOp struct {
	Op   Op
	Path string
}

func (*FSOp) Run

func (o *FSOp) Run(ctx context.Context, e Execer) error

type LineError

type LineError struct {
	Line string
	What string
}

func (LineError) Error

func (e LineError) Error() string

type Logger

type Logger = logger.Logger

func GetLog added in v0.2.1

func GetLog(ctx context.Context) Logger

type Op

type Op string
const (
	AssertExists    Op = "!E"
	AssertNotExists Op = "!N"
	Add             Op = "+"
	Del             Op = "-"
	RunCmd          Op = "R"
	DestroyRoot     Op = "DESTROYROOT"
	CreateRoot      Op = "CREATEROOT"
)

type RunKind

type RunKind int
const (
	PanicErr RunKind = 1 << iota
	RunAll
)

type RunOp

type RunOp struct {
	RootDS string
	Script string
}

func (*RunOp) Run

func (o *RunOp) Run(ctx context.Context, e Execer) error

type SnapOp

type SnapOp struct {
	Op   Op
	Path string
}

func (*SnapOp) Run

func (o *SnapOp) Run(ctx context.Context, e Execer) error

type Stmt

type Stmt interface {
	Run(context context.Context, e Execer) error
}

type Zpool

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

func CreateOrReplaceZpool

func CreateOrReplaceZpool(ctx context.Context, e Execer, args ZpoolCreateArgs) (*Zpool, error)

func (*Zpool) Destroy

func (p *Zpool) Destroy(ctx context.Context, e Execer) error

func (*Zpool) Name

func (p *Zpool) Name() string

type ZpoolCreateArgs

type ZpoolCreateArgs struct {
	PoolName   string
	ImagePath  string
	ImageSize  int64
	Mountpoint string
}

func (ZpoolCreateArgs) Validate

func (a ZpoolCreateArgs) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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