platformtest

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FailNowSentinel = fmt.Errorf("platformtest: FailNow called on context")
View Source
var SkipNowSentinel = fmt.Errorf("platformtest: SkipNow called on context")
View Source
var ZpoolExportTimeout time.Duration = 500 * time.Millisecond

Functions

func Run

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

Types

type BookmarkOp added in v0.3.0

type BookmarkOp struct {
	Op       Op
	Existing string
	Bookmark string
}

func (*BookmarkOp) Run added in v0.3.0

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

type Context

type Context struct {
	context.Context
	RootDataset string
	// Use this callback from a top-level test case to queue the
	// execution of sub-tests after this test case is complete.
	//
	// Note that the testing harness executes the subtest
	// _after_ the current top-level test. Hence, the subtest
	// cannot use any ZFS state of the top-level test.
	QueueSubtest func(id string, stf func(*Context))
}

func (*Context) Errorf

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

func (*Context) FailNow

func (c *Context) FailNow()

func (*Context) Logf added in v0.3.0

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

func (*Context) SkipNow added in v0.3.0

func (c *Context) SkipNow()

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
	Encrypted bool // only for Op=Add
}

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 (
	Comment         Op = "#"
	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
gen

Jump to

Keyboard shortcuts

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