samples

package
v0.0.0-...-83118d4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SampleTest

type SampleTest struct {
	// The server under test and the configuration with which it should be
	// mounted. These must be set by the user of this type before calling SetUp;
	// all the other fields below are set by SetUp itself.
	Server      fuse.Server
	MountConfig fuse.MountConfig

	// A context object that can be used for long-running operations.
	Ctx context.Context

	// A clock with a fixed initial time. The test's set up method may use this
	// to wire the server with a clock, if desired.
	Clock timeutil.SimulatedClock

	// The directory at which the file system is mounted.
	Dir string

	// Anothing non-nil in this slice will be closed by TearDown. The test will
	// fail if closing fails.
	ToClose []io.Closer
	// contains filtered or unexported fields
}

A struct that implements common behavior needed by tests in the samples/ directory. Use it as an embedded field in your test fixture, calling its SetUp method from your SetUp method after setting the Server field.

func (*SampleTest) SetUp

func (t *SampleTest) SetUp(ti *ogletest.TestInfo)

Mount t.Server and initialize the other exported fields of the struct. Panics on error.

REQUIRES: t.Server has been set.

func (*SampleTest) TearDown

func (t *SampleTest) TearDown()

Unmount the file system and clean up. Panics on error.

type SubprocessTest

type SubprocessTest struct {
	// The type of the file system to mount. Must be recognized by mount_sample.
	MountType string

	// Additional flags to be passed to the mount_sample tool.
	MountFlags []string

	// A list of files to pass to mount_sample. The given string flag will be
	// used to pass the file descriptor number.
	MountFiles map[string]*os.File

	// A context object that can be used for long-running operations.
	Ctx context.Context

	// The directory at which the file system is mounted.
	Dir string

	// Anothing non-nil in this slice will be closed by TearDown. The test will
	// fail if closing fails.
	ToClose []io.Closer
	// contains filtered or unexported fields
}

A struct that implements common behavior needed by tests in the samples/ directory where the file system is mounted by a subprocess. Use it as an embedded field in your test fixture, calling its SetUp method from your SetUp method after setting the MountType and MountFlags fields.

func (*SubprocessTest) SetUp

func (t *SubprocessTest) SetUp(ti *ogletest.TestInfo)

Mount the file system and initialize the other exported fields of the struct. Panics on error.

func (*SubprocessTest) TearDown

func (t *SubprocessTest) TearDown()

Unmount the file system and clean up. Panics on error.

Directories

Path Synopsis
A simple tool for mounting sample file systems, used by the tests in samples/.
A simple tool for mounting sample file systems, used by the tests in samples/.

Jump to

Keyboard shortcuts

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