Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pipelines/test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ parameters:
default:
- wsl1
- wsl2
- wsla

- name: test_images
type: object
Expand Down
11 changes: 11 additions & 0 deletions cloudtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ function(add_test_group image version)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup.xml.in ${DIR}/TestGroup.xml)
endfunction()

function(add_wsla_test_group image)
set(version "a")
set(DIR ${OUT}/${image}-wsla)

file(MAKE_DIRECTORY ${DIR})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestMap.xml.in ${DIR}/TestMap.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup-wsla.xml.in ${DIR}/TestGroup.xml)
endfunction()

foreach(image ${CLOUDTEST_IMAGES})
add_test_group("${image}" "1")
add_test_group("${image}" "2")
add_wsla_test_group("${image}")
endforeach()
27 changes: 27 additions & 0 deletions cloudtest/TestGroup-wsla.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<TestJobGroup EnableProcessJobObjectBreakaway="true">
<ResourceSpec>
<Resource SKU="Standard_D4_v3" Image="${image}"/>
</ResourceSpec>
<Setup TimeoutMins="30">
<BuildFiles>
<Copy Src="[drop]\bundle\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle" Dest="[WorkingDirectory]" IsRecursive="false"/>
<Copy Src="[drop]\testbin\${TARGET_PLATFORM}\release\*" Dest="[WorkingDirectory]\" IsRecursive="true" Writable="true"/>
<Copy Src="[drop]\testbin\${TARGET_PLATFORM}\test_distro.tar.xz" Dest="[WorkingDirectory]" IsRecursive="false" Writable="true"/>
<Copy Src="[drop]\testbin\${TARGET_PLATFORM}\test_data\*" Dest="[WorkingDirectory]\test_data" IsRecursive="true" Writable="true"/>
<Copy Src="[drop]\testbin\test-setup.ps1" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\CloudTest-Setup.bat" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\wsl.wprp" Dest="[WorkingDirectory]\" IsRecursive="false" />
<Copy Src="[drop]\testbin\unit_tests\*" Dest="[WorkingDirectory]\unit_tests" IsRecursive="true" Writable="true"/>
<Copy Src="[test_packages]\*" Dest="[WorkingDirectory]" IsRecursive="false" />
<Copy Src="[dump_tool]\DumpTool.exe" Dest="[WorkingDirectory]" IsRecursive="false" />
</BuildFiles>
<Scripts>
<Script Path="[WorkingDirectory]\CloudTest-Setup.bat" Args="[WorkingDirectory] [LoggingDirectory]" />
</Scripts>
</Setup>

<TestJob Name="CloudTest.Taef" TimeoutMins="120">
<Execution Type="TAEF" Path="[WorkingDirectory]\wsltests.dll" Args="/p:bugReportDirectory=[LoggingDirectory]\BugReportOutput /errorOnCrash /testmode:etwlogger /EtwLogger:WPRProfileFile=[WorkingDirectory]\wsl.wprp /EtwLogger:WPRProfile=WSL /EtwLogger:SavePoint=ExecutionComplete /EtwLogger:RecordingScope=Execution /p:SetupScript=.\test-setup.ps1 /p:Package=[WorkingDirectory]\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle /p:Version=2 /p:AllowUnsigned=${ALLOW_UNSIGNED_PACKAGE} /p:UnitTestsPath=[WorkingDirectory]\unit_tests /p:DistroPath=[WorkingDirectory]\test_distro.tar.xz /p:TestDataPath=[WorkingDirectory]\test_data /p:DistroName=test_distro /logOutput:High /p:RedirectStdout=[LoggingDirectory]\stdout.txt /p:RedirectStderr=[LoggingDirectory]\stderr.txt /p:KernelLogs=[LoggingDirectory]\dmesg.txt /p:DumpFolder=[LoggingDirectory] /p:WerReport /p:LogDmesg /p:PipelineBuildId=${PIPELINE_BUILD_ID} /p:DumpTool=DumpTool.exe /select:&quot;@TestCategory='WSLA'&quot;" />
</TestJob>
</TestJobGroup>
2 changes: 1 addition & 1 deletion cloudtest/TestGroup.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
</Setup>

