-
Notifications
You must be signed in to change notification settings - Fork 207
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.0
SDK -
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
GitHub
by the following commandgit clone https://github.com/microsoft/WindowsProtocolTestSuites.git
-
Follow this section to update
.ptfconfig
files underWindowsProtocolTestSuites/TestSuites/RDP/Client/src/TestSuite
folder -
Build test suite with the script under
WindowsProtocolTestSuites/TestSuites/RDP/Client/src
PowerShell:
.\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
.ptfconfig
files underRDP-TestSuite-ClientEP/Bin
folder -
Run test case under
/home/IOLab/RDP-TestSuite-ClientEP/Bin
with 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
-t
in the command. For example, you can run below command if you want to list test cases with test categoryBVT
dotnet test RDP_ClientTestSuite.dll --logger:"trx;LogFileName=RDP_ClientTestSuite.trx" --filter "TestCategory=BVT" -t
For 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/Batch
folder 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/Batch
if you want to run test cases with test categoryBVT
and FullyQualifiedName containingBVT_ConnectionTest
PowerShell:
.\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
BVT
PowerShell:
.\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
.ptm
configuration file and copy it underPTMCli
path named astest.ptm
-
Assume
RDP-TestSuite-ClientEP
is extracted atC:\RDP-TestSuite-ClientEP
, run test suite underPTMCli
folder by the following commanddotnet PTMCli.dll -p ./test.ptm -t C:\RDP-TestSuite-ClientEP
You can add
-s
in the command to only run your selected test casesdotnet PTMCli.dll -p ./test.ptm -t C:\RDP-TestSuite-ClientEP -s
For 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
.ptfconfig
files under/home/IOLab/rdpclient-docker-ptfconfig
folder -
Assume the IP address of Driver is
192.168.142.6
and 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"/>-->