-
Notifications
You must be signed in to change notification settings - Fork 212
Run RDP Client Test Suite on Multiple Platforms
- Contents
- Test Environment Architecture
- Set Up System Under Test
- Set Up Driver Computer to Run Test Suite
- Appendix
The Test Environment consists of a Driver Computer (RDP Server) and a SUT Computer (RDP Client).
Take a Windows 10 Enterprise SUT (computer name eg. RDPCli-SUT01) as an example:
-
Check the minimum requirement of an SUT Computer by this link
-
Disable Firewall on the RDPCli-SUT01
-
Follow this link to start an
RDP SUT Control Agent
-
Check the minimum requirement of a Driver Computer by this link
-
Then, verify Network Computer Connectivity by this link
-
Follow this link to install
.NET 6.0SDK -
Install dependent packages:
-
Linux :
sudo apt-get install -y libgdiplus
-
There are 2 ways to get RDP Client test suite binaries:
-
Download RDP-TestSuite-ClientEP.tar.gz or RDP-TestSuite-ClientEP.zip from
GitHub -
Build binaries from source code
-
Clone source code from
GitHubby the following commandgit clone https://github.com/microsoft/WindowsProtocolTestSuites.git -
Follow this section to update
.ptfconfigfiles underWindowsProtocolTestSuites/TestSuites/RDP/Client/src/TestSuitefolder -
Build test suite with the script under
WindowsProtocolTestSuites/TestSuites/RDP/Client/srcPowerShell:
.\build.ps1
Linux Shell:
sudo chmod +x ./*.sh sudo ./build.sh -
After the build succeeds, you can get the binaries under
WindowsProtocolTestSuites/drop/TestSuites/RDP/Client
-
-
Download ProtocolTestManager.msi and run it to install
PTM -
Follow Using Protocol Test Manager to use the Protocol Test Manager to run test suite
-
Follow this section to update
.ptfconfigfiles underRDP-TestSuite-ClientEP/Binfolder -
Run test case under
/home/IOLab/RDP-TestSuite-ClientEP/Binwith the following commanddotnet test RDP_ClientTestSuite.dll --logger:"trx;LogFileName=RDP_ClientTestSuite.trx" --filter "FullyQualifiedName~BVT_ConnectionTest" -
If you want to list the test cases before running them actually, you can add
-tin the command. For example, you can run below command if you want to list test cases with test categoryBVTdotnet test RDP_ClientTestSuite.dll --logger:"trx;LogFileName=RDP_ClientTestSuite.trx" --filter "TestCategory=BVT" -tFor more information about
dotnet test, you can refer to this link.
-
Complete the steps in Run test suite by dotnet test
-
You can run all test cases under
RDP-TestSuite-ClientEP/Batchfolder by the following commandsPowerShell:
.\RunAllTestCases.ps1
Linux Shell:
sudo chmod +x ./*.sh sudo ./RunAllTestCases.sh -
You can also select part of the test cases to run. For example, you can run below command under
RDP-TestSuite-ClientEP/Batchif you want to run test cases with test categoryBVTand FullyQualifiedName containingBVT_ConnectionTestPowerShell:
.\RunTestCasesByFilter.ps1 -Filter "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest"
Linux Shell:
sudo chmod +x ./*.sh sudo ./RunTestCasesByFilter.sh "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest"
-
You can list the test cases before running them actually. For example, you can run below command if you want to list test cases with test category
BVTPowerShell:
.\RunTestCasesByFilter.ps1 -Filter "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest" -DryRun "list"
Linux Shell:
sudo chmod +x ./*.sh sudo ./RunTestCasesByFilter.sh "TestCategory=BVT" "list"
The batch scripts use the same filter expressions with
dotnet test. For more information about how to construct the filter expression, you can refer to this link.
-
Download PTMCli.tar.gz or PTMCli.zip, then extract it to local driver
-
Follow Export Test Profile and Modify Test Profile to get your
.ptmconfiguration file and copy it underPTMClipath named astest.ptm -
Assume
RDP-TestSuite-ClientEPis extracted atC:\RDP-TestSuite-ClientEP, run test suite underPTMClifolder by the following commanddotnet PTMCli.dll -p ./test.ptm -t C:\RDP-TestSuite-ClientEPYou can add
-sin the command to only run your selected test casesdotnet PTMCli.dll -p ./test.ptm -t C:\RDP-TestSuite-ClientEP -sFor more details about how to run test cases by PTMCli, please refer to this link.
-
Install the Docker Engine
-
Pull the rdpclient docker image to the Driver
docker pull mcr.microsoft.com/windowsprotocoltestsuites:rdpclient -
Download rdpclient-docker-ptfconfig.tar.gz or rdpclient-docker-ptfconfig.zip, then extract it to local driver
-
Follow this section to update
.ptfconfigfiles under/home/IOLab/rdpclient-docker-ptfconfigfolder -
Assume the IP address of Driver is
192.168.142.6and the RDP listening port is3389, run test suite by the following commandWindows:
sudo docker run \ --hostname 192.168.142.6 \ -p 3389:3389 \ -v C:\rdpclient-docker-ptfconfig:/data/rdpclient \ -e Filter="'TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest'" \ -e DryRun="" \ -i mcr.microsoft.com/windowsprotocoltestsuites:rdpclient
Linux:
sudo docker run \ --hostname 192.168.142.6 \ --network host \ -v /home/IOLab/rdpclient-docker-ptfconfig:/data/rdpclient \ -e Filter="'TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest'" \ -e DryRun="" \ -i mcr.microsoft.com/windowsprotocoltestsuites:rdpclient
For more details about how to run test cases by docker, please refer to this link.
There are two .ptfconfig files for RDP Client test suite.
RDP_ClientTestSuite.deployment.ptfconfig
Update the following property values according to your environment. If you run test cases by docker, keep the value of CertificatePath as /opt/rdpclient/TestData/RDPServer.pfx. Set the IP address of the Driver as the value of RDP.ServerDomain.
<Property name="RDP.ServerPort" value="3389">
<Property name="CertificatePath" value="C:\RDPServer.pfx">
<Property name="SUTName" value="192.168.142.72">
<Property name="SUTUserName" value="administrator">
<Property name="SUTUserPassword" value="Password01!">
<Property name="RDP.ServerDomain" value="192.168.142.71">RDP_ClientTestSuite.ptfconfig
Update SUTControl.AgentAddress to your SUT IP address. If you are using a managed agent like C#, you should change the Adapter property to xsi:type="managed".
<Property name="SUTControl.AgentAddress" value="192.168.0.1:4488;192.168.0.1:4489" >
<Adapter xsi:type="powershell" name="IRdpSutControlAdapter" scriptdir =".\SUTControlAdapter" />
<!--<Adapter xsi:type="interactive" name="IRdpSutControlAdapter" />-->
<!--<Adapter xsi:type="managed" name="IRdpSutControlAdapter" adaptertype="Microsoft.Protocols.TestSuites.Rdp.ProtocolBasedRdpSUTControlAdapter"/>-->