rsynctest

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyRsync added in v0.2.0

func AnyRsync(t *testing.T) string

func CombinedOutput added in v0.2.3

func CombinedOutput(args ...string) ([]byte, error)

func CommandMain added in v0.2.3

func CommandMain(m *testing.M) error

func ConstructLargeDataFile

func ConstructLargeDataFile(headPattern, bodyPattern, endPattern []byte) []byte

func CreateDummyDeviceFiles

func CreateDummyDeviceFiles(t *testing.T, dir string)

func DataFileMatches

func DataFileMatches(fn string, headPattern, bodyPattern, endPattern []byte) error

func InteropModule

func InteropModule(path string) []rsyncd.Module

InteropModule is a convenience function to define an rsync module named “interop” with the specified path.

func Output added in v0.2.3

func Output(tb testing.TB, args ...string) (stdout []byte, stderr []byte)

func RsyncVersion

func RsyncVersion(t *testing.T) string

func Run added in v0.2.3

func Run(tb testing.TB, args ...string) *rsyncstats.TransferStats

func TridgeOrGTFO added in v0.2.0

func TridgeOrGTFO(t *testing.T, reason string) string

func VerifyDummyDeviceFiles

func VerifyDummyDeviceFiles(t *testing.T, source, dest string)

func WritableInteropModule added in v0.2.0

func WritableInteropModule(path string) []rsyncd.Module

WritableInteropModule is a wrapper around InteropModule that marks the module as writable (not read-only).

func WriteLargeDataFile

func WriteLargeDataFile(t *testing.T, source string, headPattern, bodyPattern, endPattern []byte)

Types

type Option

type Option func(ts *TestServer)

func Listener

func Listener(ln net.Listener) Option

func Listeners

func Listeners(lns []rsyncdconfig.Listener) Option

type TestServer

type TestServer struct {

	// Port is the port on which the test server is listening on. Useful to pass
	// to rsync’s --port option.
	Port string
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, modules []rsyncd.Module, opts ...Option) *TestServer

Jump to

Keyboard shortcuts

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