MCPcopy Index your code
hub / github.com/docker/cli / TestUpdateStopSignal

Function TestUpdateStopSignal

cli/command/service/update_test.go:620–644  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

618}
619
620func 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
646func TestUpdateIsolationValid(t *testing.T) {
647 flags := newUpdateCommand(nil).Flags()

Callers

nothing calls this directly

Calls 3

updateServiceFunction · 0.85
newUpdateCommandFunction · 0.70
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…