Add godocs for fixtures

... and rename `InvalidCaCertPath` to `InvalidCertPath`.
This commit is contained in:
Maria Ntalla 2018-06-06 13:12:56 +01:00 committed by Hannes Hörl
parent 0cbe25436d
commit 795e4c4254
2 changed files with 13 additions and 6 deletions

View File

@ -103,7 +103,7 @@ func TestInvalidCaCert(t *testing.T) {
connection := &vclib.VSphereConnection{
Hostname: "should-not-matter",
Port: "should-not-matter",
CACert: fixtures.InvalidCaCertPath,
CACert: fixtures.InvalidCertPath,
}
_, err := connection.NewClient(context.Background())

View File

@ -24,10 +24,17 @@ import (
)
var (
CaCertPath string
ServerCertPath string
ServerKeyPath string
InvalidCaCertPath string
// CaCertPath is the filepath to a certificate that can be used as a CA
// certificate.
CaCertPath string
// ServerCertPath is the filepath to a leaf certifiacte signed by the CA at
// `CaCertPath`.
ServerCertPath string
// ServerKeyPath is the filepath to the private key for the ceritifiacte at
// `ServerCertPath`.
ServerKeyPath string
// InvalidCertPath is the filepath to an invalid certificate.
InvalidCertPath string
)
func init() {
@ -54,5 +61,5 @@ func init() {
CaCertPath = filepath.Join(fixturesDir, "ca.pem")
ServerCertPath = filepath.Join(fixturesDir, "server.pem")
ServerKeyPath = filepath.Join(fixturesDir, "server.key")
InvalidCaCertPath = filepath.Join(fixturesDir, "invalid.pem")
InvalidCertPath = filepath.Join(fixturesDir, "invalid.pem")
}