MCPcopy
hub / github.com/etcd-io/etcd / TestTLSReloadCopy

Function TestTLSReloadCopy

tests/integration/v3_grpc_test.go:1672–1689  ·  view source on GitHub ↗

TestTLSReloadCopy ensures server reloads expired/valid certs when new certs are copied over, one by one. And expects server to reject client requests, and vice versa.

(t *testing.T)

Source from the content-addressed store, hash-verified

1670// when new certs are copied over, one by one. And expects server
1671// to reject client requests, and vice versa.
1672func TestTLSReloadCopy(t *testing.T) {
1673 certsDir := t.TempDir()
1674
1675 cloneFunc := func() transport.TLSInfo {
1676 tlsInfo, terr := copyTLSFiles(integration.TestTLSInfo, certsDir)
1677 require.NoError(t, terr)
1678 return tlsInfo
1679 }
1680 replaceFunc := func() {
1681 _, err := copyTLSFiles(integration.TestTLSInfoExpired, certsDir)
1682 require.NoError(t, err)
1683 }
1684 revertFunc := func() {
1685 _, err := copyTLSFiles(integration.TestTLSInfo, certsDir)
1686 require.NoError(t, err)
1687 }
1688 testTLSReload(t, cloneFunc, replaceFunc, revertFunc, false)
1689}
1690
1691// TestTLSReloadCopyIPOnly ensures server reloads expired/valid certs
1692// when new certs are copied over, one by one. And expects server

Callers

nothing calls this directly

Calls 3

copyTLSFilesFunction · 0.85
testTLSReloadFunction · 0.85
TempDirMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…