101
} \
102
}
103
104
-#define VIRTIOPROXY_TEST_ONLY() \
104
+#define CONSOMME_TEST_ONLY() \
105
{ \
106
}
107
163
164
namespace NetworkTests {
165
166
-class VirtioProxyTests;
166
+class ConsommeTests;
167
168
class NetworkTests
169
{
171
172
friend class MirroredTests;
173
friend class BridgedTests;
174
- friend class VirtioProxyTests;
174
+ friend class ConsommeTests;
175
176
struct IpAddress
177
{
1802
WINDOWS_11_TEST_ONLY();
1803
__fallthrough;
1804
case wsl::core::NetworkingMode::Mirrored:
1805
- case wsl::core::NetworkingMode::VirtioProxy:
1805
+ case wsl::core::NetworkingMode::Consomme:
1806
if (!LxsstuVmMode())
1807
{
1808
LogSkipped("This test is only applicable to WSL2");
4911
}
4912
};
4913
4914
-class VirtioProxyTests
4914
+class ConsommeTests
4915
{
4916
- WSL_TEST_CLASS(VirtioProxyTests)
4916
+ WSL_TEST_CLASS(ConsommeTests)
4917
4918
std::optional<WslConfigChange> m_config;
4919
4923
4924
if (LxsstuVmMode())
4925
{
4926
- m_config.emplace(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4926
+ m_config.emplace(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4927
}
4928
4929
return true;
4940
4941
WSL2_TEST_METHOD(SmokeTest)
4942
{
4943
- VIRTIOPROXY_TEST_ONLY();
4943
+ CONSOMME_TEST_ONLY();
4944
4945
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4945
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4946
4947
// Verify that we have a working connection
4948
NetworkTests::GuestClient(L"tcp-connect:bing.com:80");
4950
4951
WSL2_TEST_METHOD(InternetConnectivityV4)
4952
{
4953
- VIRTIOPROXY_TEST_ONLY();
4953
+ CONSOMME_TEST_ONLY();
4954
4955
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4955
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4956
4957
if (!NetworkTests::HostHasInternetConnectivity(AF_INET))
4958
{
4965
4966
WSL2_TEST_METHOD(InternetConnectivityV6)
4967
{
4968
- VIRTIOPROXY_TEST_ONLY();
4968
+ CONSOMME_TEST_ONLY();
4969
4970
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4970
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4971
4972
if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
4973
{
4982
4983
WSL2_TEST_METHOD(Configuration)
4984
{
4985
- VIRTIOPROXY_TEST_ONLY();
4985
+ CONSOMME_TEST_ONLY();
4986
4987
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4987
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4988
4989
const auto state = NetworkTests::GetInterfaceState(L"eth0");
4990
VERIFY_IS_FALSE(state.V4Addresses.empty());
5007
5008
WSL2_TEST_METHOD(ValidateMacAddress)
5009
{
5010
- VIRTIOPROXY_TEST_ONLY();
5010
+ CONSOMME_TEST_ONLY();
5011
5012
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5012
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5013
5014
// eth0 should have wsldevicehost's default client MAC. Update if that default changes.
5015
VERIFY_ARE_EQUAL(GetMacAddress(L"eth0"), std::wstring(L"00:00:00:00:01:00"));
5017
5018
WSL2_TEST_METHOD(GuestPortIsReleased)
5019
{
5020
- VIRTIOPROXY_TEST_ONLY();
5020
+ CONSOMME_TEST_ONLY();
5021
5022
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5022
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5023
5024
// Make sure the VM doesn't time out
5025
WslKeepAlive keepAlive;
5045
5046
WSL2_TEST_METHOD(LoopbackGuestToHost)
5047
{
5048
- VIRTIOPROXY_TEST_ONLY();
5048
+ CONSOMME_TEST_ONLY();
5049
5050
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5050
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5051
5052
// Verify guest can connect to host on loopback (TCP only, UDP not supported)
5053
NetworkTests::VerifyLoopbackGuestToHost(L"127.0.0.1", IPPROTO_TCP);
5059
5060
WSL2_TEST_METHOD(UdpBindDoesNotPreventTcpBind)
5061
{
5062
- VIRTIOPROXY_TEST_ONLY();
5062
+ CONSOMME_TEST_ONLY();
5063
5064
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5064
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5065
5066
auto tcpPort = NetworkTests::BindGuestPort(L"TCP4-LISTEN:1234", true);
5067
auto udpPort = NetworkTests::BindGuestPort(L"UDP4-LISTEN:1234", true);
5069
5070
WSL2_TEST_METHOD(HostUdpBindDoesNotPreventGuestTcpBind)
5071
{
5072
- VIRTIOPROXY_TEST_ONLY();
5072
+ CONSOMME_TEST_ONLY();
5073
5074
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5074
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5075
5076
auto udpPort = NetworkTests::BindHostPort(2345, SOCK_DGRAM, IPPROTO_UDP, true);
5077
auto tcpPort = NetworkTests::BindGuestPort(L"TCP4-LISTEN:2345", true);
5079
5080
WSL2_TEST_METHOD(PortZeroBindIsTracked)
5081
{
5082
- VIRTIOPROXY_TEST_ONLY();
5082
+ CONSOMME_TEST_ONLY();
5083
5084
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5084
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5085
5086
NetworkTests::VerifyPortZeroBindIsTracked();
5087
}
5088
5089
WSL2_TEST_METHOD(PortZeroRebindSucceeds)
5090
{
5091
- VIRTIOPROXY_TEST_ONLY();
5091
+ CONSOMME_TEST_ONLY();
5092
5093
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5093
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5094
5095
NetworkTests::VerifyPortZeroRebindSucceeds();
5096
}
5097
5098
WSL2_TEST_METHOD(HttpProxySimple)
5099
{
5100
- VIRTIOPROXY_TEST_ONLY();
5100
+ CONSOMME_TEST_ONLY();
5101
WINHTTP_PROXY_TEST_ONLY();
5102
5103
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .autoProxy = true}));
5103
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .autoProxy = true}));
5104
NetworkTests::VerifyHttpProxySimple();
5105
}
5106
5107
WSL2_TEST_METHOD(ConfigurationV6)
5108
{
5109
- VIRTIOPROXY_TEST_ONLY();
5109
+ CONSOMME_TEST_ONLY();
5110
5111
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5111
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5112
5113
if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
5114
{
5181
5182
WSL2_TEST_METHOD(GuestPortIsReleasedV6)
5183
{
5184
- VIRTIOPROXY_TEST_ONLY();
5184
+ CONSOMME_TEST_ONLY();
5185
WINDOWS_11_TEST_ONLY();
5186
5187
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5187
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5188
5189
// Make sure the VM doesn't time out
5190
WslKeepAlive keepAlive;
5210
5211
WSL2_TEST_METHOD(ConfigurationV6DnsServers)
5212
{
5213
- VIRTIOPROXY_TEST_ONLY();
5213
+ CONSOMME_TEST_ONLY();
5214
5215
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5215
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5216
5217
if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
5218
{
5235
5236
WSL2_TEST_METHOD(DnsResolutionBasic)
5237
{
5238
- VIRTIOPROXY_TEST_ONLY();
5238
+ CONSOMME_TEST_ONLY();
5239
5240
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5240
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5241
NetworkTests::VerifyDnsResolutionBasic();
5242
}
5243
5244
WSL2_TEST_METHOD(DnsResolutionDig)
5245
{
5246
- VIRTIOPROXY_TEST_ONLY();
5246
+ CONSOMME_TEST_ONLY();
5247
5248
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5248
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5249
NetworkTests::VerifyDnsResolutionDig();
5250
}
5251
5252
WSL2_TEST_METHOD(DnsResolutionRecordTypes)
5253
{
5254
- VIRTIOPROXY_TEST_ONLY();
5254
+ CONSOMME_TEST_ONLY();
5255
5256
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5256
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5257
NetworkTests::VerifyDnsResolutionRecordTypes();
5258
}
5259
5260
WSL2_TEST_METHOD(DnsResolutionBasicDnsTunneling)
5261
{
5262
- VIRTIOPROXY_TEST_ONLY();
5262
+ CONSOMME_TEST_ONLY();
5263
DNS_TUNNELING_TEST_ONLY();
5264
5265
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5265
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5266
NetworkTests::VerifyDnsResolutionBasic();
5267
}
5268
5269
WSL2_TEST_METHOD(DnsResolutionDigDnsTunneling)
5270
{
5271
- VIRTIOPROXY_TEST_ONLY();
5271
+ CONSOMME_TEST_ONLY();
5272
DNS_TUNNELING_TEST_ONLY();
5273
5274
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5274
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5275
NetworkTests::VerifyDnsResolutionDig();
5276
}
5277
5278
WSL2_TEST_METHOD(DnsResolutionRecordTypesDnsTunneling)
5279
{
5280
- VIRTIOPROXY_TEST_ONLY();
5280
+ CONSOMME_TEST_ONLY();
5281
DNS_TUNNELING_TEST_ONLY();
5282
5283
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5283
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5284
NetworkTests::VerifyDnsResolutionRecordTypes();
5285
}
5286
5287
- // Verifies that virtio proxy + dnsTunneling points resolv.conf at the gateway, not the hvsocket listener IP.
5287
+ // Verifies that Consomme + dnsTunneling points resolv.conf at the gateway, not the hvsocket listener IP.
5288
WSL2_TEST_METHOD(DnsTunnelingResolvConfUsesGateway)
5289
{
5290
- VIRTIOPROXY_TEST_ONLY();
5290
+ CONSOMME_TEST_ONLY();
5291
DNS_TUNNELING_TEST_ONLY();
5292
5293
- m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5293
+ m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5294
5295
const auto state = NetworkTests::GetInterfaceState(L"eth0");
5296
VERIFY_IS_TRUE(state.Gateway.has_value());