(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestTryLogin_CacheFound_LaunchFails(t *testing.T) { |
| 45 | cfg, _ := setupSSHTestConfig(t) |
| 46 | |
| 47 | ctrl := NewSSHController("192.168.1.1", cfg) |
| 48 | // TryLogin will find cache for 192.168.1.1, attempt to Launch (which fails because |
| 49 | // no real SSH server), then fall through to tryLoginWithoutCache which also fails. |
| 50 | // The test verifies the function completes without panicking and that fields are set. |
| 51 | ctrl.TryLogin("root", 1, 1*time.Nanosecond) |
| 52 | |
| 53 | assert.Equal(t, "192.168.1.1", ctrl.targetIP) |
| 54 | assert.Equal(t, 1, ctrl.concurrency) |
| 55 | assert.Equal(t, 1*time.Nanosecond, ctrl.sshTimeout) |
| 56 | // Cache should have been found (user matches) |
| 57 | assert.True(t, ctrl.cacheIsFound) |
| 58 | } |
| 59 | |
| 60 | func TestTryLogin_CacheNotFound(t *testing.T) { |
| 61 | cfg, _ := setupSSHTestConfig(t) |
nothing calls this directly
no test coverage detected