Improve godocs and testcase naming

This commit is contained in:
Maria Ntalla 2018-06-05 11:58:16 +01:00 committed by Hannes Hörl
parent 64f13c265c
commit b85d760011
2 changed files with 6 additions and 2 deletions

View File

@ -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"

View File

@ -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()