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

Function TestSSHController_TryLogin_UserSpecified

pkg/control/ssh_test.go:87–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestSSHController_TryLogin_UserSpecified(t *testing.T) {
88 cfg := newTestMainConfig()
89 ctrl := NewSSHController("192.168.1.1", cfg)
90
91 // When user is specified, SelectServerCache filters by user
92 _, _, found := config.SelectServerCache("admin", ctrl.targetIP, ctrl.configuration)
93 assert.False(t, found, "192.168.1.1 has user=root, not admin")
94
95 server, idx, found := config.SelectServerCache("root", ctrl.targetIP, ctrl.configuration)
96 assert.True(t, found)
97 assert.Equal(t, 0, idx)
98 assert.Equal(t, "root", server.User)
99}
100
101func TestSSHController_TryLogin_EmptyUser(t *testing.T) {
102 cfg := newTestMainConfig()

Callers

nothing calls this directly

Calls 3

SelectServerCacheFunction · 0.92
newTestMainConfigFunction · 0.85
NewSSHControllerFunction · 0.85

Tested by

no test coverage detected