feat: T1016 dns_config probe + server-side drift detection + Crucible DNS DRIFT badge

This commit is contained in:
AetherForge
2026-05-30 23:26:50 -07:00
parent 6704933568
commit d005d5d07c
48 changed files with 4621 additions and 22 deletions

View File

@@ -0,0 +1,32 @@
package sys
import (
"runtime"
"strings"
"testing"
)
func TestEnsureInboundTCPPortInvalidPort(t *testing.T) {
err := EnsureInboundTCPPort(0, "test")
if err == nil {
t.Fatal("expected error for port 0")
}
if runtime.GOOS == "windows" {
if !strings.Contains(err.Error(), "invalid port") {
t.Fatalf("unexpected error: %v", err)
}
}
}
func TestEnsureInboundTCPPortNonWindows(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("stub-only test for non-Windows builds")
}
err := EnsureInboundTCPPort(8080, "test")
if err == nil {
t.Fatal("expected error on non-Windows")
}
if !strings.Contains(err.Error(), "only supported on Windows") {
t.Fatalf("unexpected error: %v", err)
}
}