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{ connection := &vclib.VSphereConnection{
Hostname: "should-not-matter", Hostname: "should-not-matter",
Port: "should-not-matter", Port: "should-not-matter",
CACert: fixtures.InvalidCaCertPath, CACert: fixtures.InvalidCertPath,
} }
_, err := connection.NewClient(context.Background()) _, err := connection.NewClient(context.Background())

View File

@ -24,10 +24,17 @@ import (
) )
var ( var (
CaCertPath string // CaCertPath is the filepath to a certificate that can be used as a CA
ServerCertPath string // certificate.
ServerKeyPath string CaCertPath string
InvalidCaCertPath 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() { func init() {
@ -54,5 +61,5 @@ func init() {
CaCertPath = filepath.Join(fixturesDir, "ca.pem") CaCertPath = filepath.Join(fixturesDir, "ca.pem")
ServerCertPath = filepath.Join(fixturesDir, "server.pem") ServerCertPath = filepath.Join(fixturesDir, "server.pem")
ServerKeyPath = filepath.Join(fixturesDir, "server.key") ServerKeyPath = filepath.Join(fixturesDir, "server.key")
InvalidCaCertPath = filepath.Join(fixturesDir, "invalid.pem") InvalidCertPath = filepath.Join(fixturesDir, "invalid.pem")
} }