/usr/share/gocode/src/github.com/hashicorp/go-rootcerts/rootcerts_test.go is in golang-github-hashicorp-go-rootcerts-dev 0.0~git20160503.0.6bb64b3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | package rootcerts
import (
"path/filepath"
"testing"
)
const fixturesDir = "./test-fixtures"
func TestConfigureTLSHandlesNil(t *testing.T) {
err := ConfigureTLS(nil, nil)
if err != nil {
t.Fatalf("err: %s", err)
}
}
func TestLoadCACertsHandlesNil(t *testing.T) {
_, err := LoadCACerts(nil)
if err != nil {
t.Fatalf("err: %s", err)
}
}
func TestLoadCACertsFromFile(t *testing.T) {
path := testFixture("cafile", "cacert.pem")
_, err := LoadCACerts(&Config{CAFile: path})
if err != nil {
t.Fatalf("err: %s", err)
}
}
func TestLoadCACertsFromDir(t *testing.T) {
path := testFixture("capath")
_, err := LoadCACerts(&Config{CAPath: path})
if err != nil {
t.Fatalf("err: %s", err)
}
}
func TestLoadCACertsFromDirWithSymlinks(t *testing.T) {
path := testFixture("capath-with-symlinks")
_, err := LoadCACerts(&Config{CAPath: path})
if err != nil {
t.Fatalf("err: %s", err)
}
}
func testFixture(n ...string) string {
parts := []string{fixturesDir}
parts = append(parts, n...)
return filepath.Join(parts...)
}
|