summaryrefslogtreecommitdiff
path: root/integration-cli/docker_api_build_windows_test.go
diff options
context:
space:
mode:
authorJohn Stephens <johnstep@docker.com>2018-05-03 07:24:11 -0700
committerJohn Stephens <johnstep@docker.com>2018-05-03 13:37:18 -0700
commit72192f5052667118c2f83282f8f8c3df8cbf514b (patch)
tree07c623d98dda5a8419d049c85f137be76e265025 /integration-cli/docker_api_build_windows_test.go
parent1c136d99a0e03b8cf76979652a0edb075ff83889 (diff)
downloaddocker-72192f5052667118c2f83282f8f8c3df8cbf514b.tar.gz
Add tests related to hcsshim recycle bin skipping
Signed-off-by: John Stephens <johnstep@docker.com>
Diffstat (limited to 'integration-cli/docker_api_build_windows_test.go')
-rw-r--r--integration-cli/docker_api_build_windows_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/integration-cli/docker_api_build_windows_test.go b/integration-cli/docker_api_build_windows_test.go
new file mode 100644
index 0000000000..92d3f5e134
--- /dev/null
+++ b/integration-cli/docker_api_build_windows_test.go
@@ -0,0 +1,39 @@
+// +build windows
+
+package main
+
+import (
+ "net/http"
+
+ "github.com/docker/docker/integration-cli/checker"
+ "github.com/docker/docker/internal/test/fakecontext"
+ "github.com/docker/docker/internal/test/request"
+ "github.com/go-check/check"
+ "github.com/gotestyourself/gotestyourself/assert"
+ is "github.com/gotestyourself/gotestyourself/assert/cmp"
+)
+
+func (s *DockerSuite) TestBuildWithRecycleBin(c *check.C) {
+ 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"))
+
+ c.Assert(err, checker.IsNil)
+ c.Assert(res.StatusCode, checker.Equals, http.StatusOK)
+
+ out, err := request.ReadBody(body)
+ assert.NilError(c, err)
+ assert.Check(c, is.Contains(string(out), "Successfully built"))
+}