(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestConformance(t *testing.T) { |
| 18 | var factories = map[string]func(t *testing.T, logger log.Logger) (sshserver.NetworkConnectionHandler, error){ |
| 19 | "sshproxy": func(t *testing.T, logger log.Logger) (sshserver.NetworkConnectionHandler, error) { |
| 20 | var err error |
| 21 | sshServer := test.SSH(t) |
| 22 | connectionID := sshserver.GenerateConnectionID() |
| 23 | cfg := config.SSHProxyConfig{} |
| 24 | structutils.Defaults(&cfg) |
| 25 | cfg.Server = sshServer.Host() |
| 26 | cfg.Port = uint16(sshServer.Port()) |
| 27 | cfg.Username = sshServer.Username() |
| 28 | cfg.Password = sshServer.Password() |
| 29 | cfg.AllowedHostKeyFingerprints = []string{ |
| 30 | sshServer.FingerprintSHA256(), |
| 31 | } |
| 32 | cfg.HostKeyAlgorithms, err = config.SSHKeyAlgoListFromStringList(sshServer.HostKeyAlgorithms()) |
| 33 | if err != nil { |
| 34 | t.Fatalf("invalid SSH host key algorithm list (%v)", err) |
| 35 | } |
| 36 | collector := metrics.New(dummy.New()) |
| 37 | return sshproxy.New( |
| 38 | net.TCPAddr{ |
| 39 | IP: net.ParseIP("127.0.0.1"), |
| 40 | Port: test.GetNextPort(t, "client"), |
| 41 | Zone: "", |
| 42 | }, |
| 43 | connectionID, |
| 44 | cfg, |
| 45 | logger, |
| 46 | collector.MustCreateCounter("backend_requests", "", ""), |
| 47 | collector.MustCreateCounter("backend_failures", "", ""), |
| 48 | ) |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | sshserver.RunConformanceTests(t, factories) |
| 53 | } |
nothing calls this directly
no test coverage detected