<TestJob Name="CloudTest.Taef" TimeoutMins="240">
<Execution Type="TAEF" Path="[WorkingDirectory]\wsltests.dll" Args="/p:bugReportDirectory=[LoggingDirectory]\BugReportOutput /errorOnCrash /testmode:etwlogger /EtwLogger:WPRProfileFile=[WorkingDirectory]\wsl.wprp /EtwLogger:WPRProfile=WSL /EtwLogger:SavePoint=ExecutionComplete /EtwLogger:RecordingScope=Execution /p:SetupScript=.\test-setup.ps1 /p:Package=[WorkingDirectory]\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle /p:Version=${version} /p:AllowUnsigned=${ALLOW_UNSIGNED_PACKAGE} /p:UnitTestsPath=[WorkingDirectory]\unit_tests /p:DistroPath=[WorkingDirectory]\test_distro.tar.xz /p:TestDataPath=[WorkingDirectory]\test_data /p:DistroName=test_distro /logOutput:High /p:RedirectStdout=[LoggingDirectory]\stdout.txt /p:RedirectStderr=[LoggingDirectory]\stderr.txt /p:KernelLogs=[LoggingDirectory]\dmesg.txt /p:DumpFolder=[LoggingDirectory] /p:WerReport /p:LogDmesg /p:PipelineBuildId=${PIPELINE_BUILD_ID} /p:DumpTool=DumpTool.exe" />
<Execution Type="TAEF" Path="[WorkingDirectory]\wsltests.dll" Args="/p:bugReportDirectory=[LoggingDirectory]\BugReportOutput /errorOnCrash /testmode:etwlogger /EtwLogger:WPRProfileFile=[WorkingDirectory]\wsl.wprp /EtwLogger:WPRProfile=WSL /EtwLogger:SavePoint=ExecutionComplete /EtwLogger:RecordingScope=Execution /p:SetupScript=.\test-setup.ps1 /p:Package=[WorkingDirectory]\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle /p:Version=${version} /p:AllowUnsigned=${ALLOW_UNSIGNED_PACKAGE} /p:UnitTestsPath=[WorkingDirectory]\unit_tests /p:DistroPath=[WorkingDirectory]\test_distro.tar.xz /p:TestDataPath=[WorkingDirectory]\test_data /p:DistroName=test_distro /logOutput:High /p:RedirectStdout=[LoggingDirectory]\stdout.txt /p:RedirectStderr=[LoggingDirectory]\stderr.txt /p:KernelLogs=[LoggingDirectory]\dmesg.txt /p:DumpFolder=[LoggingDirectory] /p:WerReport /p:LogDmesg /p:PipelineBuildId=${PIPELINE_BUILD_ID} /p:DumpTool=DumpTool.exe /select:&quot;not(@TestCategory='WSLA')&quot;" />
</TestJob>
</TestJobGroup>
2 changes: 1 addition & 1 deletion test/windows/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,7 @@ class ReadHandleWithTargetValue : public wsl::windows::common::relay::ReadHandle
NON_MOVABLE(ReadHandleWithTargetValue);

ReadHandleWithTargetValue(wsl::windows::common::relay::HandleWrapper&& MovedHandle, std::string_view targetValue) :
ReadHandle(std::move(MovedHandle), [&](const auto& buffer) { m_readBuffer.append(buffer.data(), buffer.size()); }),
ReadHandle(std::move(MovedHandle), [this](const auto& buffer) { m_readBuffer.append(buffer.data(), buffer.size()); }),
m_targetValue(targetValue)
{
}
Expand Down
35 changes: 22 additions & 13 deletions test/windows/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,30 @@ using namespace std::chrono_literals;
return; \
}

#define WSL_TEST_CLASS_PROPERTIES \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"LxssManager.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"LxssManagerProxyStub.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslclient.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslservice.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"WslServiceProxyStub.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslhost.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslrelay.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslconfig.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wsl.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslg.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"msrdc.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"msal.wsl.proxy.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslasession.exe")

#define WSL_TEST_CLASS(_name) \
BEGIN_TEST_CLASS(_name) \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"LxssManager.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"LxssManagerProxyStub.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslclient.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslservice.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"WslServiceProxyStub.dll") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslhost.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslrelay.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslconfig.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wsl.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslg.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"msrdc.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"msal.wsl.proxy.exe") \
TEST_CLASS_PROPERTY(L"BinaryUnderTest", L"wslasession.exe") \
WSL_TEST_CLASS_PROPERTIES \
END_TEST_CLASS()

#define WSLA_TEST_CLASS(_name) \
BEGIN_TEST_CLASS(_name) \
WSL_TEST_CLASS_PROPERTIES \
TEST_CLASS_PROPERTY(L"TestCategory", L"WSLA") \
END_TEST_CLASS()

//
Expand Down
5 changes: 3 additions & 2 deletions test/windows/WSLATests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ extern bool g_fastTestRun;

