pkg: apply managed DNS mode in the macOS package

This commit is contained in:
Dev Scribe
2026-08-24 15:17:03 +07:00
committed by Cuong Manh Le
parent a40eb70ce8
commit 5eb2db549b
13 changed files with 432 additions and 64 deletions
+16
View File
@@ -132,6 +132,22 @@ func (h *interceptFallbackHarness) run(t *testing.T) {
p.setDNS()
}
func TestSetDNSExplicitOffOverridesConfig(t *testing.T) {
h := newInterceptFallbackHarness(t, &ctrld.ListenerConfig{IP: "127.0.0.1", Port: 53})
interceptMode = "off"
dnsIntercept = false
hardIntercept = false
h.run(t)
if h.interceptCalls != 0 {
t.Fatalf("intercept start called %d time(s), want 0: explicit off must override service.intercept_mode", h.interceptCalls)
}
if h.installCalls != 1 {
t.Fatalf("interface DNS installed %d time(s), want 1", h.installCalls)
}
}
// TestSetDNSRefusesUnreachableFallback is the behaviour test for the reported outage: it
// drives the real setDNS() lifecycle rather than the classification helper alone.
//