mirror of
https://github.com/wavetermdev/waveterm
synced 2026-04-21 22:47:16 +00:00
#2643 ## Implementation 1. Add platform-aware identity-agent dialing: on Window, default to `//./pipe/openssh-ssh-agent`. 2. Keep Unix agent dialing via Unix sockets; unify agent resolution across platforms. 3. Add cross-platform unit tests covering dialer selection and failure paths.
21 lines
532 B
Go
21 lines
532 B
Go
//go:build windows
|
|
|
|
package remote
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestDialIdentityAgentWindowsTimeout(t *testing.T) {
|
|
start := time.Now()
|
|
_, err := dialIdentityAgent(`\\.\\pipe\\waveterm-nonexistent-agent`)
|
|
if err == nil {
|
|
t.Skip("unexpectedly connected to a test pipe; skipping")
|
|
}
|
|
// Optionally verify error indicates connection/timeout failure
|
|
t.Logf("dialIdentityAgent returned expected error: %v", err)
|
|
if time.Since(start) > 3*time.Second {
|
|
t.Fatalf("dialIdentityAgent exceeded expected timeout window")
|
|
}
|
|
}
|