testutils

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FtimeGranularity added in v0.4.6

func FtimeGranularity() time.Duration

FtimeGranularity is the filesystem timestamp granularity for this system. TODO: We should probably make this dependent on the path since some

filesystems can have different granularities...

func IsTestBinary

func IsTestBinary() bool

IsTestBinary returns whether the current binary is a test binary. This is only ever meant to be used so that test-specific initialisations can be done inside packages. Don't use it for anything else.

func MakeReadOnly added in v0.4.6

func MakeReadOnly(t *testing.T, path string)

MakeReadOnly makes the given path read-only (by bind-mounting it as "ro"). TODO: This should be done through an interface restriction in the test

(which is then backed up by the readonly mount if necessary). The fact
this test is necessary is a sign that we need a better split up of the
CAS interface.

func MakeReadWrite added in v0.4.6

func MakeReadWrite(t *testing.T, path string)

MakeReadWrite undos the effect of MakeReadOnly.

func RandomString added in v0.4.6

func RandomString(n int) string

RandomString returns a pseudorandom alphabetical (mixed-case) string.

func Unix added in v0.4.6

func Unix(sec, nsec int64) time.Time

Unix returns the local Time corresponding to the given Unix time, rounded to the timestamp granularity for this system.

Types

This section is empty.

Jump to

Keyboard shortcuts

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