(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestNewMutualTLSServer(t *testing.T) { |
| 91 | cert, _ := helpers.LoadClientCertificate("../../helpers/testdata/ca.pem", "../../helpers/testdata/ca_key.pem") |
| 92 | s := NewServerTLS("https://nohost:8888", helpers.CreateTLSConfig(nil, cert)) |
| 93 | if s == nil { |
| 94 | t.Fatalf("fatal error, empty server") |
| 95 | } |
| 96 | _, err := s.Sign([]byte{5, 5, 5, 5}) |
| 97 | if err == nil { |
| 98 | t.Fatalf("expected error with sign function") |
| 99 | } |
| 100 | if !(strings.Contains(err.Error(), "Post")) && !(strings.Contains(err.Error(), "https://nohost:8888/api/v1/cfssl/sign")) && !(strings.Contains(err.Error(), "dial tcp: lookup nohost: no such host")) { |
| 101 | t.Fatalf("no error message %v", err) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | func TestNewServerGroup(t *testing.T) { |
| 106 | s := NewServer("cfssl1.local:8888, cfssl2.local:8888, http://cfssl3.local:8888, http://cfssl4.local:8888") |
nothing calls this directly
no test coverage detected
searching dependent graphs…