-
Notifications
You must be signed in to change notification settings - Fork 211
Run RDP Server Test Suite on Multiple Platforms
- Contents
- Test Environment Architecture
- Test Environment Configuration
The Test Environment consists of a Driver computer (client) and SUT computers (server) in a workgroup environment.
Take a Windows SUT (computer name eg. RDPSrv-SUT01) as an example for the configuration description.
- Disable Firewall on the RDPSrv-SUT01
- Start Remote Desktop Services
Before config the Driver Computer and run test suite, please config and check the Driver Computer as below:
On Driver Computer, install the dependent software following: Windows Protocol TestSuites Prerequisite
Then install the latest released RDP Server test suite by downloading and extracting the zip file to local drive.
You can use the Protocol Test Manager to run test suite. More details about how to run test suite with PTM, please check the RDP Server User Guide
There are 3 ways to setup a Linux Driver Computer to run test suite:
- Run test suite with released binaries
- Build and run test suite from scratch
- Run test suite in Docker image
Before run test suite, .NET SDK is required to be configured properly on the Linux Driver Computer.
-
Install .NET SDK
wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y apt-transport-https sudo apt-get update sudo apt-get install -y dotnet-sdk-6.0
-
Download test suite source released binaries from GitHub to /home/iolab
wget https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/RDP-TestSuite-ServerEP.tar.gz -L -O RDPServer.tar.gz
-
Unzip test suite binaries
mkdir RDPServer tar -C /home/iolab/RDPServer -zxvf /home/iolab/RDPServer.tar.gz
-
Update the ptfconfig files
Located at the local config path at /home/iolab/RDPServer/RDP_ServerTestSuite.deployment.ptfconfig. Update the RDP.ServerName with the SUT IP (192.168.142.21 for example) . Update RDP.ClientName with the current Linux Driver Computer (192.168.142.11 for example).
<Property name="RDP.ServerName" value="192.168.142.21" /> <Property name="RDP.ClientName" value="192.168.142.11" />
-
Run test case under /home/iolab/RDPServer/Bin with the commands below for different binaries.
dotnet test RDP_ServerTestSuite.dll --logger:"trx;LogFileName=RDPServerResult.trx"
You can also clone the source code and build by yourself. Here are the steps to follow:
-
Clone source code from GitHub website to local driver, eg. /home/iolab/
sudo apt install git git clone https://github.com/microsoft/WindowsProtocolTestSuites
-
Update the ptfconfig files
Located at the local config path at /home/iolab/RDPServer/RDP_ServerTestSuite.deployment.ptfconfig. Update the RDP.ServerName with the SUT IP (192.168.142.21 for example) . Update RDP.ClientName with the current Linux Driver Computer (192.168.142.11 for example).
<Property name="RDP.ServerName" value="192.168.142.21" /> <Property name="RDP.ClientName" value="192.168.142.11" />
-
Build RDPServer test suite:
During the build, PTF will be downloaded from NuGet website side-by-side.
Build script:
cd /home/iolab/WindowsProtocolTestSuites/TestSuites/RDP/Server/src build.ps1 Release published
or
cd /home/iolab/WindowsProtocolTestSuites/TestSuites/RDP/Server/src chmod +x ./build.sh ./build.sh Release published
Note the first parameter for build script is the build environment(like Release, Debug) and the second parameter is the output folder
After the build succeeds, the common folder structure should be generated in the folder
/home/iolab/WindowsProtocolTestSuites/TestSuites/RDP/Server/src/published
- Bin: all the built binaries including ProtoSDK, adapters and test suites.
- Batch: batch files (.ps1, .sh) which can be used to launch tests.
- Scripts: scripts which can be used to configure test environment.
-
Run test suite with Batch
In the
Batch
folder under root path of the test suite, there are several scripts you can use to launch tests.-
Run all test cases
Execute
RunAllTestCases.ps1
in PowerShell, orRunAllTestCases.sh
in shell directly. -
Run test cases by filters
Execute
./RunTestCasesByFilter.ps1 -Filter [your filter expression]
in PowerShell, or./RunTestCasesByFilter.sh [your filter expression]
in shell directly.For example, you can run below command if you want to run test cases with test category
BVT
andRDPBCGR
:./RunTestCasesByFilter.sh "TestCategory=BVT&TestCategory=RDPBCGR"
For more information about how to construct the filter expression, you can refer to Filter option details.
-
Dry run
If you want to list the test cases before running them actually, you could add
-DryRun
switch to.ps1
scripts or pass a non-empty string as the last argument to.sh
scripts.For example, you can run below command if you want to list test cases with test category
BVT
andRDPBCGR
:RunTestCasesByFilter.sh "TestCategory=BVT&TestCategory=RDPBCGR" "list"
-
Refer How-to-Run-Test-Suites-with-Docker for more details
-
Install Docker
sudo apt install docker.io
-
Pull Docker image from Docker Hub
sudo docker pull mcr.microsoft.com/windowsprotocoltestsuites:rdpserver
-
Download ptfconfig file from GitHub Download the ptfconfig file from the GitHub link:
https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/rdpserver-docker-ptfconfig.tar.gz
Unzip it to the local path of Linux host machine (/data/rdpserver for example) before ahead.
wget https://github.com/microsoft/WindowsProtocolTestSuites/releases/download/4.21.1.0/rdpserver-docker-ptfconfig.tar.gz -L -O RDPServerPtfconfig.tar.gz mkdir RDPServerPtfconfig tar -C /home/iolab/RDPServerPtfconfig -zxvf /home/iolab/RDPServerPtfconfig.tar.gz
-
Update the ptfconfig files
Located at /home/iolab/RDPServer/RDP_ServerTestSuite.deployment.ptfconfig. Update the RDP.ServerName with the SUT IP (192.168.142.21 for example) . Update RDP.ClientName as the docker container VM name "RDPClient".
<Property name="RDP.ServerName" value="192.168.142.21" /> <Property name="RDP.ClientName" value="RDPClient" />
-
Run the Windows protocol test suites image for RDPServer with parameters:
docker run \ --hostname RDPServer \ --network host \ -v /path/of/ptfconfig:/data/rdpserver \ [optional]$filter \ [optional]$dryRun \ -i mcr.microsoft.com/windowsprotocoltestsuites:rdpserver \
- --hostname: Required. The host name of the running container, for example: RDPClient
- --network: Required. The network the running container will use, using host as default. While using host, please make sure that the connection between the host which the container is running and the server is valid.
- -v: Required. The /path/of/ptfconfig should include all the ptfconfig files with pre-configured, and mount this path to the fixed path /data/rdpserver in the container
- -i: Required. Keep STDIN open even if not attached.
- $filter: Optional. The expression used to filter test cases. For example, "TestCategory=BVT&TestCategory=RDPBCGR" will filter out test cases with test category BVT and RDPBCGR.
- $dryRun: Optional. If set as "y", just list all the test cases match the filter string instead of running them. If it's null or empty, the filtered test cases will be executed directly
For example, the command below will run the test cases with category RDPBCGR.
sudo docker run \ --hostname RDPClient \ --network host \ -v /home/iolab/RDPServerPtfconfig/rdpserver-docker-ptfconfig:/data/rdpserver \ -e Filter="'TestCategory=RDPBCGR'" \ -e DryRun="" \ -i mcr.microsoft.com/windowsprotocoltestsuites:rdpserver
-
Install docker desktop version on your macOS or Windows Driver Computer, for Windows platform you need switch to Linux containers
-
Pull image
docker pull mcr.microsoft.com/windowsprotocoltestsuites:rdpserver
-
Update the ptfconfig files
Located at /home/iolab/RDPServer/RDP_ServerTestSuite.deployment.ptfconfig. Update the RDP.ServerName with the SUT IP (192.168.142.21 for example) . Update RDP.ClientName as the docker container VM name "RDPClient".
<Property name="RDP.ServerName" value="192.168.142.21" /> <Property name="RDP.ClientName" value="RDPClient" />
-
Start the container by running the following command.
docker run \ --hostname RDPClient \ -p 3389:3389 \ -v C:\RDPServer\RDPServerPtfconfig\rdpserver-docker-ptfconfig:/data/rdpserver \ -e Filter="'TestCategory=RDPBCGR'" \ -e DryRun="" \ -i mcr.microsoft.com/windowsprotocoltestsuites:rdpserver
You will see output flows out to the host console, and the test result of the test cases filtered by the filter TestCategory=BVT&TestCategory=RDPBCGR will be found in your local config path when the execution is complete.
Use below command then you can execute shell on docker container VM
docker exec -it {image id} bash