Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
| ... | ... |
@@ -41,15 +41,17 @@ func TestLinksContainerNames(t *testing.T) {
|
| 41 | 41 |
client := request.NewAPIClient(t) |
| 42 | 42 |
ctx := context.Background() |
| 43 | 43 |
|
| 44 |
- container.Run(t, ctx, client, container.WithName("first"))
|
|
| 45 |
- container.Run(t, ctx, client, container.WithName("second"), container.WithLinks("first:first"))
|
|
| 44 |
+ containerA := "first_" + t.Name() |
|
| 45 |
+ containerB := "second_" + t.Name() |
|
| 46 |
+ container.Run(t, ctx, client, container.WithName(containerA)) |
|
| 47 |
+ container.Run(t, ctx, client, container.WithName(containerB), container.WithLinks(containerA+":"+containerA)) |
|
| 46 | 48 |
|
| 47 |
- f := filters.NewArgs(filters.Arg("name", "first"))
|
|
| 49 |
+ f := filters.NewArgs(filters.Arg("name", containerA))
|
|
| 48 | 50 |
|
| 49 | 51 |
containers, err := client.ContainerList(ctx, types.ContainerListOptions{
|
| 50 | 52 |
Filters: f, |
| 51 | 53 |
}) |
| 52 | 54 |
assert.NilError(t, err) |
| 53 | 55 |
assert.Check(t, is.Equal(1, len(containers))) |
| 54 |
- assert.Check(t, is.DeepEqual([]string{"/first", "/second/first"}, containers[0].Names))
|
|
| 56 |
+ assert.Check(t, is.DeepEqual([]string{"/" + containerA, "/" + containerB + "/" + containerA}, containers[0].Names))
|
|
| 55 | 57 |
} |