@@ -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\n ENV 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-
3915func (s * DockerAPISuite ) TestAPIImagesImportBadSrc (c * testing.T ) {
4016 testRequires (c , Network , testEnv .IsLocalDaemon )
4117
0 commit comments