MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestSelectServerCache_MatchingIP

Function TestSelectServerCache_MatchingIP

pkg/config/cache_test.go:51–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestSelectServerCache_MatchingIP(t *testing.T) {
52 conf := newTestConfig()
53
54 // Search with IP only (empty user) -- should return the first matching IP
55 server, index, found := SelectServerCache("", "192.168.1.1", conf)
56 assert.True(t, found)
57 assert.NotNil(t, server)
58 assert.Equal(t, 0, index)
59 assert.Equal(t, "192.168.1.1", server.IP)
60 assert.Equal(t, "root", server.User)
61}
62
63func TestSelectServerCache_MatchingIPAndUser(t *testing.T) {
64 conf := newTestConfig()

Callers

nothing calls this directly

Calls 2

newTestConfigFunction · 0.85
SelectServerCacheFunction · 0.85

Tested by

no test coverage detected