testutil

package
v0.0.0-...-8218a20 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext(t *testing.T) context.Context

CreateContext creates a context aware of the provided a testing.T's deadline

func TestClose

func TestClose(t *testing.T, dev usbdlib.Device)

TestClose confirms the device close without error and subsequent operations fail as expected

func TestDevSize

func TestDevSize(t *testing.T, dev usbdlib.Device, expectedSize uint)

TestDevSize verfies the provided device reports the correct size

func TestNBD

func TestNBD(t *testing.T, dev usbdlib.Device, expectedSize uint)

TestNBD runs a similar test suite as TestUserspace but puts kernel-space NBD in the middle for an end-to-end test. This requires privilege execution!

func TestReadEmpty

func TestReadEmpty(t *testing.T, dev usbdlib.Device, boundaryBytes uint)

TestReadEmpty verifies the provided device reads as empty

func TestReadHash

func TestReadHash(t *testing.T, dev usbdlib.Device, expectedHash []byte)

TestReadHash confirms the SHA of the provided device matches the expected SHA

func TestUserspace

func TestUserspace(t *testing.T, dev usbdlib.Device, expectedSize uint)

TestUserspace runs a suite of basic sanity tests on the provided device directly without using Linux kernel facilities such as NBD

func TestWriteReadPattern

func TestWriteReadPattern(t *testing.T, dev usbdlib.Device) (writtenHash []byte)

TestWriteReadPattern writes and reads a pattern to the provided device

Types

This section is empty.

Jump to

Keyboard shortcuts

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