Help us shape the future of Go! Take the 2026 Go Developer Survey

testbundle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testbundle writes small, sparse, contract-shaped bundle directories for unit and acceptance tests.

Index

Constants

View Source
const ContractSize = 2*spec.ChunkSize + spec.ChunkSize/2

ContractSize is 1.25 GiB: two full chunks (the second all zero with the default DataAt) and a short third chunk.

Variables

View Source
var ErrOptions = errors.New("testbundle: invalid options")

ErrOptions reports unusable options.

Functions

func Write

func Write(dir string, o Options) error

Write creates dir and writes a bundle into it.

Types

type Options

type Options struct {
	OS   string // darwin, windows or linux
	Arch string // arm64 or amd64
	// Size is the disk0 logical size; default 8 MiB (one short chunk). Use
	// ContractSize for a disk with full 512 MiB chunks and a zero chunk.
	Size int64
	// DataAt lists offsets where 64 KiB of pseudo-random data is written;
	// default puts data in the first and last chunk so the middle chunk is zero.
	DataAt []int64
	// ExtraDisk adds a 1 MiB all-zero data disk named disk1 (one zero chunk).
	ExtraDisk bool
	// Seed makes the data deterministic.
	Seed uint64
	// Version is the org.opencontainers.image.version annotation.
	Version string
}

Options describe the bundle to write.

Jump to

Keyboard shortcuts

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