Documentation
¶
Overview ¶
Simple copy file
Simplifies work with file testing ¶
Simplifies work with ssh testing
Index ¶
- func CompareDirFiles(dir1, dir2 string) error
- func CopyFile(src, dst string) error
- func CreateRandomFiles(dir string, amount int) ([]string, error)
- func ExpectFailure(t *testing.T, f func(tt testing.TB))
- func MockSSHPortServer(t *testing.T, user, pass, key string) (string, string)
- func MockSSHPtyServer(t *testing.T, user, pass, key string) (string, string)
- func MockSSHServer(t *testing.T, sshSrv *sshd.Server, user, pass, key string) (string, string)
- func MockSSHSftpServer(t *testing.T, user, pass, key string) (string, string)
- func Retry(r Retryer, t Failer, f func(r *R))
- func RunCmdPtySSH(addr, username, password, cmd string) ([]byte, error)
- func RunSftp(addr, username, password string, files []string, toPath string, toRemote bool) error
- type AFInstance
- func (afi *AFInstance) APIAddress(path string) string
- func (afi *AFInstance) APIEndpoint() string
- func (afi *AFInstance) AdminToken() string
- func (afi *AFInstance) Cleanup(tb testing.TB)
- func (afi *AFInstance) IsRunning() bool
- func (afi *AFInstance) NewAfInstanceCluster(tb testing.TB, name, cfg string) *AFInstance
- func (afi *AFInstance) NewClusterNode(tb testing.TB, name, cfg string, args ...string) *AFInstance
- func (afi *AFInstance) PrintMemUsage(tb testing.TB)
- func (afi *AFInstance) ProxySSHEndpoint() string
- func (afi *AFInstance) Restart(tb testing.TB, args ...string)
- func (afi *AFInstance) Start(tb testing.TB, args ...string)
- func (afi *AFInstance) Stop(tb testing.TB)
- func (afi *AFInstance) WaitForLog(substring string, call func(string, string) bool)
- func (afi *AFInstance) Workspace() string
- type Counter
- type Failer
- type MockT
- type R
- type Retryer
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareDirFiles ¶ added in v0.7.6
func CreateRandomFiles ¶ added in v0.7.6
CreateRandomFiles will take directory and put there as much random files as you want
func ExpectFailure ¶
xpectFailure when failure expected
func MockSSHPortServer ¶ added in v0.7.6
func MockSSHPtyServer ¶ added in v0.7.6
func MockSSHServer ¶ added in v0.7.6
Base ssh server with no handler
func MockSSHSftpServer ¶ added in v0.7.6
func RunCmdPtySSH ¶ added in v0.7.6
Types ¶
type AFInstance ¶ added in v0.7.5
type AFInstance struct {
// contains filtered or unexported fields
}
AFInstance saves state of the running Aquarium Fish for particular test
func NewAfInstance ¶
func NewAfInstance(tb testing.TB, name, cfg string) *AFInstance
NewAfInstance helpful if you need to create instance without starting it up right away
func NewAquariumFish ¶
func NewAquariumFish(tb testing.TB, name, cfg string, args ...string) *AFInstance
NewAquariumFish simple creates and run the fish node
func (*AFInstance) APIAddress ¶ added in v0.7.5
func (afi *AFInstance) APIAddress(path string) string
APIAddress will return url to access API of AquariumFish
func (*AFInstance) APIEndpoint ¶ added in v0.7.6
func (afi *AFInstance) APIEndpoint() string
APIEndpoint will return IP:PORT
func (*AFInstance) AdminToken ¶ added in v0.7.5
func (afi *AFInstance) AdminToken() string
AdminToken returns admin token
func (*AFInstance) Cleanup ¶ added in v0.7.5
func (afi *AFInstance) Cleanup(tb testing.TB)
Cleanup after the test execution
func (*AFInstance) IsRunning ¶ added in v0.7.5
func (afi *AFInstance) IsRunning() bool
IsRunning checks the fish instance is running
func (*AFInstance) NewAfInstanceCluster ¶ added in v0.7.5
func (afi *AFInstance) NewAfInstanceCluster(tb testing.TB, name, cfg string) *AFInstance
NewAfInstanceCluster just creates the node based on the existing cluster node
func (*AFInstance) NewClusterNode ¶ added in v0.7.5
func (afi *AFInstance) NewClusterNode(tb testing.TB, name, cfg string, args ...string) *AFInstance
NewClusterNode starts another node of cluster It will automatically add cluster_join parameter to the config
func (*AFInstance) PrintMemUsage ¶ added in v0.8.0
func (afi *AFInstance) PrintMemUsage(tb testing.TB)
func (*AFInstance) ProxySSHEndpoint ¶ added in v0.7.6
func (afi *AFInstance) ProxySSHEndpoint() string
ProxySSHEndpoint will return IP:PORT
func (*AFInstance) Restart ¶ added in v0.7.5
func (afi *AFInstance) Restart(tb testing.TB, args ...string)
Restart the application
func (*AFInstance) Start ¶ added in v0.7.5
func (afi *AFInstance) Start(tb testing.TB, args ...string)
Start the fish node executable
func (*AFInstance) Stop ¶ added in v0.7.5
func (afi *AFInstance) Stop(tb testing.TB)
Stop the fish node executable
func (*AFInstance) WaitForLog ¶ added in v0.8.0
func (afi *AFInstance) WaitForLog(substring string, call func(string, string) bool)
WaitForLog stores substring to be looked in the Fish log to execute call function with substring & found line
func (*AFInstance) Workspace ¶ added in v0.7.5
func (afi *AFInstance) Workspace() string
Workspace will return workspace of the AquariumFish
type Counter ¶
Counter repeats an operation a given number of times and waits between subsequent operations.
type Failer ¶
type Failer interface {
Helper()
// Log is called for the final test output
Log(args ...any)
// FailNow is called when the retrying is abandoned.
FailNow()
}
Failer is an interface compatible with testing.T.
type R ¶
type R struct {
// contains filtered or unexported fields
}
R provides context for the retryer.