class WSLATests
{
WSL_TEST_CLASS(WSLATests)
WSLA_TEST_CLASS(WSLATests)

wil::unique_couninitialize_call m_coinit = wil::CoInitializeEx();
wil::unique_mta_usage_cookie m_mtaCookie;
WSADATA m_wsadata;
std::filesystem::path m_storagePath;
WSLASessionSettings m_defaultSessionSettings{};
Expand All @@ -58,6 +58,7 @@ class WSLATests

TEST_CLASS_SETUP(TestClassSetup)
{
THROW_IF_FAILED(CoIncrementMTAUsage(&m_mtaCookie));
THROW_IF_WIN32_ERROR(WSAStartup(MAKEWORD(2, 2), &m_wsadata));

// The WSLC SDK tests use this same storage to reduce pull overhead.
Expand Down
5 changes: 3 additions & 2 deletions test/windows/WslcSdkTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ ProcessOutput RunContainerAndCapture(

class WslcSdkTests
{
WSL_TEST_CLASS(WslcSdkTests)
WSLA_TEST_CLASS(WslcSdkTests)

wil::unique_couninitialize_call m_coinit = wil::CoInitializeEx();
wil::unique_mta_usage_cookie m_mtaCookie;
WSADATA m_wsadata;
std::filesystem::path m_storagePath;
WslcSession m_defaultSession = nullptr;
Expand All @@ -179,6 +179,7 @@ class WslcSdkTests

TEST_CLASS_SETUP(TestClassSetup)
{
THROW_IF_FAILED(CoIncrementMTAUsage(&m_mtaCookie));
THROW_IF_WIN32_ERROR(WSAStartup(MAKEWORD(2, 2), &m_wsadata));

// Use the same storage path as WSLA runtime tests to reduce pull overhead.
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/WSLCCLIArgumentUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using namespace WEX::TestExecution;
namespace WSLCCLIArgumentUnitTests {
class WSLCCLIArgumentUnitTests
{
WSL_TEST_CLASS(WSLCCLIArgumentUnitTests)
WSLA_TEST_CLASS(WSLCCLIArgumentUnitTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/WSLCCLICommandUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace WEX::TestExecution;
namespace WSLCCLICommandUnitTests {
class WSLCCLICommandUnitTests
{
WSL_TEST_CLASS(WSLCCLICommandUnitTests)
WSLA_TEST_CLASS(WSLCCLICommandUnitTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/WSLCCLIExecutionUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct CommandLineTestCase

class WSLCCLIExecutionUnitTests
{
WSL_TEST_CLASS(WSLCCLIExecutionUnitTests)
WSLA_TEST_CLASS(WSLCCLIExecutionUnitTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/WSLCCLIParserUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace WSLCCLIParserUnitTests {

class WSLCCLIParserUnitTests
{
WSL_TEST_CLASS(WSLCCLIParserUnitTests)
WSLA_TEST_CLASS(WSLCCLIParserUnitTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace WSLCE2ETests {

class WSLCE2EContainerCreateTests
{
WSL_TEST_CLASS(WSLCE2EContainerCreateTests)
WSLA_TEST_CLASS(WSLCE2EContainerCreateTests)

TEST_CLASS_SETUP(ClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EContainerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace WSLCE2ETests {

class WSLCE2EContainerTests
{
WSL_TEST_CLASS(WSLCE2EContainerTests)
WSLA_TEST_CLASS(WSLCE2EContainerTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EGlobalTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace WSLCE2ETests {

class WSLCE2EGlobalTests
{
WSL_TEST_CLASS(WSLCE2EGlobalTests)
WSLA_TEST_CLASS(WSLCE2EGlobalTests)

TEST_CLASS_SETUP(TestClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EImageBuildTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace WSLCE2ETests {

class WSLCE2EImageBuildTests
{
WSL_TEST_CLASS(WSLCE2EImageBuildTests)
WSLA_TEST_CLASS(WSLCE2EImageBuildTests)

TEST_CLASS_SETUP(ClassSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EImageDeleteTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace WSLCE2ETests {

class WSLCE2EImageDeleteTests
{
WSL_TEST_CLASS(WSLCE2EImageDeleteTests)
WSLA_TEST_CLASS(WSLCE2EImageDeleteTests)

TEST_METHOD_SETUP(MethodSetup)
{
Expand Down
2 changes: 1 addition & 1 deletion test/windows/wslc/e2e/WSLCE2EImageInspectTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace WSLCE2ETests {

class WSLCE2EImageInspectTests
{
WSL_TEST_CLASS(WSLCE2EImageInspectTests)
WSLA_TEST_CLASS(WSLCE2EImageInspectTests)

TEST_CLASS_SETUP(ClassSetup)
{
Expand Down
Loading