(t *testing.T)
| 592 | } |
| 593 | |
| 594 | func TestUpdateInit(t *testing.T) { |
| 595 | spec := &swarm.ServiceSpec{ |
| 596 | TaskTemplate: swarm.TaskSpec{ |
| 597 | ContainerSpec: &swarm.ContainerSpec{}, |
| 598 | }, |
| 599 | } |
| 600 | cspec := spec.TaskTemplate.ContainerSpec |
| 601 | |
| 602 | // Update with --init=true |
| 603 | flags := newUpdateCommand(nil).Flags() |
| 604 | flags.Set("init", "true") |
| 605 | updateService(context.TODO(), nil, flags, spec) |
| 606 | assert.Check(t, is.Equal(true, *cspec.Init)) |
| 607 | |
| 608 | // Update without --init, no change |
| 609 | flags = newUpdateCommand(nil).Flags() |
| 610 | updateService(context.TODO(), nil, flags, spec) |
| 611 | assert.Check(t, is.Equal(true, *cspec.Init)) |
| 612 | |
| 613 | // Update with --init=false |
| 614 | flags = newUpdateCommand(nil).Flags() |
| 615 | flags.Set("init", "false") |
| 616 | updateService(context.TODO(), nil, flags, spec) |
| 617 | assert.Check(t, is.Equal(false, *cspec.Init)) |
| 618 | } |
| 619 | |
| 620 | func TestUpdateStopSignal(t *testing.T) { |
| 621 | spec := &swarm.ServiceSpec{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…