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

Function TestSSHController_TryLogin_AliasResolution

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

Source from the content-addressed store, hash-verified

69}
70
71func TestSSHController_TryLogin_AliasResolution(t *testing.T) {
72 cfg := newTestMainConfig()
73
74 // Test that alias resolves to IP
75 resolved := config.ResolveAlias("server1", cfg)
76 assert.Equal(t, "192.168.1.1", resolved)
77
78 // Test that unknown alias returns the original string
79 resolved = config.ResolveAlias("unknown", cfg)
80 assert.Equal(t, "unknown", resolved)
81
82 // Test that IP returns IP unchanged
83 resolved = config.ResolveAlias("192.168.1.1", cfg)
84 assert.Equal(t, "192.168.1.1", resolved)
85}
86
87func TestSSHController_TryLogin_UserSpecified(t *testing.T) {
88 cfg := newTestMainConfig()

Callers

nothing calls this directly

Calls 2

ResolveAliasFunction · 0.92
newTestMainConfigFunction · 0.85

Tested by

no test coverage detected