TEST: Add testcases to validated bridged networking connectivity (#14042)

* TEST: Add testcases to validated bridged networking connectivity * minor bridged test updates --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

Ben Hillis committed Jan 9, 2026 at 13:56 UTC 5e09668fb78a3180899c3c951cb5eb09954720de
1 file changed +49
test/windows/NetworkTests.cpp
+49
@@ -4480,6 +4480,55 @@ class BridgedTests
4480 auto [out, _] = LxsstuLaunchWslAndCaptureOutput(L"cat /proc/sys/net/ipv6/conf/all/disable_ipv6");
4481 VERIFY_ARE_EQUAL(L"0\n", out);
4482 }
4483 +
4484 + TEST_METHOD(SmokeTest)
4485 + {
4486 + WSL2_TEST_ONLY();
4487 + WINDOWS_11_TEST_ONLY();
4488 +
4489 + if (!NetworkTests::HostHasInternetConnectivity(AF_INET) && !NetworkTests::HostHasInternetConnectivity(AF_INET6))
4490 + {
4491 + LogSkipped("Host does not have internet connectivity. Skipping...");
4492 + return;
4493 + }
4494 +
4495 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Bridged, .vmSwitch = L"Default Switch"}));
4496 +
4497 + // Verify that we have a working connection
4498 + NetworkTests::GuestClient(L"tcp-connect:bing.com:80");
4499 + }
4500 +
4501 + TEST_METHOD(InternetConnectivityV4)
4502 + {
4503 + WSL2_TEST_ONLY();
4504 + WINDOWS_11_TEST_ONLY();
4505 +
4506 + if (!NetworkTests::HostHasInternetConnectivity(AF_INET))
4507 + {
4508 + LogSkipped("Host does not have IPv4 internet connectivity. Skipping...");
4509 + return;
4510 + }
4511 +
4512 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Bridged, .vmSwitch = L"Default Switch"}));
4513 +
4514 + NetworkTests::GuestClient(L"tcp4-connect:bing.com:80");
4515 + }
4516 +
4517 + TEST_METHOD(InternetConnectivityV6)
4518 + {
4519 + WSL2_TEST_ONLY();
4520 + WINDOWS_11_TEST_ONLY();
4521 +
4522 + if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
4523 + {
4524 + LogSkipped("Host does not have IPv6 internet connectivity. Skipping...");
4525 + return;
4526 + }
4527 +
4528 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Bridged, .vmSwitch = L"Default Switch"}));
4529 +
4530 + NetworkTests::GuestClient(L"tcp6-connect:bing.com:80");
4531 + }
4532 };
4533
4534 class VirtioProxyTests