testutil

package
v0.0.0-...-4e67346 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerBuild

func DockerBuild(tag string, directory string, dockerfile string) error

Builds a container image by invoking the `docker build` command

func DockerCopy

func DockerCopy(source string, dest string) error

Copies files from a running container to the host filesystem by invoking the `docker cp` command

func DockerRun

func DockerRun(image string, command []string, options []string) error

Runs a container by invoking the `docker run` command

func DockerStop

func DockerStop(container string) error

Stops a running container by invoking the `docker kill` command

func Run

func Run(command ...string) error

Prints and executes a command, directing its output to the output streams of the parent process

Types

type SampleImage

type SampleImage struct {

	// The absolute filesystem path to the directory that holds the OCI layout of our sample image
	RootDir string

	// The directory that contains our input Dockerfiles
	DockerfilesDir string

	// The directory that will contain OCI image blobs
	BlobsDir string

	// The directory that will contain extracted filesystem layers
	LayersDir string
}

Represents a sample container image that can be used for testing purposes

func SampleImageForTest

func SampleImageForTest() (*SampleImage, error)

Attempts to create a SampleImage object suitable for use by unit tests

func (*SampleImage) Exists

func (sample *SampleImage) Exists() bool

Determines whether the directory that holds our sample image exists

func (*SampleImage) Generate

func (sample *SampleImage) Generate() error

Generates our sample container image

Jump to

Keyboard shortcuts

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