Skip to content

Run RDP Client Test Suite on Multiple Platforms

Minghao Hu edited this page Jun 13, 2022 · 4 revisions

Contents

Test Environment Architecture

The Test Environment consists of a Driver Computer (RDP Server) and a SUT Computer (RDP Client).

Set Up System Under Test

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

Set Up Driver Computer to Run Test Suite

Prerequisite

  • 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

Get RDP Client test suite binaries

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

    1. Clone source code from GitHub by the following command

      git clone https://github.com/microsoft/WindowsProtocolTestSuites.git

    2. Follow this section to update .ptfconfig files under WindowsProtocolTestSuites/TestSuites/RDP/Client/src/TestSuite folder

    3. Build test suite with the script under WindowsProtocolTestSuites/TestSuites/RDP/Client/src

      PowerShell:

      .\build.ps1

      Linux Shell:

      sudo chmod +x ./*.sh
      
      sudo ./build.sh
    4. After the build succeeds, you can get the binaries under WindowsProtocolTestSuites/drop/TestSuites/RDP/Client

Run test suite

Run test suite by PTM on Windows

  1. Download ProtocolTestManager.msi and run it to install PTM

  2. Follow Using Protocol Test Manager to use the Protocol Test Manager to run test suite

Run test suite by dotnet test

  1. Follow this section to update .ptfconfig files under RDP-TestSuite-ClientEP/Bin folder

  2. Run test case under /home/IOLab/RDP-TestSuite-ClientEP/Bin with the following command

    dotnet test RDP_ClientTestSuite.dll --logger:"trx;LogFileName=RDP_ClientTestSuite.trx" --filter "FullyQualifiedName~BVT_ConnectionTest"

  3. 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 category BVT

    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.

Run test suite by script

  1. Complete the steps in Run test suite by dotnet test

  2. You can run all test cases under RDP-TestSuite-ClientEP/Batch folder by the following commands

    PowerShell:

    .\RunAllTestCases.ps1

    Linux Shell:

    sudo chmod +x ./*.sh
    
    sudo ./RunAllTestCases.sh
  3. 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 category BVT and FullyQualifiedName containing BVT_ConnectionTest

    PowerShell:

    .\RunTestCasesByFilter.ps1 -Filter "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest"

    Linux Shell:

    sudo chmod +x ./*.sh
    
    sudo ./RunTestCasesByFilter.sh "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest"
  4. 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.

Run test suite by PTMCli

  1. Download PTMCli.tar.gz or PTMCli.zip, then extract it to local driver

  2. Follow Export Test Profile and Modify Test Profile to get your .ptm configuration file and copy it under PTMCli path named as test.ptm

  3. Assume RDP-TestSuite-ClientEP is extracted at C:\RDP-TestSuite-ClientEP, run test suite under PTMCli folder by the following command

    dotnet PTMCli.dll -p ./test.ptm -t C:\RDP-TestSuite-ClientEP

    You can add -s in the command to only run your selected test cases

    dotnet 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.

Run test suite by docker

  1. Install the Docker Engine

    Install the Docker Engine on Windows

    Install the Docker Engine on Linux

  2. Pull the rdpclient docker image to the Driver

    docker pull mcr.microsoft.com/windowsprotocoltestsuites:rdpclient

  3. Download rdpclient-docker-ptfconfig.tar.gz or rdpclient-docker-ptfconfig.zip, then extract it to local driver

  4. Follow this section to update .ptfconfig files under /home/IOLab/rdpclient-docker-ptfconfig folder

  5. Assume the IP address of Driver is 192.168.142.6 and the RDP listening port is 3389, run test suite by the following command

    Windows:

    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.

Appendix

Update .pftconfig files

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"/>-->