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

Function TestSelectServerCache_MatchingIPAndUser

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

Source from the content-addressed store, hash-verified

61}
62
63func TestSelectServerCache_MatchingIPAndUser(t *testing.T) {
64 conf := newTestConfig()
65
66 // Search with both IP and user -- should match the specific server
67 server, index, found := SelectServerCache("admin", "192.168.1.1", conf)
68 assert.True(t, found)
69 assert.NotNil(t, server)
70 assert.Equal(t, 2, index)
71 assert.Equal(t, "192.168.1.1", server.IP)
72 assert.Equal(t, "admin", server.User)
73 assert.Equal(t, "server1-admin", server.Alias)
74}
75
76func TestSelectServerCache_MatchingIPAndUserSecondServer(t *testing.T) {
77 conf := newTestConfig()

Callers

nothing calls this directly

Calls 2

newTestConfigFunction · 0.85
SelectServerCacheFunction · 0.85

Tested by

no test coverage detected