mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Clean more build utils in integration cli
- Remove deprecated buildImage* functions - Rename buildImageNew to buildImage - Use *check.C in fakeContext* setup and in getIdByName Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
8c7651998f
commit
c10f6ef43f
28 changed files with 587 additions and 1194 deletions
|
@ -25,13 +25,11 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
|
|||
testRequires(c, cpuCfsQuota)
|
||||
name := "testbuildresourceconstraints"
|
||||
|
||||
ctx, err := fakeContext(`
|
||||
ctx := fakeContext(c, `
|
||||
FROM hello-world:frozen
|
||||
RUN ["/hello"]
|
||||
`, map[string]string{})
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
_, _, err = dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
|
||||
_, _, err := dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
|
||||
if err != nil {
|
||||
c.Fatal(err)
|
||||
}
|
||||
|
@ -114,9 +112,7 @@ func (s *DockerSuite) TestBuildAddChangeOwnership(c *check.C) {
|
|||
|
||||
defer ctx.Close()
|
||||
|
||||
if _, err := buildImageFromContext(name, ctx, true); err != nil {
|
||||
c.Fatalf("build failed to complete for TestBuildAddChangeOwnership: %v", err)
|
||||
}
|
||||
buildImageSuccessfully(c, name, withExternalBuildContext(ctx))
|
||||
}
|
||||
|
||||
// Test that an infinite sleep during a build is killed if the client disconnects.
|
||||
|
@ -137,10 +133,7 @@ func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
|
|||
defer observer.Stop()
|
||||
|
||||
// (Note: one year, will never finish)
|
||||
ctx, err := fakeContext("FROM busybox\nRUN sleep 31536000", nil)
|
||||
if err != nil {
|
||||
c.Fatal(err)
|
||||
}
|
||||
ctx := fakeContext(c, "FROM busybox\nRUN sleep 31536000", nil)
|
||||
defer ctx.Close()
|
||||
|
||||
buildCmd := exec.Command(dockerBinary, "build", "-t", name, ".")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue