fleetboxtest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fleetboxtest provides testing.T integration for fleetbox VMs.

VMs created with Start or StartN are automatically destroyed when the test completes.

Example:

func TestMyApp(t *testing.T) {
	vm := fleetboxtest.Start(t, "debian-12")
	out, err := vm.SSH(context.Background(), "uname -a")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(out)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipIfShort

func SkipIfShort(t testing.TB, reason string)

SkipIfShort skips the test if -short is set.

func Start

func Start(t testing.TB, image string, opts ...fleetbox.Option) *fleetbox.VM

Start creates a VM and registers cleanup to destroy it when the test completes. The VM name is derived from the test name to ensure uniqueness in parallel tests.

func StartN

func StartN(t testing.TB, prefix string, n int, opts ...fleetbox.Option) []*fleetbox.VM

StartN creates N VMs with names prefix-1, prefix-2, etc. All VMs are destroyed when the test completes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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