Documentation ¶
Index ¶
- Constants
- func BindMount(src, dst string, ro bool) docker.HostMount
- func DefaultBinds(t *testing.T, rootDir string) []docker.HostMount
- func DockerBridgeIP(t testing.TB) string
- func EnvVar(k, v string) string
- func ExecEnvbox(t *testing.T, pool *dockertest.Pool, conf ExecConfig) ([]byte, error)
- func ExecInnerContainer(t *testing.T, pool *dockertest.Pool, conf ExecConfig) ([]byte, error)
- func GenerateRegistryAuth(t *testing.T, directory, username, password string) string
- func GenerateTLSCertificate(t testing.TB, commonName string, ipAddr string) tls.Certificate
- func MkdirAll(t testing.TB, elem ...string) string
- func RunEnvbox(t *testing.T, pool *dockertest.Pool, conf *CreateDockerCVMConfig) *dockertest.Resource
- func TmpDir(t *testing.T) string
- func WaitForCVMDocker(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, ...)
- func WriteCertificate(t testing.TB, c tls.Certificate, certPath, keyPath string)
- func WriteFile(t *testing.T, path, contents string)
- type BuildLogRecorder
- type CreateDockerCVMConfig
- type ExecConfig
- type RegistryConfig
- type RegistryImage
Constants ¶
const ( // DockerdImage is a large image (~1GB) and should only be used to test // dockerd. DockerdImage = "gcr.io/coder-dev-1/sreya/enterprise-base:ubuntu" // HelloWorldImage is useful for testing a CVM's dockerd is functioning // correctly HelloWorldImage = "gcr.io/coder-dev-1/sreya/hello-world" // UbuntuImage is just vanilla ubuntu (80MB) but the user is set to a non-root // user . UbuntuImage = "gcr.io/coder-dev-1/sreya/ubuntu-coder" )
Variables ¶
This section is empty.
Functions ¶
func DefaultBinds ¶
DefaultBinds returns the minimum amount of mounts necessary to spawn envbox successfully. Since envbox will chown some of these directories to root, they cannot be cleaned up post-test, meaning that it may be necesssary to manually clear /tmp from time to time.
func DockerBridgeIP ¶
func ExecEnvbox ¶
func ExecEnvbox(t *testing.T, pool *dockertest.Pool, conf ExecConfig) ([]byte, error)
ExecEnvbox runs a command in the outer container.
func ExecInnerContainer ¶
func ExecInnerContainer(t *testing.T, pool *dockertest.Pool, conf ExecConfig) ([]byte, error)
ExecInnerContainer runs a command in the inner container.
func GenerateRegistryAuth ¶
func GenerateTLSCertificate ¶
func RunEnvbox ¶
func RunEnvbox(t *testing.T, pool *dockertest.Pool, conf *CreateDockerCVMConfig) *dockertest.Resource
RunEnvbox runs envbox, it returns once the inner container has finished spinning up.
func WaitForCVMDocker ¶
func WaitForCVMDocker(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, timeout time.Duration)
WaitForCVMDocker waits for the inner container docker daemon to spin up.
func WriteCertificate ¶
func WriteCertificate(t testing.TB, c tls.Certificate, certPath, keyPath string)
Types ¶
type BuildLogRecorder ¶
type BuildLogRecorder struct {
// contains filtered or unexported fields
}
func FakeBuildLogRecorder ¶
func FakeBuildLogRecorder(t testing.TB, l net.Listener, cert tls.Certificate) *BuildLogRecorder
FakeBuildLogRecorder starts a server that fakes a Coder deployment for the purpose of pushing build logs. It returns a type for asserting that expected log make it through the expected endpoint.
func (*BuildLogRecorder) ContainsLog ¶
func (b *BuildLogRecorder) ContainsLog(l string) bool
func (*BuildLogRecorder) Len ¶
func (b *BuildLogRecorder) Len() int
type CreateDockerCVMConfig ¶
type ExecConfig ¶
type RegistryConfig ¶
type RegistryImage ¶
type RegistryImage string
func RunLocalDockerRegistry ¶
func RunLocalDockerRegistry(t *testing.T, pool *dockertest.Pool, conf RegistryConfig) RegistryImage
func (RegistryImage) Registry ¶
func (r RegistryImage) Registry() string
func (RegistryImage) String ¶
func (r RegistryImage) String() string