testutils

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ExpectedTestfsState = `` /* 2455-byte string literal not displayed */

Variables

View Source
var (
	MtreeTestkeywords = []mtree.Keyword{

		"type",
		"uid",
		"gid",
		"mode",
		"link",
		"nlink",
		"xattr",
	}
	MtreeTestkeywordsWithTarTime = append(MtreeTestkeywords, "tar_time")
)

Functions

func AssertFsState

func AssertFsState(t *testing.T, rootfs, rootPath string, keywords []mtree.Keyword, expectedDirectoryHierarchy string)

func WriteTestFileSystem

func WriteTestFileSystem(t *testing.T, testee fs.Writer) (tmpDir string, rootfs string)

Types

type ExpandingWriterMock

type ExpandingWriterMock struct {
	*WriterMock
}

func (*ExpandingWriterMock) Lazy

func (s *ExpandingWriterMock) Lazy(path, name string, src fs.LazySource, written map[fs.Source]string) error

type SourceMock

type SourceMock struct {
	fs.NodeAttrs
	fs.Readable
	Err error
}

func NewSourceMock

func NewSourceMock(t fs.NodeType, a fs.FileAttrs, hash string) *SourceMock

func (*SourceMock) Attrs

func (s *SourceMock) Attrs() fs.NodeInfo

func (*SourceMock) DeriveAttrs

func (s *SourceMock) DeriveAttrs() (fs.DerivedAttrs, error)

func (*SourceMock) HashIfAvailable

func (s *SourceMock) HashIfAvailable() string

func (*SourceMock) String

func (s *SourceMock) String() string

func (*SourceMock) Write

func (s *SourceMock) Write(dest, name string, w fs.Writer, written map[fs.Source]string) (err error)

type SourceOverlayMock

type SourceOverlayMock struct {
	*SourceMock
}

func (*SourceOverlayMock) Expand

func (s *SourceOverlayMock) Expand(dest string, w fs.Writer, _ map[fs.Source]string) (err error)

func (*SourceOverlayMock) String

func (s *SourceOverlayMock) String() string

func (*SourceOverlayMock) Write

func (s *SourceOverlayMock) Write(dest, name string, w fs.Writer, written map[fs.Source]string) error

type TestNode

type TestNode interface {
	Write(fs.Writer) error
}

type WriterMock

type WriterMock struct {
	Written      []string
	WrittenPaths map[string]bool
	Nodes        []string
	// contains filtered or unexported fields
}

func MockWrites

func MockWrites(t *testing.T, f TestNode) *WriterMock

func NewWriterMock

func NewWriterMock(t *testing.T, attrs fs.AttrSet) *WriterMock

func (*WriterMock) Device

func (s *WriterMock) Device(path string, a fs.DeviceAttrs) error

func (*WriterMock) Dir

func (s *WriterMock) Dir(path, name string, a fs.FileAttrs) error

func (*WriterMock) Fifo

func (s *WriterMock) Fifo(path string, a fs.DeviceAttrs) error

func (*WriterMock) File

func (s *WriterMock) File(path string, src fs.FileSource) (fs.Source, error)

func (*WriterMock) Lazy

func (s *WriterMock) Lazy(path, name string, src fs.LazySource, _ map[fs.Source]string) error
func (s *WriterMock) Link(path, target string) error
func (s *WriterMock) LowerLink(path, target string, a *fs.NodeAttrs) error

func (*WriterMock) LowerNode

func (s *WriterMock) LowerNode(path, name string, a *fs.NodeAttrs) error

func (*WriterMock) Mkdir

func (w *WriterMock) Mkdir(dir string) error

func (*WriterMock) Parent

func (w *WriterMock) Parent() error

func (*WriterMock) Remove

func (s *WriterMock) Remove(path string) error
func (s *WriterMock) Symlink(path string, a fs.FileAttrs) error

Jump to

Keyboard shortcuts

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