Solve test failures caused by the SKU changes (#13016)

* Debug the tests * Debug the tests * Debug the tests * Use explicit directory * Remove debug print * Remove debug print * Open handle directly * Revert "Open handle directly" This reverts commit 49ec490af67c32096942c08c92aca48469d5e790. * Open handle directly

Blue committed May 30, 2025 at 17:40 UTC 9cd3438a2f56db12d96a093d12064ca1634f9134
1 file changed +7 -2
test/windows/UnitTests.cpp
+7 -2
@@ -5487,7 +5487,7 @@ Error code: Wsl/InstallDistro/WSL_E_INVALID_JSON\r\n",
5487 VERIFY_ARE_EQUAL(std::format(L"{}\n", testDir), out);
5488
5489 std::tie(out, err) = LxsstuLaunchWslAndCaptureOutput(std::format(L"wslpath -a {}", testDir));
5490 - VERIFY_IS_TRUE(out.find(L"/mnt/c") == 0);
5490 + VERIFY_IS_TRUE(out.find(L"/mnt/") == 0);
5491 }
5492 }
5493
@@ -5590,8 +5590,13 @@ Error code: Wsl/InstallDistro/WSL_E_INVALID_JSON\r\n",
5590
5591 VERIFY_ARE_EQUAL(process.Run(), 0L);
5592
5593 + wil::unique_handle file{CreateFile(L"compressed.gz", GENERIC_READ, 0, nullptr, OPEN_EXISTING, 0, nullptr)};
5594 + VERIFY_IS_TRUE(!!file);
5595 +
5596 + wsl::windows::common::helpers::SetHandleInheritable(file.get());
5597 +
5598 // Validate that the relay didn't get stuck, and that its output is correct.
5594 - auto [expandedHash, _] = LxsstuLaunchWslAndCaptureOutput(L"cat compressed.gz | gzip -d -| md5sum -");
5599 + auto [expandedHash, _] = LxsstuLaunchWslAndCaptureOutput(L"gzip -d -| md5sum -", 0, file.get());
5600 auto [expectedHash, __] =
5601 LxsstuLaunchWslAndCaptureOutput(L"cat \"$(wslpath 'C:\\Program Files\\WSL\\wsl.exe')\" | md5sum - ");
5602