mirror of
https://github.com/microsoft/WSL.git
synced 2026-04-17 13:31:06 -05:00
DNS: Simplify dns logic and switch to using 'search' instead of 'domain' which is obsolete. (#14133)
* DNS: Simplify dns logic and switch to using 'search' instead of 'domain' which is obsolete. * add optional header for natnetworking * format * extend configuration test for virtioproxy networking mode --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
This commit is contained in:
@@ -1037,7 +1037,6 @@ class NetworkTests
|
||||
|
||||
wsl::shared::hns::DNS dns;
|
||||
dns.ServerList = L"1.1.1.1,1.1.1.2";
|
||||
dns.Domain = L"microsoft.com";
|
||||
dns.Search = L"foo.microsoft.com,bar.microsoft.com";
|
||||
dns.Options = LX_INIT_RESOLVCONF_FULL_HEADER;
|
||||
RunGns(dns, ModifyRequestType::Update, GuestEndpointResourceType::DNS);
|
||||
@@ -1047,7 +1046,6 @@ class NetworkTests
|
||||
const std::wstring expected = std::wstring(LX_INIT_RESOLVCONF_FULL_HEADER) +
|
||||
L"nameserver 1.1.1.1\n"
|
||||
L"nameserver 1.1.1.2\n"
|
||||
L"domain microsoft.com\n"
|
||||
L"search foo.microsoft.com bar.microsoft.com\n";
|
||||
VERIFY_ARE_EQUAL(expected, out.c_str());
|
||||
}
|
||||
@@ -4612,6 +4610,9 @@ class VirtioProxyTests
|
||||
const std::wregex pattern(L"(.|\\n)*nameserver [0-9. ]+(.|\\n)*");
|
||||
|
||||
VERIFY_IS_TRUE(std::regex_match(out, pattern));
|
||||
|
||||
// Verify that /etc/resolv.conf contains a 'search' line with DNS suffixes
|
||||
VERIFY_IS_TRUE(out.find(L"search ") != std::wstring::npos);
|
||||
}
|
||||
|
||||
TEST_METHOD(GuestPortIsReleased)
|
||||
|
||||
Reference in New Issue
Block a user