diff --git a/.pipelines/build-stage.yml b/.pipelines/build-stage.yml index 1e185dd..2ce92b0 100644 --- a/.pipelines/build-stage.yml +++ b/.pipelines/build-stage.yml @@ -29,7 +29,7 @@ parameters: type: object default: - target: "wsl;libwsl;wslg;wslservice;wslhost;wslrelay;wslinstaller;wslinstall;initramfs;wslserviceproxystub;wslsettings;wslinstallerproxystub;testplugin;wslaclient;wsltests" - pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings.dll,wslsettings.exe,wslinstallerproxystub.dll,wsldevicehost.dll,lxutil.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll,wslaclient.dll" + pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings.dll,wslsettings.exe,wslinstallerproxystub.dll,wsldevicehost.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll,wslaclient.dll" - target: "msixgluepackage" pattern: "gluepackage.msix" - target: "msipackage" diff --git a/.pipelines/flight-stage.yml b/.pipelines/flight-stage.yml index d60f03a..c832ac4 100644 --- a/.pipelines/flight-stage.yml +++ b/.pipelines/flight-stage.yml @@ -67,7 +67,7 @@ stages: displayName: Copy AppxUpload artifact # creates a submission package that is published to the store; containers store page information and the WSL appxupload - - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3 + - task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3 displayName: 'Creating StoreBroker Payload' inputs: serviceEndpoint: 'AzureConnection-StoreBroker-WIF' @@ -88,7 +88,7 @@ stages: displayName: Copy StoreBrokerPayload to drop # submit the package flight to the WSL SelfHost Flight Group - - task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@3 + - task: MS-RDX-MRO.windows-store-publish.flight-task.store-flight@3 displayName: 'Flight StoreBroker Package to Partner Center - WSL SelfHost Flight Group' condition: and(succeeded(), eq('${{ parameters.publishPackage }}', true)) inputs: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9de9576..c5a3676 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,13 +75,11 @@ find_nuget_package(Wix WIX /tools/net6.0/any) if (${TARGET_PLATFORM} STREQUAL "x64") find_nuget_package(Microsoft.DXCore.Linux.amd64fre DXCORE /build/native) find_nuget_package(Microsoft.WSL.Dependencies.amd64fre WSLDEPS /build/native) - find_nuget_package(Microsoft.WSL.LxUtil.amd64fre LXUTIL /build/native) endif() if (${TARGET_PLATFORM} STREQUAL "arm64") find_nuget_package(Microsoft.DXCore.Linux.arm64fre DXCORE /build/native) find_nuget_package(Microsoft.WSL.Dependencies.arm64fre WSLDEPS /build/native) - find_nuget_package(Microsoft.WSL.LxUtil.arm64fre LXUTIL /build/native) endif() # Wsl Settings packages @@ -154,7 +152,6 @@ file(MAKE_DIRECTORY ${GENERATED_DIR}) set(PACKAGE_CERTIFICATE ${GENERATED_DIR}/dev-cert.pfx) file(CREATE_LINK ${WSL_DEVICE_HOST_SOURCE_DIR}/bin/${TARGET_PLATFORM}/wsldevicehost.dll ${BIN}/wsldevicehost.dll) -file(CREATE_LINK ${LXUTIL_SOURCE_DIR}/bin/lxutil.dll ${BIN}/lxutil.dll) file(CREATE_LINK ${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/${WSLG_TS_PLUGIN_DLL} ${BIN}/${WSLG_TS_PLUGIN_DLL}) file(CREATE_LINK ${WSLDEPS_SOURCE_DIR}/bin/wsldeps.dll ${BIN}/wsldeps.dll) @@ -205,7 +202,6 @@ add_compile_definitions(UNICODE WSL_DEVICE_HOST_VERSION="${WSL_DEVICE_HOST_VERSION}" COMMIT_HASH="${COMMIT_HASH}" WSL_PACKAGE_VERSION="${PACKAGE_VERSION}" - LXUTIL_VERSION="${LXUTIL_VERSION}" MSRDC_VERSION="${MSRDC_VERSION}" DIRECT3D_VERSION="${DIRECT3D_VERSION}" DXCORE_VERSION="${DXCORE_VERSION}" @@ -237,7 +233,6 @@ endif() # Common link libraries link_directories(${WSLDEPS_SOURCE_DIR}/lib/) -link_directories(${LXUTIL_SOURCE_DIR}/lib/) set(COMMON_LINK_LIBRARIES ws2_32.lib Userenv.lib diff --git a/NOTICE.txt b/NOTICE.txt index 24abab4..564f125 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -636,6 +636,39 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.NETCore.App.Runtime.win-arm64 10.0.0 - MIT + + + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + --------------------------------------------------------- --------------------------------------------------------- diff --git a/distributions/DistributionInfo.json b/distributions/DistributionInfo.json index c68dd67..0596ec5 100644 --- a/distributions/DistributionInfo.json +++ b/distributions/DistributionInfo.json @@ -62,8 +62,8 @@ "FriendlyName": "SUSE Linux Enterprise 15 SP7", "Default": false, "Amd64Url": { - "Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20250903.0/SUSE-Linux-Enterprise-15-SP7-15.7.x86_64-27.32-Build27.32.wsl", - "Sha256": "0x1e53279af609b9d67b108bc31f1318c3317338595298ef8dfbf7a5728ab8a093" + "Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-15-SP7-15.7.x86_64-30.1-Build30.1.wsl", + "Sha256": "0x60924e13286ed15bdcf9069e3a24d3394fb858954de3bdfcb1ea576900b81b2e" } }, { @@ -71,8 +71,8 @@ "FriendlyName": "SUSE Linux Enterprise 16.0", "Default": true, "Amd64Url": { - "Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251104.0/SUSE-Linux-Enterprise-16.0-16.0.x86_64-1.3-Build1.3.wsl", - "Sha256": "0xb91f901ba96910fa65218ef0e6aaae7b9980bd11fed63cb3507878aa8915d726" + "Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-16.0-16.0.x86_64-1.9-Build1.9.wsl", + "Sha256": "0xf0fc07ed3543d3dc24cfb35b4194bbecf98485cefdd720c521034ac1c54bffd3" } } ], @@ -166,8 +166,8 @@ "FriendlyName": "Arch Linux", "Default": true, "Amd64Url": { - "Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.11.01.150831/archlinux-2025.11.01.150831.wsl", - "Sha256": "9dbac892c38c94fd22a8988eff4e072778f3f445378d33a81474a2b88cb04562" + "Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.12.01.153427/archlinux-2025.12.01.153427.wsl", + "Sha256": "8dfe92910a188f191b0af2972bd4bda661178b769ce820a8921e8b7aeae9a517" } } ], diff --git a/msipackage/package.wix.in b/msipackage/package.wix.in index 1ceca4e..8c4b3f7 100644 --- a/msipackage/package.wix.in +++ b/msipackage/package.wix.in @@ -381,7 +381,6 @@ - diff --git a/packages.config b/packages.config index 36372a9..839a44a 100644 --- a/packages.config +++ b/packages.config @@ -19,10 +19,8 @@ - + - - diff --git a/src/linux/init/init.cpp b/src/linux/init/init.cpp index 0611dda..9894003 100644 --- a/src/linux/init/init.cpp +++ b/src/linux/init/init.cpp @@ -2258,7 +2258,16 @@ Return Value: if (Value != nullptr) { Config.VmId = Value; - unsetenv(LX_WSL2_VM_ID_ENV); + + // + // Unset the environment variable for user distros. + // + + Value = getenv(LX_WSL2_SHARED_MEMORY_OB_DIRECTORY); + if (!Value) + { + unsetenv(LX_WSL2_VM_ID_ENV); + } } // diff --git a/src/windows/common/NatNetworking.cpp b/src/windows/common/NatNetworking.cpp index dbad2a2..1be0049 100644 --- a/src/windows/common/NatNetworking.cpp +++ b/src/windows/common/NatNetworking.cpp @@ -506,23 +506,12 @@ CATCH_LOG() void NatNetworking::UpdateMtu() { - unique_interface_table interfaceTable{}; - THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable)); - - ULONG minMtu = ULONG_MAX; - for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++) - { - const auto& ipInterface = interfaceTable.get()->Table[index]; - if (ipInterface.Connected) - { - minMtu = std::min(ipInterface.NlMtu, minMtu); - } - } + const auto minMtu = GetMinimumConnectedInterfaceMtu(); // Only send the update if the MTU changed. - if (minMtu != ULONG_MAX && minMtu != m_networkMtu) + if (minMtu && minMtu.value() != m_networkMtu) { - m_networkMtu = minMtu; + m_networkMtu = minMtu.value(); hns::ModifyGuestEndpointSettingRequest notification{}; notification.ResourceType = hns::GuestEndpointResourceType::Interface; diff --git a/src/windows/common/VirtioNetworking.cpp b/src/windows/common/VirtioNetworking.cpp index aeb3722..cd5974d 100644 --- a/src/windows/common/VirtioNetworking.cpp +++ b/src/windows/common/VirtioNetworking.cpp @@ -23,6 +23,14 @@ VirtioNetworking::VirtioNetworking( { } +VirtioNetworking::~VirtioNetworking() +{ + // Unregister the network notification callback to prevent it from using the GNS channel. + m_networkNotifyHandle.reset(); + // Stop the GNS channel to unblock any stuck communications with the guest. + m_gnsChannel.Stop(); +} + void VirtioNetworking::Initialize() { m_networkSettings = GetHostEndpointSettings(); @@ -270,32 +278,25 @@ void VirtioNetworking::UpdateDns(hns::DNS&& dnsSettings) void VirtioNetworking::UpdateMtu() { - unique_interface_table interfaceTable{}; - THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable)); - - ULONG minMtu = ULONG_MAX; - for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++) - { - const auto& ipInterface = interfaceTable.get()->Table[index]; - if (ipInterface.Connected) - { - minMtu = std::min(ipInterface.NlMtu, minMtu); - } - } + const auto minMtu = GetMinimumConnectedInterfaceMtu(); // Only send the update if the MTU changed. - if (minMtu != ULONG_MAX && minMtu != m_networkMtu) + if (minMtu && minMtu.value() != m_networkMtu) { + m_networkMtu = minMtu.value(); + hns::ModifyGuestEndpointSettingRequest notification{}; notification.ResourceType = hns::GuestEndpointResourceType::Interface; notification.RequestType = hns::ModifyRequestType::Update; - notification.Settings.NlMtu = m_networkMtu; notification.Settings.Connected = true; + notification.Settings.NlMtu = m_networkMtu; - WSL_LOG("VirtioNetworking::UpdateMtu", TraceLoggingValue(m_networkMtu, "VirtioMtu")); + WSL_LOG( + "VirtioNetworking::UpdateMtu", + TraceLoggingValue(m_adapterId, "endpointId"), + TraceLoggingValue(m_networkMtu, "virtioMtu")); - // TODO: Why was this commented ? - // m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_endpointId); + m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_adapterId); } } diff --git a/src/windows/common/VirtioNetworking.h b/src/windows/common/VirtioNetworking.h index 2c78515..91d0c7b 100644 --- a/src/windows/common/VirtioNetworking.h +++ b/src/windows/common/VirtioNetworking.h @@ -14,7 +14,7 @@ class VirtioNetworking : public INetworkingEngine { public: VirtioNetworking(GnsChannel&& gnsChannel, bool enableLocalhostRelay, std::shared_ptr guestDeviceManager, GUID classId, wil::shared_handle userToken); - ~VirtioNetworking() = default; + ~VirtioNetworking(); // Note: This class cannot be moved because m_networkNotifyHandle captures a 'this' pointer. VirtioNetworking(const VirtioNetworking&) = delete; diff --git a/src/windows/common/WslCoreNetworkingSupport.cpp b/src/windows/common/WslCoreNetworkingSupport.cpp index a884579..d4fd0d9 100644 --- a/src/windows/common/WslCoreNetworkingSupport.cpp +++ b/src/windows/common/WslCoreNetworkingSupport.cpp @@ -248,3 +248,25 @@ wsl::core::networking::EphemeralHcnEndpoint wsl::core::networking::CreateEphemer return endpoint; } + +std::optional wsl::core::networking::GetMinimumConnectedInterfaceMtu() noexcept +{ + std::optional minMtu{}; + try + { + unique_interface_table interfaceTable{}; + THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable)); + + for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++) + { + const auto& ipInterface = interfaceTable.get()->Table[index]; + if (ipInterface.Connected) + { + minMtu = std::min(minMtu.value_or(ipInterface.NlMtu), ipInterface.NlMtu); + } + } + } + CATCH_LOG() + + return minMtu; +} diff --git a/src/windows/common/WslCoreNetworkingSupport.h b/src/windows/common/WslCoreNetworkingSupport.h index ff6ac76..f66a742 100644 --- a/src/windows/common/WslCoreNetworkingSupport.h +++ b/src/windows/common/WslCoreNetworkingSupport.h @@ -456,6 +456,11 @@ std::vector EnumerateConnect bool IsMetered(ABI::Windows::Networking::Connectivity::NetworkCostType cost) noexcept; +/// +/// Gets the minimum MTU across all connected network interfaces. +/// +std::optional GetMinimumConnectedInterfaceMtu() noexcept; + /// /// This instance acts as an IP_ADAPTER_ADDRESS pointer. /// diff --git a/src/windows/wslsettings/Views/OOBE/DistroManagementPage.xaml b/src/windows/wslsettings/Views/OOBE/DistroManagementPage.xaml index 8a5e57e..d0e6474 100644 --- a/src/windows/wslsettings/Views/OOBE/DistroManagementPage.xaml +++ b/src/windows/wslsettings/Views/OOBE/DistroManagementPage.xaml @@ -10,11 +10,11 @@ - + - + - + diff --git a/src/windows/wslsettings/Views/OOBE/GUIAppsPage.xaml b/src/windows/wslsettings/Views/OOBE/GUIAppsPage.xaml index 96349af..288f1c4 100644 --- a/src/windows/wslsettings/Views/OOBE/GUIAppsPage.xaml +++ b/src/windows/wslsettings/Views/OOBE/GUIAppsPage.xaml @@ -9,7 +9,7 @@ - + diff --git a/src/windows/wslsettings/Views/OOBE/NetworkingIntegrationPage.xaml b/src/windows/wslsettings/Views/OOBE/NetworkingIntegrationPage.xaml index 1102f02..2a170cb 100644 --- a/src/windows/wslsettings/Views/OOBE/NetworkingIntegrationPage.xaml +++ b/src/windows/wslsettings/Views/OOBE/NetworkingIntegrationPage.xaml @@ -12,7 +12,7 @@ - + diff --git a/src/windows/wslsettings/Views/OOBE/VSCodeIntegrationPage.xaml b/src/windows/wslsettings/Views/OOBE/VSCodeIntegrationPage.xaml index e5b4d23..d109d98 100644 --- a/src/windows/wslsettings/Views/OOBE/VSCodeIntegrationPage.xaml +++ b/src/windows/wslsettings/Views/OOBE/VSCodeIntegrationPage.xaml @@ -10,9 +10,9 @@ - + - + diff --git a/src/windows/wslsettings/Views/OOBE/WorkingAcrossFileSystemsPage.xaml b/src/windows/wslsettings/Views/OOBE/WorkingAcrossFileSystemsPage.xaml index 1f4f37d..3eda0cd 100644 --- a/src/windows/wslsettings/Views/OOBE/WorkingAcrossFileSystemsPage.xaml +++ b/src/windows/wslsettings/Views/OOBE/WorkingAcrossFileSystemsPage.xaml @@ -10,11 +10,11 @@ - + - + - + diff --git a/test/linux/unit_tests/drvfs.c b/test/linux/unit_tests/drvfs.c index bde26a9..bceb9cc 100644 --- a/test/linux/unit_tests/drvfs.c +++ b/test/linux/unit_tests/drvfs.c @@ -1417,6 +1417,13 @@ Return Value: int Result; + if (g_LxtFsInfo.FsType == LxtFsTypeVirtioFs) + { + LxtLogInfo("TODO: debug this test on virtiofs."); + Result = 0; + goto ErrorExit; + } + LxtCheckResult(LxtFsDeleteLoopCommon(DRVFS_DELETELOOP_PREFIX)); ErrorExit: @@ -1951,12 +1958,12 @@ Return Value: // // Fstat should still work after unlink. // - // N.B. This currently doesn't work on plan 9. + // N.B. This currently doesn't work on plan9 or virtiofs. // LxtCheckErrnoZeroSuccess(unlink(DRVFS_BASIC_PREFIX "/testfile")); LxtCheckErrnoFailure(stat(DRVFS_BASIC_PREFIX "/testfile", &Stat2), ENOENT); - if (g_LxtFsInfo.FsType != LxtFsTypePlan9) + if (g_LxtFsInfo.FsType != LxtFsTypePlan9 && g_LxtFsInfo.FsType != LxtFsTypeVirtioFs) { LxtCheckErrnoZeroSuccess(fstat(Fd, &Stat2)); @@ -2143,9 +2150,9 @@ Return Value: Dir = NULL; - if (g_LxtFsInfo.FsType == LxtFsTypePlan9) + if (g_LxtFsInfo.FsType == LxtFsTypePlan9 || g_LxtFsInfo.FsType == LxtFsTypeVirtioFs) { - LxtLogInfo("This test is not relevant in VM mode."); + LxtLogInfo("This test is not relevant for plan9 or virtiofs."); Result = 0; goto ErrorExit; } @@ -3171,12 +3178,12 @@ Return Value: Fd2 = -1; // - // This functionality is not supported on Plan 9. + // This functionality is not supported on Plan 9 or virtiofs. // - if (g_LxtFsInfo.FsType == LxtFsTypePlan9) + if (g_LxtFsInfo.FsType == LxtFsTypePlan9 || g_LxtFsInfo.FsType == LxtFsTypeVirtioFs) { - LxtLogInfo("This test is not supported in VM mode."); + LxtLogInfo("This test is not supported for plan9 or virtiofs."); Result = 0; goto ErrorExit; } @@ -3248,6 +3255,7 @@ Return Value: bool FileLinkFound; bool JunctionFound; void* Mapping; + void* MapResult; void* PointerResult; bool RelativeLinkFound; int Result; @@ -3261,7 +3269,7 @@ Return Value: DirFd = -1; Fd = -1; - Mapping = NULL; + Mapping = MAP_FAILED; LxtCheckNullErrno(Dir = opendir(DRVFS_REPARSE_PREFIX)); errno = 0; AbsoluteLinkFound = false; @@ -3460,11 +3468,18 @@ Return Value: // is what execve uses. // - LxtCheckNullErrno(Mapping = mmap(NULL, 2, PROT_READ, MAP_SHARED, Fd, 0)); - LxtCheckMemoryEqual(Mapping, "MZ", 2); + if (g_LxtFsInfo.FsType != LxtFsTypeVirtioFs) + { + LxtCheckMapErrno(Mapping = mmap(NULL, 2, PROT_READ, MAP_SHARED, Fd, 0)); + LxtCheckMemoryEqual(Mapping, "MZ", 2); + } + else + { + LxtLogInfo("TODO: debug virtiofs handling of app exec links"); + } ErrorExit: - if (Mapping != NULL) + if (Mapping != MAP_FAILED) { munmap(Mapping, 2); } diff --git a/test/linux/unit_tests/lxtfs.c b/test/linux/unit_tests/lxtfs.c index ee5fd47..041e484 100644 --- a/test/linux/unit_tests/lxtfs.c +++ b/test/linux/unit_tests/lxtfs.c @@ -3350,7 +3350,6 @@ Return Value: FullExpectedTime = (Expected->tv_sec * FS_NS_PER_SEC) + Expected->tv_nsec; if ((FullTime <= FullExpectedTime) && (FullTime >= (FullExpectedTime - (AllowedVarianceSeconds * FS_NS_PER_SEC)))) { - return true; } @@ -3359,9 +3358,9 @@ Return Value: // the host and guest. // - if ((g_LxtFsInfo.FsType == LxtFsTypePlan9) && (FullTime <= (FullExpectedTime + (AllowedVarianceSeconds * FS_NS_PER_SEC)))) + if (((g_LxtFsInfo.FsType == LxtFsTypePlan9) || (g_LxtFsInfo.FsType == LxtFsTypeVirtioFs)) && + (FullTime <= (FullExpectedTime + (AllowedVarianceSeconds * FS_NS_PER_SEC)))) { - return true; } diff --git a/test/linux/unit_tests/unittests.c b/test/linux/unit_tests/unittests.c index e52357d..c2e0970 100644 --- a/test/linux/unit_tests/unittests.c +++ b/test/linux/unit_tests/unittests.c @@ -103,11 +103,11 @@ int main(int Argc, char* Argv[], char** Envp) if (LXT_SUCCESS(Result)) { - LxtLogPassed("%s", false, LxtTests[Itr].Name); + LxtLogPassed("%s", LxtTests[Itr].Name); } else { - LxtLogError("%s", false, LxtTests[Itr].Name); + LxtLogError("%s", LxtTests[Itr].Name); } goto ErrorExit; diff --git a/test/windows/Common.cpp b/test/windows/Common.cpp index 1614d30..23b29c8 100644 --- a/test/windows/Common.cpp +++ b/test/windows/Common.cpp @@ -1928,7 +1928,8 @@ Return Value: } LaunchArguments += CommandLine; - LogInfo("Test process exited with: %lu", LxsstuLaunchWsl(LaunchArguments.c_str())); + DWORD ExitCode = LxsstuLaunchWsl(LaunchArguments.c_str()); + LogInfo("Test process exited with: %lu", ExitCode); // // Parse the contents of the linux log(s) files and relog. @@ -1938,9 +1939,11 @@ Return Value: { THROW_IF_NTSTATUS_FAILED(LxsstuParseLinuxLogFiles(LogFileName, &TestPassed)); - THROW_HR_IF(E_FAIL, !TestPassed); + VERIFY_IS_TRUE(TestPassed); } + VERIFY_ARE_EQUAL(0, ExitCode); + return; } diff --git a/test/windows/DrvFsTests.cpp b/test/windows/DrvFsTests.cpp index 792714c..5ba9789 100644 --- a/test/windows/DrvFsTests.cpp +++ b/test/windows/DrvFsTests.cpp @@ -135,12 +135,6 @@ public: Logfile << TestMode; VERIFY_NO_THROW(LxsstuRunTest(Command.str().c_str(), Logfile.str().c_str())); - if (DrvFsMode.has_value() && DrvFsMode.value() == DrvFsMode::VirtioFs) - { - LogSkipped("TODO: debug test for virtiofs"); - return; - } - // // Check that the read-only attribute has been changed. // @@ -173,8 +167,15 @@ public: VERIFY_NO_THROW(VerifyDrvFsSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\ntlink7", L"ntlink2", true)); VERIFY_NO_THROW(VerifyDrvFsSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\ntlink8", L"foo\uf03abar", false)); - VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink1")); - VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink2")); + if (DrvFsMode.has_value() && DrvFsMode.value() == DrvFsMode::VirtioFs) + { + LogInfo("TODO: debug VerifyDrvFsLxSymlink variations on virtiofs"); + } + else + { + VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink1")); + VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink2")); + } // Since target resolution is done on the Windows side in Plan 9, it is able to create an NT // link if the target path traverses an existing NT link (this is actually better than WSL 1). @@ -228,10 +229,16 @@ public: VERIFY_NO_THROW(DrvFsCommon(LX_DRVFS_DISABLE_NONE, Mode)); } - void DrvFsFat() const + void DrvFsFat(DrvFsMode Mode) { SKIP_TEST_ARM64(); + if (Mode == DrvFsMode::VirtioFs) + { + LogSkipped("VirtioFS currently only supports mounting full drives"); + return; + } + constexpr auto MountPoint = "C:\\lxss_fat"; constexpr auto VhdPath = "C:\\lxss_fat.vhdx"; auto Cleanup = wil::scope_exit([MountPoint, VhdPath] { DeleteVolume(MountPoint, VhdPath); }); @@ -241,10 +248,16 @@ public: LxsstuRunTest((L"bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 3'").c_str(), L"drvfs3")); } - void DrvFsSmb() const + void DrvFsSmb(DrvFsMode Mode) { SKIP_TEST_ARM64(); + if (Mode == DrvFsMode::VirtioFs) + { + LogSkipped("TODO: debug virtiofs handling of //localhost/C$ style paths"); + return; + } + VERIFY_NO_THROW( LxsstuRunTest((L"bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 4'").c_str(), L"drvfs4")); } @@ -312,20 +325,20 @@ public: { SKIP_TEST_ARM64(); - if (Mode == DrvFsMode::VirtioFs) - { - LogSkipped("TODO: debug test for virtiofs"); - return; - } - VERIFY_NO_THROW(LxsstuRunTest(L"/data/test/wsl_unit_tests xattr drvfs", L"xattr_drvfs")); } - void DrvFsReFs() const + void DrvFsReFs(DrvFsMode Mode) { SKIP_TEST_ARM64(); WSL_TEST_VERSION_REQUIRED(wsl::windows::common::helpers::WindowsBuildNumbers::Germanium); + if (Mode == DrvFsMode::VirtioFs) + { + LogSkipped("VirtioFS currently only supports mounting full drives"); + return; + } + constexpr auto MountPoint = "C:\\lxss_refs"; constexpr auto VhdPath = "C:\\lxss_refs.vhdx"; auto Cleanup = wil::scope_exit([MountPoint, VhdPath] { DeleteVolume(MountPoint, VhdPath); }); @@ -1072,13 +1085,13 @@ class WSL1 : public DrvFsTests TEST_METHOD(DrvFsFat) { WSL1_TEST_ONLY(); - DrvFsTests::DrvFsFat(); + DrvFsTests::DrvFsFat(DrvFsMode::WSL1); } TEST_METHOD(DrvFsSmb) { WSL1_TEST_ONLY(); - DrvFsTests::DrvFsSmb(); + DrvFsTests::DrvFsSmb(DrvFsMode::WSL1); } TEST_METHOD(DrvFsMetadata) @@ -1108,8 +1121,8 @@ class WSL1 : public DrvFsTests else \ { \ VERIFY_ARE_EQUAL(LxsstuInitialize(FALSE), TRUE); \ - VERIFY_ARE_EQUAL(LxsstuLaunchWsl(LXSST_TESTS_INSTALL_COMMAND_LINE), 0); \ m_config.reset(new WslConfigChange(LxssGenerateTestConfig({.drvFsMode = DrvFsMode::##_mode##}))); \ + VERIFY_ARE_EQUAL(LxsstuLaunchWsl(LXSST_TESTS_INSTALL_COMMAND_LINE), 0); \ } \ \ return true; \ @@ -1147,13 +1160,13 @@ class WSL1 : public DrvFsTests TEST_METHOD(DrvFsFat) \ { \ WSL2_TEST_ONLY(); \ - DrvFsTests::DrvFsFat(); \ + DrvFsTests::DrvFsFat(DrvFsMode::##_mode##); \ } \ \ TEST_METHOD(DrvFsSmb) \ { \ WSL2_TEST_ONLY(); \ - DrvFsTests::DrvFsSmb(); \ + DrvFsTests::DrvFsSmb(DrvFsMode::##_mode##); \ } \ \ TEST_METHOD(DrvFsMetadata) \ @@ -1195,7 +1208,7 @@ class WSL1 : public DrvFsTests TEST_METHOD(DrvFsReFs) \ { \ WSL2_TEST_ONLY(); \ - DrvFsTests::DrvFsReFs(); \ + DrvFsTests::DrvFsReFs(DrvFsMode::##_mode##); \ } \ }