This commit is contained in:
2026-07-11 01:51:21 -03:00
parent 4e3c99650e
commit 6f7fa2fad1
7 changed files with 60 additions and 18 deletions
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"testing"
"time"
)
func TestSSHIdleTimeoutDisabledByDefault(t *testing.T) {
for _, raw := range []string{"", "0", "0s", "off", "disabled"} {
if got := parseSSHIdleTimeout(raw); got != 0 {
t.Fatalf("parseSSHIdleTimeout(%q) = %s, want disabled", raw, got)
}
}
}
func TestSSHIdleTimeoutExplicitValue(t *testing.T) {
if got := parseSSHIdleTimeout("30m"); got != 30*time.Minute {
t.Fatalf("got %s, want 30m", got)
}
}
func TestNativeXHTTPConnectedIdleSweepDisabled(t *testing.T) {
if got := nativeXHTTPIdleTimeout(); got != 0 {
t.Fatalf("native XHTTP idle timeout = %s, want disabled", got)
}
}