(t *testing.T)
| 188 | } |
| 189 | |
| 190 | func 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 | |
| 208 | func TestUpdateSwarmSpecCertAndKey(t *testing.T) { |
| 209 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected
searching dependent graphs…