Files
kopia/tests/robustness/multiclient_test/framework/framework.go
Steve Joachim d2b816934c robustness: add tests for kopia server repos (#1029)
* Add error handling for robustness Checker
* robustness engine updates for concurrency
* add client-server utils for multiclient robustness
* create client package for robustness tests
* create multi-client robustness test framework
* multi-client robustness test definitions
* update robustness test runner scripts
* Address unparam lint errors

Co-authored-by: Julio Lopez <julio+gh@kasten.io>
2021-04-29 21:45:13 -07:00

47 lines
1.2 KiB
Go

// +build darwin,amd64 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()
}