Documentation ¶
Overview ¶
Package tests contains the exported functions that are meant to be imported as test cases.
It should not export any other thing except for a SubcommandOption struct (e.g., LoginOption) that may be added in the future.
Each file contains one subcommand to test and is named after that subcommand. Note that the file names are not suffixed with _test so that they can appear in Go Doc.
Index ¶
- func CleanupLocalRegistry(opt *option.Option)
- func ContainerAttach(opt *option.Option)
- func ContainerCreate(opt *option.Option)
- func ContainerList(opt *option.Option)
- func ContainerLogs(opt *option.Option)
- func ContainerRemove(opt *option.Option)
- func ContainerRename(opt *option.Option)
- func ContainerRestart(opt *option.Option)
- func ContainerStart(opt *option.Option)
- func ContainerStats(opt *option.Option)
- func ContainerStop(opt *option.Option)
- func GetDockerApiVersion() string
- func GetDockerHostUrl() string
- func GetFinchExe() string
- func ImagePull(opt *option.Option)
- func ImagePush(opt *option.Option)
- func ImageRemove(opt *option.Option)
- func NetworkCreate(opt *option.Option)
- func NetworkInspect(opt *option.Option)
- func NetworkList(opt *option.Option)
- func NetworkRemove(opt *option.Option)
- func SetupLocalRegistry(opt *option.Option)
- func SystemEvents(opt *option.Option)
- func SystemVersion(opt *option.Option)
- func VolumeInspect(opt *option.Option)
- func VolumeList(opt *option.Option)
- func VolumeRemove(opt *option.Option)
- type CGMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupLocalRegistry ¶
CleanupLocalRegistry removes the local registry container and image. It's used together with SetupLocalRegistry, and should be invoked after running all the tests.
func ContainerAttach ¶
ContainerAttach tests the `POST containers/attach` API.
func ContainerCreate ¶
ContainerCreate tests the `POST containers/create` API.
func ContainerList ¶
ContainerList tests the `GET containers/json` API.
func ContainerLogs ¶
ContainerLogs tests the `POST containers/logs` API.
func ContainerRemove ¶
ContainerRemove tests the `POST containers/{id}/remove` API.
func ContainerRename ¶
ContainerRename tests the `POST containers/{id}/rename` API.
func ContainerRestart ¶
ContainerRestart tests the `POST containers/{id}/restart` API.
func ContainerStart ¶
ContainerStart tests the `POST containers/{id}/start` API.
func ContainerStats ¶
ContainerStats tests the `GET containers/{id}/stats` API.
func ContainerStop ¶
ContainerStop tests the `POST containers/{id}/stop` API.
func GetDockerApiVersion ¶
func GetDockerApiVersion() string
func GetDockerHostUrl ¶
func GetDockerHostUrl() string
func GetFinchExe ¶
func GetFinchExe() string
GetFinchExe gets the finch executable path from FINCH_ROOT environment variable, if set.
func ImageRemove ¶
ImageRemove tests the delete image API - `DELETE /images/{id}`.
func NetworkCreate ¶
func NetworkInspect ¶
NetworkInspect tests `GET networks/{id}` API.
func NetworkList ¶
NetworkList tests calling the get networks api.
func NetworkRemove ¶
func SetupLocalRegistry ¶
SetupLocalRegistry can be invoked before running the tests to save time when pulling defaultImage.
It spins up a local registry, tags the alpine image, pushes the tagged image to local registry, and changes defaultImage to be the one pushed to local registry.
After all the tests are done, invoke CleanupLocalRegistry to clean up the local registry.
func SystemEvents ¶
SystemEvents tests streaming container events.
func SystemVersion ¶
SystemVersion tests the `Get /version` API.
func VolumeInspect ¶
VolumeInspect tests volume inspect API - GET /volumes/{volume_name}.
Types ¶
type CGMode ¶
type CGMode int
CGMode is the cgroups mode of the host system. We copy the struct from containerd/cgroups [1] instead of using it as a library because it only builds on linux, while we don't really need the functions that make it only build on linux (e.g., determine the cgroup version of the current host).
[1] https://github.com/containerd/cgroups/blob/cc78c6c1e32dc5bde018d92999910fdace3cfa27/utils.go#L38-L50
Source Files ¶
- container_attach.go
- container_create.go
- container_list.go
- container_logs.go
- container_remove.go
- container_rename.go
- container_restart.go
- container_start.go
- container_stats.go
- container_stop.go
- events.go
- image_pull.go
- image_push.go
- image_remove.go
- network_create.go
- network_inspect.go
- network_list.go
- network_remove.go
- tests.go
- version.go
- volume_inspect.go
- volume_list.go
- volume_remove.go