fix-1748-own-resolver-wait: the own resolver's file waits 3 s a try
The resolver file of systemd-resolved (resolvers and kept facts) carries options timeout:3 attempts:2 edns0 in place of timeout:1; manifest test asserts both facts, guard test's literal follows. Builds: design 50 resolver-wait §1, §4 (and §2 of the main file, line 73)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const meshFile = "# Managed by the mesh\nnameserver 10.42.0.2\noptions timeout:1 attempts:2 edns0\n"
|
||||
const meshFile = "# Managed by the mesh\nnameserver 10.42.0.2\noptions timeout:3 attempts:2 edns0\n"
|
||||
|
||||
// vpnFile is a VPN client's file as one writes it; the addresses and domains are documentation's.
|
||||
const vpnFile = "# Dynamic resolv.conf(5) file for glibc resolver(3) generated by forticlient\n" +
|
||||
|
||||
@@ -73,6 +73,12 @@ func TestTheManifestSaysWhatTheGuardKeeps(t *testing.T) {
|
||||
if len(lines) != 1 || strings.Contains(m.Facts["resolvers"].Template, "search ") {
|
||||
t.Errorf("the resolver file lists more than this machine's own resolver: %v", lines)
|
||||
}
|
||||
// Design 50 resolver-wait §1: both facts carry the longer wait, never the uplink files' timeout:1.
|
||||
for _, fact := range []string{"resolvers", "kept"} {
|
||||
if tpl := m.Facts[fact].Template; !strings.Contains(tpl, "\noptions timeout:3 attempts:2 edns0\n") || strings.Contains(tpl, "timeout:1") {
|
||||
t.Errorf("fact %s does not carry options timeout:3 attempts:2 edns0: %q", fact, tpl)
|
||||
}
|
||||
}
|
||||
conf := m.Facts["resolved"].Template
|
||||
for _, want := range []string{`DNS={{range index .Holders "mesh-dns-resolver"}}`, "\nDomains=~.\n", "\nFallbackDNS=\n",
|
||||
"DNSStubListenerExtra={{$own}}\n", "\nCache=no\n", "\nLLMNR=no\n", "\nMulticastDNS=no\n"} {
|
||||
|
||||
Reference in New Issue
Block a user