mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
0e6a1b9596
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
39 lines
956 B
Go
39 lines
956 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/docker/docker/testutil/fakecontext"
|
|
"github.com/docker/docker/testutil/request"
|
|
"gotest.tools/v3/assert"
|
|
is "gotest.tools/v3/assert/cmp"
|
|
)
|
|
|
|
func (s *DockerAPISuite) TestBuildWithRecycleBin(c *testing.T) {
|
|
testRequires(c, DaemonIsWindows)
|
|
|
|
dockerfile := "" +
|
|
"FROM " + testEnv.PlatformDefaults.BaseImage + "\n" +
|
|
"RUN md $REcycLE.biN && md missing\n" +
|
|
"RUN dir $Recycle.Bin && exit 1 || exit 0\n" +
|
|
"RUN dir missing\n"
|
|
|
|
ctx := fakecontext.New(c, "", fakecontext.WithDockerfile(dockerfile))
|
|
defer ctx.Close()
|
|
|
|
res, body, err := request.Post(
|
|
"/build",
|
|
request.RawContent(ctx.AsTarReader(c)),
|
|
request.ContentType("application/x-tar"))
|
|
|
|
assert.NilError(c, err)
|
|
assert.Equal(c, res.StatusCode, http.StatusOK)
|
|
|
|
out, err := request.ReadBody(body)
|
|
assert.NilError(c, err)
|
|
assert.Check(c, is.Contains(string(out), "Successfully built"))
|
|
}
|