Files
kopia/tests/robustness/multiclient_test/framework/framework.go
Jarek Kowalski 8a4ac4dec3 Upgraded linter to 1.43.0 (#1505)
* fixed new gocritic violations
* fixed new 'contextcheck' violations
* fixed 'gosec' warnings
* suppressed ireturn and varnamelen linters
* fixed tenv violations, enabled building robustness tests on arm64
* fixed remaining linux failures
* makefile: fixed 'lint-all' target when running on arm64
* linter: increase deadline
* disable nilnil linter - to be enabled in separate PR
2021-11-11 17:03:11 -08:00

48 lines
1.2 KiB
Go

//go:build darwin || (linux && amd64)
// +build darwin linux,amd64
// Package framework contains tools to enable multiple clients to connect to a
// central repository server and run robustness tests concurrently.
package framework
import (
"context"
"os/exec"
"github.com/kopia/kopia/tests/robustness"
)
// ClientSnapshotter is an interface that wraps robustness.Snapshotter with
// methods for handling client connections to a server and cleanup.
type ClientSnapshotter interface {
robustness.Snapshotter
ConnectClient(fingerprint, user string) error
DisconnectClient(user string)
Cleanup()
}
// Server is an interface for a repository server.
type Server interface {
// Initialize and cleanup the server
ConnectOrCreateRepo(repoPath string) error
Cleanup()
// Handle client authorization
AuthorizeClient(user string) error
RemoveClient(user string)
// Run commands directly on the server repository
Run(args ...string) (stdout, stderr string, err error)
RunGC(ctx context.Context, opts map[string]string) error
// Get information from the server
ServerCmd() *exec.Cmd
ServerFingerprint() string
}
// FileWriter is a robustness.FileWriter with the ability to cleanup.
type FileWriter interface {
robustness.FileWriter
Cleanup()
}