Skip to content

Commit

Permalink
integration tests under integration/container/links_linux_test.go use…
Browse files Browse the repository at this point in the history
… unique names

Signed-off-by: Arash Deshmeh <[email protected]>
  • Loading branch information
adshmh committed Jun 6, 2018
1 parent fd2f2a9 commit 0772470
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions integration/container/links_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ func TestLinksContainerNames(t *testing.T) {
client := request.NewAPIClient(t)
ctx := context.Background()

container.Run(t, ctx, client, container.WithName("first"))
container.Run(t, ctx, client, container.WithName("second"), container.WithLinks("first:first"))
containerA := "first_" + t.Name()
containerB := "second_" + t.Name()
container.Run(t, ctx, client, container.WithName(containerA))
container.Run(t, ctx, client, container.WithName(containerB), container.WithLinks(containerA+":"+containerA))

f := filters.NewArgs(filters.Arg("name", "first"))
f := filters.NewArgs(filters.Arg("name", containerA))

containers, err := client.ContainerList(ctx, types.ContainerListOptions{
Filters: f,
})
assert.NilError(t, err)
assert.Check(t, is.Equal(1, len(containers)))
assert.Check(t, is.DeepEqual([]string{"/first", "/second/first"}, containers[0].Names))
assert.Check(t, is.DeepEqual([]string{"/" + containerA, "/" + containerB + "/" + containerA}, containers[0].Names))
}

0 comments on commit 0772470

Please sign in to comment.