Skip to content

Commit 5512eea

Browse files
authored
Merge pull request moby#51559 from 2003Aditya/TestAPIImagesSaveAndLoad
migrate TestAPIImagesSaveAndLoad to integration test
2 parents a3c29e8 + 93825e0 commit 5512eea

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

integration-cli/docker_api_images_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,11 @@ import (
77
"testing"
88

99
"github.com/moby/moby/client"
10-
"github.com/moby/moby/v2/integration-cli/cli"
11-
"github.com/moby/moby/v2/integration-cli/cli/build"
1210
"github.com/moby/moby/v2/internal/testutil"
1311
"github.com/moby/moby/v2/internal/testutil/request"
1412
"gotest.tools/v3/assert"
1513
)
1614

17-
func (s *DockerAPISuite) TestAPIImagesSaveAndLoad(c *testing.T) {
18-
testRequires(c, Network)
19-
cli.BuildCmd(c, "saveandload", build.WithDockerfile("FROM busybox\nENV FOO bar"))
20-
id := getIDByName(c, "saveandload")
21-
22-
ctx := testutil.GetContext(c)
23-
res, body, err := request.Get(ctx, "/images/"+id+"/get")
24-
assert.NilError(c, err)
25-
defer body.Close()
26-
assert.Equal(c, res.StatusCode, http.StatusOK)
27-
28-
cli.DockerCmd(c, "rmi", id)
29-
30-
res, loadBody, err := request.Post(ctx, "/images/load", request.RawContent(body), request.ContentType("application/x-tar"))
31-
assert.NilError(c, err)
32-
defer loadBody.Close()
33-
assert.Equal(c, res.StatusCode, http.StatusOK)
34-
35-
inspectOut := cli.InspectCmd(c, id, cli.Format(".Id")).Combined()
36-
assert.Equal(c, strings.TrimSpace(inspectOut), id, "load did not work properly")
37-
}
38-
3915
func (s *DockerAPISuite) TestAPIImagesImportBadSrc(c *testing.T) {
4016
testRequires(c, Network, testEnv.IsLocalDaemon)
4117

0 commit comments

Comments
 (0)