|
@@ -122,7 +122,7 @@ func TestCreateServiceMultipleTimes(t *testing.T) {
|
|
err = client.NetworkRemove(context.Background(), overlayID)
|
|
err = client.NetworkRemove(context.Background(), overlayID)
|
|
assert.NilError(t, err)
|
|
assert.NilError(t, err)
|
|
|
|
|
|
- poll.WaitOn(t, networkIsRemoved(client, overlayID), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
|
|
+ poll.WaitOn(t, network.IsRemoved(context.Background(), client, overlayID), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
}
|
|
}
|
|
|
|
|
|
func TestCreateServiceConflict(t *testing.T) {
|
|
func TestCreateServiceConflict(t *testing.T) {
|
|
@@ -228,9 +228,9 @@ func TestCreateWithDuplicateNetworkNames(t *testing.T) {
|
|
assert.NilError(t, err)
|
|
assert.NilError(t, err)
|
|
|
|
|
|
// Make sure networks have been destroyed.
|
|
// Make sure networks have been destroyed.
|
|
- poll.WaitOn(t, networkIsRemoved(client, n3), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
- poll.WaitOn(t, networkIsRemoved(client, n2), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
- poll.WaitOn(t, networkIsRemoved(client, n1), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
|
|
+ poll.WaitOn(t, network.IsRemoved(context.Background(), client, n3), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
+ poll.WaitOn(t, network.IsRemoved(context.Background(), client, n2), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
|
|
+ poll.WaitOn(t, network.IsRemoved(context.Background(), client, n1), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))
|
|
}
|
|
}
|
|
|
|
|
|
func TestCreateServiceSecretFileMode(t *testing.T) {
|
|
func TestCreateServiceSecretFileMode(t *testing.T) {
|
|
@@ -513,13 +513,3 @@ func serviceIsRemoved(client client.ServiceAPIClient, serviceID string) func(log
|
|
return poll.Success()
|
|
return poll.Success()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-func networkIsRemoved(client client.NetworkAPIClient, networkID string) func(log poll.LogT) poll.Result {
|
|
|
|
- return func(log poll.LogT) poll.Result {
|
|
|
|
- _, err := client.NetworkInspect(context.Background(), networkID, types.NetworkInspectOptions{})
|
|
|
|
- if err == nil {
|
|
|
|
- return poll.Continue("waiting for network %s to be removed", networkID)
|
|
|
|
- }
|
|
|
|
- return poll.Success()
|
|
|
|
- }
|
|
|
|
-}
|
|
|