MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestVerifySSHConnectionCtxSuccess

Function TestVerifySSHConnectionCtxSuccess

utils/ssh_test.go:396–412  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

394}
395
396func 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
414func TestVerifySSHConnectionCtxRespectsContext(t *testing.T) {
415 tmpDir, cleanup := setupTestEnvironment(t)

Callers

nothing calls this directly

Calls 5

generateRSAKeyPairFunction · 0.85
savePrivateKeyToFileFunction · 0.85
setupSSHTestServerFunction · 0.85
VerifySSHConnectionCtxFunction · 0.85
setupTestEnvironmentFunction · 0.70

Tested by

no test coverage detected