{"modulePath":"github.com/devx/cadvisor","version":"v0.23.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package framework\n\n## Constants\n\n```go\nconst (\n\tAufs         string = \"aufs\"\n\tOverlay      string = \"overlay\"\n\tDeviceMapper string = \"devicemapper\"\n\tUnknown      string = \"\"\n)\n```\n\n## Functions\n\n```go\nfunc RetryForDuration(retryFunc func() error, dur time.Duration) error\n```\nRuns retryFunc until no error is returned. After dur time the last error is returned. Note that the function does not timeout the execution of retryFunc when the limit is reached.\n\n## Types\n\n```go\ntype CadvisorActions interface {\n\t// Returns a cAdvisor client to the machine being tested.\n\tClient() *client.Client\n\tClientV2() *v2.Client\n}\n```\n\n```go\ntype DockerActions interface {\n\t// Run the no-op pause Docker container and return its ID.\n\tRunPause() string\n\n\t// Run the specified command in a Docker busybox container and return its ID.\n\tRunBusybox(cmd ...string) string\n\n\t// Runs a Docker container in the background. Uses the specified DockerRunArgs and command.\n\t// Returns the ID of the new container.\n\t//\n\t// e.g.:\n\t// Run(DockerRunArgs{Image: \"busybox\"}, \"ping\", \"www.google.com\")\n\t//   -\u003e docker run busybox ping www.google.com\n\tRun(args DockerRunArgs, cmd ...string) string\n\tRunStress(args DockerRunArgs, cmd ...string) string\n\n\tVersion() []string\n\tStorageDriver() string\n}\n```\n\n```go\ntype DockerRunArgs struct {\n\t// Image to use.\n\tImage string\n\n\t// Arguments to the Docker CLI.\n\tArgs []string\n\n\tInnerArgs []string\n}\n```\n\n```go\ntype Framework interface {\n\t// Clean the framework state.\n\tCleanup()\n\n\t// The testing.T used by the framework and the current test.\n\tT() *testing.T\n\n\t// Returns the hostname being tested.\n\tHostname() HostnameInfo\n\n\t// Returns the Docker actions for the test framework.\n\tDocker() DockerActions\n\n\t// Returns the shell actions for the test framework.\n\tShell() ShellActions\n\n\t// Returns the cAdvisor actions for the test framework.\n\tCadvisor() CadvisorActions\n}\n```\nIntegration test framework.\n\n```go\nfunc New(t *testing.T) Framework\n```\nInstantiates a Framework. Cleanup \\*must\\* be called. Class is thread-compatible. All framework actions report fatal errors on the t specified at creation time.\n\nTypical use:\n\n\tfunc TestFoo(t *testing.T) {\n\t\tfm := framework.New(t)\n\t\tdefer fm.Cleanup()\n\t     ... actual test ...\n\t}\n\n```go\ntype HostnameInfo struct {\n\tHost string\n\tPort int\n}\n```\n\n```go\nfunc (self HostnameInfo) FullHostname() string\n```\nReturns: http://\\\u003chost\u003e:\\\u003cport\u003e/\n\n```go\ntype ShellActions interface {\n\t// Runs a specified command and arguments. Returns the stdout and stderr.\n\tRun(cmd string, args ...string) (string, string)\n\tRunStress(cmd string, args ...string) (string, string)\n}\n```\n\n","path":"github.com/devx/cadvisor/integration/framework","name":"framework","synopsis":"","isRedistributable":true}
