From b85d7600112c92a0edd0841754d003c8cafde9cc Mon Sep 17 00:00:00 2001 From: Maria Ntalla Date: Tue, 5 Jun 2018 11:58:16 +0100 Subject: [PATCH] Improve godocs and testcase naming --- .../providers/vsphere/vclib/connection_test.go | 2 +- pkg/cloudprovider/providers/vsphere/vsphere_test.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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()