MCPcopy Create free account
hub / github.com/coder/envbuilder / TestBuildCustomCertificates

Function TestBuildCustomCertificates

integration/integration_test.go:995–1016  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

993}
994
995func TestBuildCustomCertificates(t *testing.T) {
996 t.Parallel()
997
998 srv := gittest.CreateGitServer(t, gittest.Options{
999 Files: map[string]string{
1000 "Dockerfile": "FROM " + testImageAlpine,
1001 },
1002 TLS: true,
1003 })
1004 ctr, err := runEnvbuilder(t, runOpts{env: []string{
1005 envbuilderEnv("GIT_URL", srv.URL),
1006 envbuilderEnv("DOCKERFILE_PATH", "Dockerfile"),
1007 envbuilderEnv("SSL_CERT_BASE64", base64.StdEncoding.EncodeToString(pem.EncodeToMemory(&pem.Block{
1008 Type: "CERTIFICATE",
1009 Bytes: srv.TLS.Certificates[0].Certificate[0],
1010 }))),
1011 }})
1012 require.NoError(t, err)
1013
1014 output := execContainer(t, ctr, "echo hello")
1015 require.Equal(t, "hello", strings.TrimSpace(output))
1016}
1017
1018func TestBuildStopStartCached(t *testing.T) {
1019 t.Parallel()

Callers

nothing calls this directly

Calls 4

CreateGitServerFunction · 0.92
runEnvbuilderFunction · 0.85
envbuilderEnvFunction · 0.85
execContainerFunction · 0.85

Tested by

no test coverage detected