(t *testing.T)
| 566 | } |
| 567 | |
| 568 | func TestUpdateReadOnly(t *testing.T) { |
| 569 | spec := &swarm.ServiceSpec{ |
| 570 | TaskTemplate: swarm.TaskSpec{ |
| 571 | ContainerSpec: &swarm.ContainerSpec{}, |
| 572 | }, |
| 573 | } |
| 574 | cspec := spec.TaskTemplate.ContainerSpec |
| 575 | |
| 576 | // Update with --read-only=true, changed to true |
| 577 | flags := newUpdateCommand(nil).Flags() |
| 578 | flags.Set("read-only", "true") |
| 579 | updateService(context.TODO(), nil, flags, spec) |
| 580 | assert.Check(t, cspec.ReadOnly) |
| 581 | |
| 582 | // Update without --read-only, no change |
| 583 | flags = newUpdateCommand(nil).Flags() |
| 584 | updateService(context.TODO(), nil, flags, spec) |
| 585 | assert.Check(t, cspec.ReadOnly) |
| 586 | |
| 587 | // Update with --read-only=false, changed to false |
| 588 | flags = newUpdateCommand(nil).Flags() |
| 589 | flags.Set("read-only", "false") |
| 590 | updateService(context.TODO(), nil, flags, spec) |
| 591 | assert.Check(t, !cspec.ReadOnly) |
| 592 | } |
| 593 | |
| 594 | func TestUpdateInit(t *testing.T) { |
| 595 | spec := &swarm.ServiceSpec{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…