(t *testing.T)
| 618 | } |
| 619 | |
| 620 | func TestUpdateStopSignal(t *testing.T) { |
| 621 | spec := &swarm.ServiceSpec{ |
| 622 | TaskTemplate: swarm.TaskSpec{ |
| 623 | ContainerSpec: &swarm.ContainerSpec{}, |
| 624 | }, |
| 625 | } |
| 626 | cspec := spec.TaskTemplate.ContainerSpec |
| 627 | |
| 628 | // Update with --stop-signal=SIGUSR1 |
| 629 | flags := newUpdateCommand(nil).Flags() |
| 630 | flags.Set("stop-signal", "SIGUSR1") |
| 631 | updateService(context.TODO(), nil, flags, spec) |
| 632 | assert.Check(t, is.Equal("SIGUSR1", cspec.StopSignal)) |
| 633 | |
| 634 | // Update without --stop-signal, no change |
| 635 | flags = newUpdateCommand(nil).Flags() |
| 636 | updateService(context.TODO(), nil, flags, spec) |
| 637 | assert.Check(t, is.Equal("SIGUSR1", cspec.StopSignal)) |
| 638 | |
| 639 | // Update with --stop-signal=SIGWINCH |
| 640 | flags = newUpdateCommand(nil).Flags() |
| 641 | flags.Set("stop-signal", "SIGWINCH") |
| 642 | updateService(context.TODO(), nil, flags, spec) |
| 643 | assert.Check(t, is.Equal("SIGWINCH", cspec.StopSignal)) |
| 644 | } |
| 645 | |
| 646 | func TestUpdateIsolationValid(t *testing.T) { |
| 647 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…