|
@@ -52,7 +52,6 @@ func TestRenameStoppedContainer(t *testing.T) {
|
|
|
|
|
|
oldName := "first_name" + t.Name()
|
|
|
cID := container.Run(ctx, t, apiClient, container.WithName(oldName), container.WithCmd("sh"))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "exited"), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
inspect, err := apiClient.ContainerInspect(ctx, cID)
|
|
|
assert.NilError(t, err)
|
|
@@ -73,7 +72,6 @@ func TestRenameRunningContainerAndReuse(t *testing.T) {
|
|
|
|
|
|
oldName := "first_name" + t.Name()
|
|
|
cID := container.Run(ctx, t, apiClient, container.WithName(oldName))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
newName := "new_name" + stringid.GenerateRandomID()
|
|
|
err := apiClient.ContainerRename(ctx, oldName, newName)
|
|
@@ -87,7 +85,6 @@ func TestRenameRunningContainerAndReuse(t *testing.T) {
|
|
|
assert.Check(t, is.ErrorContains(err, "No such container: "+oldName))
|
|
|
|
|
|
cID = container.Run(ctx, t, apiClient, container.WithName(oldName))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
inspect, err = apiClient.ContainerInspect(ctx, cID)
|
|
|
assert.NilError(t, err)
|
|
@@ -100,7 +97,6 @@ func TestRenameInvalidName(t *testing.T) {
|
|
|
|
|
|
oldName := "first_name" + t.Name()
|
|
|
cID := container.Run(ctx, t, apiClient, container.WithName(oldName))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
err := apiClient.ContainerRename(ctx, oldName, "new:invalid")
|
|
|
assert.Check(t, is.ErrorContains(err, "Invalid container name"))
|
|
@@ -142,8 +138,6 @@ func TestRenameAnonymousContainer(t *testing.T) {
|
|
|
err = apiClient.ContainerStart(ctx, container1Name, types.ContainerStartOptions{})
|
|
|
assert.NilError(t, err)
|
|
|
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
-
|
|
|
count := "-c"
|
|
|
if testEnv.DaemonInfo.OSType == "windows" {
|
|
|
count = "-n"
|
|
@@ -168,8 +162,6 @@ func TestRenameContainerWithSameName(t *testing.T) {
|
|
|
|
|
|
oldName := "old" + t.Name()
|
|
|
cID := container.Run(ctx, t, apiClient, container.WithName(oldName))
|
|
|
-
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, cID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
err := apiClient.ContainerRename(ctx, oldName, oldName)
|
|
|
assert.Check(t, is.ErrorContains(err, "Renaming a container with the same name"))
|
|
|
err = apiClient.ContainerRename(ctx, cID, oldName)
|
|
@@ -190,12 +182,10 @@ func TestRenameContainerWithLinkedContainer(t *testing.T) {
|
|
|
|
|
|
db1Name := "db1" + t.Name()
|
|
|
db1ID := container.Run(ctx, t, apiClient, container.WithName(db1Name))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, db1ID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
app1Name := "app1" + t.Name()
|
|
|
app2Name := "app2" + t.Name()
|
|
|
- app1ID := container.Run(ctx, t, apiClient, container.WithName(app1Name), container.WithLinks(db1Name+":/mysql"))
|
|
|
- poll.WaitOn(t, container.IsInState(ctx, apiClient, app1ID, "running"), poll.WithDelay(100*time.Millisecond))
|
|
|
+ container.Run(ctx, t, apiClient, container.WithName(app1Name), container.WithLinks(db1Name+":/mysql"))
|
|
|
|
|
|
err := apiClient.ContainerRename(ctx, app1Name, app2Name)
|
|
|
assert.NilError(t, err)
|