Merge pull request #37215 from adshmh/integration-container-links-tests-use-unique-names
container links integration tests use unique names
This commit is contained in:
commit
d47c45175b
1 changed files with 6 additions and 4 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue