Version: v0.0.0-...-a849576 Latest Latest

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

Go to latest
Published: Nov 9, 2020 License: BSD-3-Clause Imports: 31 Imported by: 0



Package integ contains integ tests run by mage. Certain env vars must be set, or the tests will be skipped.


Optional: * TEMPDIR

See mage for what values are used.



View Source
const GB = 1024 * 1024 * 1024


View Source
var (
	Uefi      bool
	Lcd       bool
	Keep      bool
	M         int
	Img       string
	Tmp       string
	KOverride bool
	P9        bool

see flags below for descriptions


func BaselineVM

func BaselineVM(uefi bool, m int, tb gtst.TB, tmpdir string) *qemu.Options

Defines the base vm used for 'devvm' and lifecycle tests.

func CheckEnv

func CheckEnv(t gtst.TB) (rootDir, mfgKernel string)

func CleanOldDirs

func CleanOldDirs(t gtst.TB, pfx string)

func EnvFromSys

func EnvFromSys(cpus int, kvm bool)

func EraseOpts

func EraseOpts(t gtst.TB, tmpdir string) *qemu.Options

func ExecQuoted

func ExecQuoted(xargs []string) string

pretty-prints (quotes) args for user re-use.

func FRopts

func FRopts(t gtst.TB, tmpdir string) *vmtest.Options

vm options for a fr vm, using test kernel + freshly-built initramfs

func Flags

func Flags()

func GetLcd

func GetLcd() (qemu.Device, error)

Finds lcd info necessary for passthrough to qemu vm. Tested with ftdi devices, not with cdc acm - may need some work there.

func Initramfs

func Initramfs(tmpdir, combinedCpio string, tags []string, dirs ...string) *irfs

func Mfgopts

func Mfgopts(t gtst.TB, tmpdir, mfgurl string, serOut io.WriteCloser) (*vmtest.Options, error)

vm options for a mfg vm, using test kernel + freshly-built initramfs

func PostMfgFixups

func PostMfgFixups(qopts *qemu.Options)

func ReadJson

func ReadJson(dir string) (cmd []string, port int)

func VmDir

func VmDir(tb gtst.TB, pfx string, cleanOld bool) (string, func(tb gtst.TB))

Creates a temp dir, optionally removing old dirs with same prefix. Returns a function to defer for clean up. If cleanOld may be true, tests running simultaneously must not use same pfx.

func WindowedVMCmd

func WindowedVMCmd(opts *qemu.Options) *exec.Cmd

fixes up qemu args to work for windowed display

func WriteJson

func WriteJson(dir string, cmd *exec.Cmd, port int)


type KBuildOpts

type KBuildOpts struct {
	Recipe, Mfg, Norm, Test bool

type NoEscape

type NoEscape struct {
	Out io.WriteCloser

NoEscape is an io.WriteCloser that filters out escape chars, replacing with '~'

func (*NoEscape) Close

func (ne *NoEscape) Close() error

func (*NoEscape) Write

func (ne *NoEscape) Write(b []byte) (int, error)

type P9RecovOpts

type P9RecovOpts struct {
	T          *testing.T
	Qopts      *qemu.Options
	Tmpdir     string
	Upd        []byte
	Krnl, Xlog string
	BadHistory bool
	// contains filtered or unexported fields

func (*P9RecovOpts) Setup

func (p9 *P9RecovOpts) Setup()

Writes files to a dir that'll be shared via 9p as the recovery volume

type UrootLoggerAdapter

type UrootLoggerAdapter struct{}

some u-root functions take a Logger interface. This statisfies that interface, without use/redirection of std log.

func (*UrootLoggerAdapter) Print

func (*UrootLoggerAdapter) Print(v ...interface{})

func (*UrootLoggerAdapter) Printf

func (*UrootLoggerAdapter) Printf(format string, v ...interface{})

type UserOpts

type UserOpts struct {
	Update, CleanTmp bool
	Kvm, Edit        bool
	Cpus             int
	Kernels          KBuildOpts
	Qemu             *uq.Options
	Mtb              *gtst.MockTB
	Tmpdir           string
	Infra            *vm.Mockinfra
	Cleanup          func()
	TmpPfx           string

func (*UserOpts) VmSetup

func (uo *UserOpts) VmSetup()

setup/boilerplate for mfgFrNorm


Path Synopsis
prepare for erase integ test - create filesystem on recovery, write pattern on main volume
prepare for erase integ test - create filesystem on recovery, write pattern on main volume

Jump to

Keyboard shortcuts

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