|
@@ -64,45 +64,45 @@ func TestServicePlugin(t *testing.T) {
|
|
|
defer d3.Stop(t)
|
|
|
|
|
|
id := d1.CreateService(t, makePlugin(repo, name, nil))
|
|
|
- poll.WaitOn(t, d1.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
|
|
|
service := d1.GetService(t, id)
|
|
|
d1.UpdateService(t, service, makePlugin(repo2, name, nil))
|
|
|
- poll.WaitOn(t, d1.PluginReferenceIs(name, repo2), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginReferenceIs(name, repo2), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginReferenceIs(name, repo2), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d1.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginReferenceIs(t, name, repo2), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginReferenceIs(t, name, repo2), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginReferenceIs(t, name, repo2), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
|
|
|
d1.RemoveService(t, id)
|
|
|
- poll.WaitOn(t, d1.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
|
|
|
// constrain to managers only
|
|
|
id = d1.CreateService(t, makePlugin(repo, name, []string{"node.role==manager"}))
|
|
|
- poll.WaitOn(t, d1.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsRunning(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsRunning(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
|
|
|
d1.RemoveService(t, id)
|
|
|
- poll.WaitOn(t, d1.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsNotPresent(name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsNotPresent(t, name), swarm.ServicePoll)
|
|
|
|
|
|
// with no name
|
|
|
id = d1.CreateService(t, makePlugin(repo, "", nil))
|
|
|
- poll.WaitOn(t, d1.PluginIsRunning(repo), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsRunning(repo), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsRunning(repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsRunning(t, repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsRunning(t, repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsRunning(t, repo), swarm.ServicePoll)
|
|
|
|
|
|
d1.RemoveService(t, id)
|
|
|
- poll.WaitOn(t, d1.PluginIsNotPresent(repo), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d2.PluginIsNotPresent(repo), swarm.ServicePoll)
|
|
|
- poll.WaitOn(t, d3.PluginIsNotPresent(repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d1.PluginIsNotPresent(t, repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d2.PluginIsNotPresent(t, repo), swarm.ServicePoll)
|
|
|
+ poll.WaitOn(t, d3.PluginIsNotPresent(t, repo), swarm.ServicePoll)
|
|
|
}
|
|
|
|
|
|
func makePlugin(repo, name string, constraints []string) func(*swarmtypes.Service) {
|