Documentation ¶
Index ¶
- Variables
- func CopyFile(sourceFile string, destinationFile string) error
- func GoldenFile(name string) string
- func HTTPGetWithRetry(t *testing.T, endpoint string, expectedStatus int, retryDelay time.Duration, ...) string
- func ParseContainerInspect(stdout string) (*containers.Container, error)
- func SetupExistingCLI() (string, func(), error)
- type E2eCLI
- func (c *E2eCLI) MetricsSocket() string
- func (c *E2eCLI) NewCmd(command string, args ...string) icmd.Cmd
- func (c *E2eCLI) NewDockerCmd(args ...string) icmd.Cmd
- func (c *E2eCLI) PathEnvVar() string
- func (c *E2eCLI) RunDockerCmd(args ...string) *icmd.Result
- func (c *E2eCLI) RunDockerOrExitError(args ...string) *icmd.Result
- type MockMetricsServer
- type TestCLI
Constants ¶
This section is empty.
Variables ¶
var (
// DockerExecutableName is the OS dependent Docker CLI binary name
DockerExecutableName = "docker"
)
Functions ¶
func HTTPGetWithRetry ¶ added in v0.1.15
func HTTPGetWithRetry(t *testing.T, endpoint string, expectedStatus int, retryDelay time.Duration, timeout time.Duration) string
HTTPGetWithRetry performs an HTTP GET on an `endpoint`, using retryDelay also as a request timeout. In the case of an error or the response status is not the expeted one, it retries the same request, returning the response body as a string (empty if we could not reach it)
func ParseContainerInspect ¶
func ParseContainerInspect(stdout string) (*containers.Container, error)
ParseContainerInspect parses the output of a `docker inspect` command for a container
func SetupExistingCLI ¶
SetupExistingCLI copies the existing CLI in a temporary directory so that the new CLI can be configured to use it
Types ¶
type E2eCLI ¶
E2eCLI is used to wrap the CLI for end to end testing
func NewParallelE2eCLI ¶
NewParallelE2eCLI returns a configured TestE2eCLI with t.Parallel() set
func (*E2eCLI) MetricsSocket ¶ added in v0.1.21
MetricsSocket get the path where test metrics will be sent
func (*E2eCLI) NewDockerCmd ¶
NewDockerCmd creates a docker cmd without running it
func (*E2eCLI) PathEnvVar ¶ added in v0.1.16
PathEnvVar returns path (os sensitive) for running test
func (*E2eCLI) RunDockerCmd ¶
RunDockerCmd runs a docker command, expects no error and returns a result
type MockMetricsServer ¶ added in v0.1.21
type MockMetricsServer struct {
// contains filtered or unexported fields
}
MockMetricsServer a mock registring all metrics POST invocations
func NewMetricsServer ¶ added in v0.1.21
func NewMetricsServer(socket string) *MockMetricsServer
NewMetricsServer instaniate a new MockMetricsServer
func (*MockMetricsServer) GetUsage ¶ added in v0.1.21
func (s *MockMetricsServer) GetUsage() []string
GetUsage get usage
func (*MockMetricsServer) ResetUsage ¶ added in v0.1.21
func (s *MockMetricsServer) ResetUsage()
ResetUsage reset usage
func (*MockMetricsServer) Start ¶ added in v0.1.21
func (s *MockMetricsServer) Start()
Start start the mock server
func (*MockMetricsServer) Stop ¶ added in v0.1.21
func (s *MockMetricsServer) Stop()
Stop stop the mock server