package testutil

import "github.com/containerd/containerd/pkg/testutil"

Index

Functions

func DumpDir

func DumpDir(t *testing.T, root string)

DumpDir prints the contents of the directory to the testing logger.

Use this in a defer statement from a test that may allocate and exercise a temporary directory. Immensely useful for sanity checking and debugging failing tests.

One should still test that contents are as expected. This is only a visual tool to assist when things don't go your way.

func DumpDirOnFailure

func DumpDirOnFailure(t *testing.T, root string)

DumpDirOnFailure prints the contents of the directory to the testing logger if the test has failed.

func RequiresRoot

func RequiresRoot(t testing.TB)

RequiresRoot does nothing on Windows

func RequiresRootM

func RequiresRootM()

RequiresRootM is similar to RequiresRoot but intended to be called from *testing.M.

func Unmount

func Unmount(t *testing.T, mountPoint string)

Unmount unmounts a given mountPoint and sets t.Error if it fails Does nothing on Windows

Source Files

helpers.go helpers_windows.go

Version
v1.6.0-beta.0
Published
Oct 11, 2021
Platform
windows/amd64
Imports
6 packages
Last checked
1 minute ago

Tools for package owners.