testmachine

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QEMUDownloadMutex = sync.Mutex{}

Functions

func DownloadQEMUImage

func DownloadQEMUImage(t *testing.T, url string, dest string) error

func SafeName

func SafeName(s string) string

Types

type Backend

type Backend string
const (
	DockerBackend Backend = "docker"
	QEMUBackend   Backend = "qemu"
)

type Config

type Config struct {
	Name        string
	Backend     Backend
	DataPath    string
	SSHUsername string
}

type TestMachine

type TestMachine struct {
	// common stuffs
	Config      Config
	SSHUsername string
	SSHPassword string
	SSHHost     string
	SSHPort     int
	SSHAddress  string
	SSHClient   *ssh.Client
	DataPath    string

	// Docker
	DockertestPool  *dockertest.Pool
	DockerContainer *dockertest.Resource

	// QEMU
	QemuInstance *vmtest.Qemu
}

func New

func New(t *testing.T, config Config) (*TestMachine, error)

func NewDocker

func NewDocker(t *testing.T, config Config) (*TestMachine, error)

func NewQEMU

func NewQEMU(t *testing.T, config Config) (*TestMachine, error)

func (*TestMachine) Close

func (tm *TestMachine) Close() error

Jump to

Keyboard shortcuts

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