1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Some enhancement in integration tests

This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2018-04-14 16:52:02 +00:00
parent 3881f1a521
commit ab9bb47b05
3 changed files with 11 additions and 25 deletions

View file

@ -7,7 +7,6 @@ import (
"time"
"github.com/docker/docker/api/types"
containerTypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/integration/internal/container"
"github.com/docker/docker/integration/internal/request"
@ -70,15 +69,10 @@ func TestExportContainerAfterDaemonRestart(t *testing.T) {
defer d.Stop(t)
ctx := context.Background()
cfg := containerTypes.Config{
Image: "busybox",
Cmd: []string{"top"},
}
ctr, err := client.ContainerCreate(ctx, &cfg, nil, nil, "")
assert.NilError(t, err)
ctrID := container.Create(t, ctx, client)
d.Restart(t)
_, err = client.ContainerExport(ctx, ctr.ID)
_, err = client.ContainerExport(ctx, ctrID)
assert.NilError(t, err)
}