net/dns: add NetworkManager regression test
Use the exact /etc/resolv.conf file from a user report.
Updates
@@ -220,6 +220,17 @@ func TestLinuxDNSMode(t *testing.T) {
wantLog: "dns: [rc=nm nm-resolved=yes nm=no ret=systemd-resolved]",
want: "systemd-resolved",
},
+ {
+ // regression test for https://github.com/tailscale/tailscale/issues/3531
+ name: "networkmanager_but_systemd-resolved_with_search_domain",
+ env: env(resolvDotConf(
+ "# Generated by NetworkManager",
+ "search lan",
+ "nameserver 127.0.0.53"),
+ resolvedRunning()),
+ wantLog: "dns: [rc=nm nm-resolved=yes nm=no ret=systemd-resolved]",
+ want: "systemd-resolved",
+ },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
