(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func TestNewClientConfigWithSecureCfg(t *testing.T) { |
| 152 | tls, err := transport.SelfCert(zap.NewNop(), t.TempDir(), []string{"localhost"}, 1) |
| 153 | require.NoError(t, err) |
| 154 | |
| 155 | scfg := &SecureConfig{ |
| 156 | Cert: tls.CertFile, |
| 157 | Key: tls.KeyFile, |
| 158 | Cacert: tls.TrustedCAFile, |
| 159 | } |
| 160 | |
| 161 | cfg, err := NewClientConfig(&ConfigSpec{ |
| 162 | Endpoints: []string{"http://192.168.0.13:2379"}, |
| 163 | DialTimeout: 2 * time.Second, |
| 164 | KeepAliveTime: 3 * time.Second, |
| 165 | KeepAliveTimeout: 5 * time.Second, |
| 166 | Secure: scfg, |
| 167 | }, nil) |
| 168 | require.NoErrorf(t, err, "Unexpected result client config") |
| 169 | if cfg == nil || cfg.TLS == nil { |
| 170 | t.Fatalf("Unexpected result client config: %v", err) |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func TestConfigSpecClone(t *testing.T) { |
| 175 | cfgSpec := &ConfigSpec{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…