1
0
mirror of https://github.com/moby/moby.git synced 2025-08-01 05:47:11 +03: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:
Vincent Demeester
2017-01-16 11:30:14 +01:00
parent 8c7651998f
commit c10f6ef43f
28 changed files with 587 additions and 1194 deletions

View File

@ -193,10 +193,9 @@ func (s *DockerRegistrySuite) TestBuildByDigest(c *check.C) {
// do the build
name := "buildbydigest"
_, err = buildImage(name, fmt.Sprintf(
buildImageSuccessfully(c, name, withDockerfile(fmt.Sprintf(
`FROM %s
CMD ["/bin/echo", "Hello World"]`, imageReference),
true)
CMD ["/bin/echo", "Hello World"]`, imageReference)))
c.Assert(err, checker.IsNil)
// get the build's image id
@ -417,20 +416,17 @@ func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(c
// build an image from it
imageName1 := "images_ps_filter_test"
_, err = buildImage(imageName1, fmt.Sprintf(
buildImageSuccessfully(c, imageName1, withDockerfile(fmt.Sprintf(
`FROM %s
LABEL match me 1`, imageReference), true)
c.Assert(err, checker.IsNil)
LABEL match me 1`, imageReference)))
// run a container based on that
dockerCmd(c, "run", "--name=test1", imageReference, "echo", "hello")
expectedID, err := getIDByName("test1")
c.Assert(err, check.IsNil)
expectedID := getIDByName(c, "test1")
// run a container based on the a descendant of that too
dockerCmd(c, "run", "--name=test2", imageName1, "echo", "hello")
expectedID1, err := getIDByName("test2")
c.Assert(err, check.IsNil)
expectedID1 := getIDByName(c, "test2")
expectedIDs := []string{expectedID, expectedID1}