# Contents - [Contents](#contents) - [Test Environment Architecture](#test-environment-architecture) - [Set Up System Under Test](#set-up-system-under-test) - [Set Up Driver Computer to Run Test Suite](#set-up-driver-computer-to-run-test-suite) - [Prerequisite](#prerequisite) - [Get RDP Client test suite binaries](#get-rdp-client-test-suite-binaries) - [Run test suite](#run-test-suite) - [Run test suite by `PTM` on Windows](#run-test-suite-by-ptm-on-windows) - [Run test suite by `dotnet test`](#run-test-suite-by-dotnet-test) - [Run test suite by script](#run-test-suite-by-script) - [Run test suite by `PTMCli`](#run-test-suite-by-ptmcli) - [Run test suite by `docker`](#run-test-suite-by-docker) - [Appendix](#appendix) - [Update .pftconfig files](#update-pftconfig-files) # 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](https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/RDP/Client/docs/RDP_ClientUserGuide.md#system-under-test) - Disable Firewall on the RDPCli-SUT01 - Follow this [link](https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/RDP/RDPSUTControlAgent/README.md) 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](https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/RDP/Client/docs/RDP_ClientUserGuide.md#driver-computer) - Then, verify Network Computer Connectivity by this [link](https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/RDP/Client/docs/RDP_ClientUserGuide.md#verify-connectivity-from-the-driver-computer) - Follow this [link](https://dotnet.microsoft.com/download/dotnet/6.0) 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](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/RDP-TestSuite-ClientEP.tar.gz) or [RDP-TestSuite-ClientEP.zip](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/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](#Update-.pftconfig-files) 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:** ```powershell .\build.ps1 ``` **Linux Shell:** ```bash 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](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/ptm@4.21.9.0/ProtocolTestManager.msi) and run it to install `PTM` 2. Follow [Using Protocol Test Manager](https://github.com/microsoft/WindowsProtocolTestSuites/blob/main/TestSuites/RDP/Client/docs/RDP_ClientUserGuide.md#using-protocol-test-manager) to use the Protocol Test Manager to run test suite ### Run test suite by `dotnet test` 1. Follow this [section](#Update-.pftconfig-files) 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](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test). ### Run test suite by script 1. Complete the steps in [Run test suite by dotnet test](#Run-test-suite-by-`dotnet-test`) 2. You can run all test cases under `RDP-TestSuite-ClientEP/Batch` folder by the following commands **PowerShell:** ```powershell .\RunAllTestCases.ps1 ``` **Linux Shell:** ```bash 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:** ```powershell .\RunTestCasesByFilter.ps1 -Filter "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest" ``` **Linux Shell:** ```bash 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:** ```powershell .\RunTestCasesByFilter.ps1 -Filter "TestCategory=BVT&FullyQualifiedName~BVT_ConnectionTest" -DryRun "list" ``` **Linux Shell:** ```bash 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](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test). ### Run test suite by `PTMCli` 1. Download [PTMCli.tar.gz](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.9.0/PTMCli.tar.gz) or [PTMCli.zip](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.9.0/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](https://github.com/microsoft/WindowsProtocolTestSuites/wiki/PTMCli). ### Run test suite by `docker` 1. Install the Docker Engine [Install the Docker Engine on Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows) [Install the Docker Engine on Linux](https://docs.docker.com/engine/install/ubuntu/) 2. Pull the rdpclient docker image to the Driver ```docker pull mcr.microsoft.com/windowsprotocoltestsuites:rdpclient``` 3. Download [rdpclient-docker-ptfconfig.tar.gz](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/rdpclient-docker-ptfconfig.tar.gz) or [rdpclient-docker-ptfconfig.zip](https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/rdpclient-docker-ptfconfig.zip), then extract it to local driver 4. Follow this [section](#Update-.pftconfig-files) 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:** ```batch 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:** ```bash 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](https://github.com/microsoft/WindowsProtocolTestSuites/wiki/How-to-Run-Test-Suites-with-Docker). # 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`. ```xml ``` > 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"`. ```xml ```