diff --git a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go index 0afdfafccae..f2f4b9646b0 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go @@ -56,7 +56,7 @@ func createTestServer(t *testing.T, caCertPath, serverCertPath, serverKeyPath st return server } -func TestSomething(t *testing.T) { +func TestWithValidCaCert(t *testing.T) { caCertPath := "fixtures/ca.pem" serverCertPath := "fixtures/server.pem" serverKeyPath := "fixtures/server.key" diff --git a/pkg/cloudprovider/providers/vsphere/vsphere_test.go b/pkg/cloudprovider/providers/vsphere/vsphere_test.go index aa13921a117..7a13d6ef44b 100644 --- a/pkg/cloudprovider/providers/vsphere/vsphere_test.go +++ b/pkg/cloudprovider/providers/vsphere/vsphere_test.go @@ -91,11 +91,15 @@ func configFromEnv() (cfg VSphereConfig, ok bool) { return } +// configFromSim starts a vcsim instance and returns config for use against the vcsim instance. +// The vcsim instance is configured with an empty tls.Config. func configFromSim() (VSphereConfig, func()) { return configFromSimWithTLS(new(tls.Config), true) } -// configFromSim starts a vcsim instance and returns config for use against the vcsim instance. +// configFromSimWithTLS starts a vcsim instance and returns config for use against the vcsim instance. +// The vcsim instance is configured with a tls.Config. The returned client +// config can be configured to allow/decline insecure connections. func configFromSimWithTLS(tlsConfig *tls.Config, insecureAllowed bool) (VSphereConfig, func()) { var cfg VSphereConfig model := simulator.VPX()