testutil

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDockerRunning

func CheckDockerRunning(t *testing.T, reason string)

CheckDockerRunning skips a test when Docker is unavailable.

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies a test fixture directory.

func CreateBundleFromTestData

func CreateBundleFromTestData(t *testing.T, testDataRelPath, arch string) string

CreateBundleFromTestData creates a bundle from a copied test fixture and returns the resulting archive path.

func CreateBundleFromTestDataCLI

func CreateBundleFromTestDataCLI(t *testing.T, testDataRelPath, arch string) string

CreateBundleFromTestDataCLI creates an artifact with the configured CLI binary.

func CreateBundleFromTestDataCLIWithBinary

func CreateBundleFromTestDataCLIWithBinary(t *testing.T, udsPath, testDataRelPath, arch string) string

CreateBundleFromTestDataCLIWithBinary creates an artifact with a selected CLI binary.

func CreateBundleFromTestDataCobra

func CreateBundleFromTestDataCobra(t *testing.T, testDataRelPath, arch string) string

CreateBundleFromTestDataCobra creates an artifact through the Cobra command tree.

func CreateBundleFromTestDataExpectError

func CreateBundleFromTestDataExpectError(t *testing.T, testDataRelPath, arch string) string

CreateBundleFromTestDataExpectError creates a bundle from a copied test fixture, asserts that creation fails, and returns the copied fixture directory so callers can assert that no archive was written.

func CreateBundleFromTestDataWithDiagnostics

func CreateBundleFromTestDataWithDiagnostics(t *testing.T, testDataRelPath, arch string) (string, string)

CreateBundleFromTestDataWithDiagnostics creates a bundle from a copied test fixture and returns its archive path and captured diagnostic output.

func DeleteK3dCluster

func DeleteK3dCluster(t *testing.T, clusterName string)

DeleteK3dCluster removes a test cluster if it exists.

func PrepareBundleDir

func PrepareBundleDir(t *testing.T, testDataRelPath string) string

PrepareBundleDir copies bundle fixture data into a temporary directory.

func RunBundleDeploy

func RunBundleDeploy(t *testing.T, udsPath, artifactPath string)

RunBundleDeploy deploys an artifact with the selected CLI binary.

func TestDataPath

func TestDataPath(relPath string) string

func UDSCLIPath

func UDSCLIPath(t *testing.T, runHint string) string

UDSCLIPath returns the configured CLI binary path or skips the test.

Types

type ZarfLayoutDigests

type ZarfLayoutDigests struct {
	// ComponentHexes maps component names to their layer blob's SHA-256 hex digest.
	ComponentHexes map[string]string
}

ZarfLayoutDigests holds per-component SHA-256 digests written by WriteZarfLikeOCILayout.

func WriteZarfLikeOCILayout

func WriteZarfLikeOCILayout(t *testing.T, layoutDir string, required, optional []string) ZarfLayoutDigests

WriteZarfLikeOCILayout creates a complete OCI image layout directory in layoutDir that mimics a single-manifest Zarf package. required and optional specify component names. Returns zarfLayoutDigests with a map of component name → sha256 hex digest.

Jump to

Keyboard shortcuts

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