xunixfake

package
v0.0.0-...-0f74808 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCmd

type FakeCmd struct {
	*testexec.FakeCmd
	FakeProcess *os.Process
	WaitFn      func() error
	Called      bool
}

func (*FakeCmd) OSProcess

func (f *FakeCmd) OSProcess() *os.Process

func (*FakeCmd) Wait

func (f *FakeCmd) Wait() error

type FakeExec

type FakeExec struct {
	Commands       map[string]*FakeCmd
	DefaultFakeCmd *FakeCmd
}

func (*FakeExec) AddCommands

func (f *FakeExec) AddCommands(cmds ...*FakeCmd)

func (*FakeExec) AssertCommandsCalled

func (f *FakeExec) AssertCommandsCalled(t *testing.T)

func (*FakeExec) CommandContext

func (f *FakeExec) CommandContext(_ context.Context, cmd string, args ...string) xunix.Cmd

type FileOwner

type FileOwner struct {
	UID int
	GID int
}

type MemFS

type MemFS struct {
	*afero.MemMapFs
	Owner map[string]FileOwner
}

func (*MemFS) Chown

func (m *MemFS) Chown(path string, uid int, gid int) error

This is so annoying...

func (*MemFS) GetFileOwner

func (m *MemFS) GetFileOwner(path string) (FileOwner, bool)

func (*MemFS) LStat

func (m *MemFS) LStat(path string) (fs.FileInfo, error)

LStat doesn't follow symbolic links since this is a in-mem fake.

func (*MemFS) Mknod

func (m *MemFS) Mknod(path string, mode uint32, dev int) error
func (*MemFS) Readlink(path string) (string, error)

Readlink doesn't actually read symbolic links since this is a in-mem fake.

Jump to

Keyboard shortcuts

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