(t *testing.T)
| 394 | } |
| 395 | |
| 396 | func TestVerifySSHConnectionCtxSuccess(t *testing.T) { |
| 397 | tmpDir, cleanup := setupTestEnvironment(t) |
| 398 | defer cleanup() |
| 399 | |
| 400 | clientPrivateKey, _, clientPublicKey := generateRSAKeyPair(t) |
| 401 | keyFile := filepath.Join(tmpDir, "verify_key") |
| 402 | savePrivateKeyToFile(t, clientPrivateKey, keyFile) |
| 403 | |
| 404 | server, serverCleanup := setupSSHTestServer(t, clientPublicKey) |
| 405 | defer serverCleanup() |
| 406 | |
| 407 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 408 | defer cancel() |
| 409 | |
| 410 | err := VerifySSHConnectionCtx(ctx, "127.0.0.1", keyFile, server.port) |
| 411 | require.NoError(t, err) |
| 412 | } |
| 413 | |
| 414 | func TestVerifySSHConnectionCtxRespectsContext(t *testing.T) { |
| 415 | tmpDir, cleanup := setupTestEnvironment(t) |
nothing calls this directly
no test coverage detected