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

Function TestUpdateSwarmSpecDefaultRotate

cli/command/swarm/ca_test.go:190–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestUpdateSwarmSpecDefaultRotate(t *testing.T) {
191 s := &swarmUpdateRecorder{}
192 cli := test.NewFakeCli(&fakeClient{
193 swarmInspectFunc: swarmInspectFuncWithFullCAConfig,
194 swarmUpdateFunc: s.swarmUpdate,
195 })
196 cmd := newCACommand(cli)
197 cmd.SetArgs([]string{"--rotate", "--detach"})
198 cmd.SetOut(cli.OutBuffer())
199 assert.NilError(t, cmd.Execute())
200
201 expected := swarmSpecWithFullCAConfig()
202 expected.CAConfig.ForceRotate = 2
203 expected.CAConfig.SigningCACert = ""
204 expected.CAConfig.SigningCAKey = ""
205 assert.Check(t, is.DeepEqual(*expected, s.spec))
206}
207
208func TestUpdateSwarmSpecCertAndKey(t *testing.T) {
209 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 5

OutBufferMethod · 0.95
newCACommandFunction · 0.85
SetArgsMethod · 0.80
SetOutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…