Windows Protocol Test Suites –What’s New · •Added new test scenario and test cases per...
Transcript of Windows Protocol Test Suites –What’s New · •Added new test scenario and test cases per...
Windows Protocol Test Suites – What’s New
• Windows Protocol Test Suites Development Team
• Huiren JIANG
• Yan ZENG
Agenda
• Overview
• Updates
• Demo
• Test Environment
• Q&A
Overview
Windows Protocol Test Suites - Overview
Motivation
Originally developed for testing
Microsoft Open Specifications.
Test/verify Windows behavior.
Test 3rd-party implementations for
interoperability.
Merit
Ensure quality of Microsoft Open
Specifications including accuracy
and usability.
Help to identify your
implementation issues by test
scenarios and logging.
Source code and ProtoSDK can be
your reference in development
phase.
http://aka.ms/wpts
Windows Protocol Test Suites - Test Methodology
2. Develop protocol test suite (synthetic
client) according to open specification.
3. Run against Windows server to verify
open specification.
4. Run against 3rd party’s server to verify
interoperability and identify issues.
1. Open Specification defines messages,
sequence, behavior.
Windows
Server
Windows
Client
Test Suites
Synthetic Client
3rd Party’s
Server
Message Over the Wire
4
53
1
Open Specification
2
*FileServer Test Suites As an Example
Interoperability between
3rd party’s server and
Windows client
Windows Protocol Test Suites - Architecture
System Under Test
(SUT)
FileServer
implementation
FileServer Synthetic Client
(Test Suites)
Network
SUT Control
Adapter
1. PowerShell
2. Interactive
3. Managed
4. Shell
Test Cases
*FileServer Test Suite As an Example
ProtoSDKProtocol Test Framework
Test Adapters
Protocol Test Framework
• PTF Adapter
• PTF Config
• Logging
• ……
Protocol Test Framework, Protocol Test Manager
Visual Studio Unit Test
Framework
Protocol Test Framework
FileServer
Test Suite
ADFamily
Test Suite……
Protocol Test Manager
• Auto-detection
• Configure
• Filter test cases
• Run testing
Example Test Case
Protocol Specification:
If SMB2 client sends message A to SMB2 server, SMB2 server should respond with message B.
If message A is invalid, server should return error message C.
Test Case 1:
1. Establish connection;
2. Client.Send(msgA);
3. Expect server respond with msgB,
and
• Assert (msgB.Field1 ==
valid1)
• Assert (msgB.Field2 ==
valid2)
• …
• Assert (msgB.FieldN ==
validN)
Test Case 2:
1. Establish connection;
2. Client.Send(invalid msgA);
3. Expect server respond with msgC,
and
• Assert (msgC.Status ==
ERROR)
Category Test Suite Name Protocols
File Sharing
File ServerMS-SMB2, MS-FSRVP, MS-SWN, MS-DFSC, MS-RSVD, MS-SQOS, MS-FSA, MS-
HVRS
MS-SMB MS-SMB
MS-SMBD MS-SMBD
BranchCache MS-PCCRC, MS-PCCRR, MS-PCCRTP, MS-PCHC, MS-CCROD
SecurityKerberos MS-KILE, MS-KKDCP, MS-PAC
MS-AZOD MS-AZOD
Active DirectoryADFamily
MS-ADTS-LDAP, MS-ADTS-PublishDC, MS-ADTS-Schema, MS-ADTS-Security,
MS-APDS, MS-DRSR, MS-FRS2, MS-LSAD, MS-LSAT, MS-NRPC, MS-SAMR
MS-ADOD MS-ADOD
Remote Desktop RDP (Client & Server)MS-RDPBCGR, MS-RDPEDISP, MS-RDPEDYC, MS-RDPEGFX, MS-RDPEGT, MS-
RDPEI, MS-RDPEMT, MS-RDPEUDP, MS-RDPEUSB, MS-RDPEVOR, MS-RDPRFX
BYOD MS-ADFSPIP MS-ADFSPIP
Windows Protocol Test Suites - Scope
Run Test Suites
• Configure Test Suite❑Modify .ptfconfig manually
❑Run auto-detection in PTM
• Run Test Suite
• Analysis Result❑.trx
❑HTML report
Protocol Test Manager
VS2017 Test Explorer
Batch Files
Updates
Windows Protocol Test Suites Updates
Windows Protocol Test Suites v3.19.6.0 Release
https://github.com/microsoft/WindowsProtocolTestSuites/releases/tag/3.19.6.0
•Support Windows Server v1903
•Added new test scenario and test cases per [MS-SMB2] v20190430
•Added new test scenario and test cases per [MS-FSCC] v20180912
•Other new test cases and improvement
File Server Test Suites
•Support shell adapter
•For File Server plugin, support added for detecting Windows Server v1903 and compression capabilities
Protocol Test Manager
•Support shell scripts as test adapter for non-Windows SUT
•Solution to trigger testing remotely from non-Windows platform
Common
Updates to File Server Test Suites
• SMB2 Remoted Identity
• SMB2 Compression
• FSCC Updates
Remoted Identity
• InfraSOFS(Infrastructure Scale-Out File System)
❑ Access share using an alternative identity instead of session one
• TREE_CONNECT Request Context
❑ SMB2_REMOTED_IDENTITY_TREE_CONNECT_CONTEXT_ID 0x0001
❑ Serialize the access token of alternative identity
• New test cases added
• For details, please refer to [MS-SMB2] v20190430
❑ 2.2.9.2.1 SMB2_REMOTED_IDENTITY_TREE_CONNECT Context
❑ 3.2.4.2.4 Connecting to the Share
❑ 3.3.5.7 Receiving an SMB2 TREE_CONNECT Request
Remoted Identity
TreeMgmt_SMB311_TREE_CONNECT_EXTENSION_PRESENT
Test Driver SUT
SUT will access InfraSOFSshare using the identity
provided in TREE_CONNECT request context
Test driver will check whether SUT sets SMB2_SHAREFLAG_IDENTITY_REMOTING
in TREE_CONNECT response
Test driver will check whether CREATE succeeds
SMB2 Compression - Capability Negotiation
• New NEGOTIATE context
❑ SMB2_COMPRESSION_CAPABILITIES 0x0003
• Supported compression algorithm
❑ [MS-XCA]: Xpress Compression Algorithm
• 5 test cases added
❑ 1 BVT
❑ 4 negative test cases
• For details, please refer to [MS-SMB2] v20190430
❑ 2.2.3.1.3 SMB2_COMPRESSION_CAPABILITIES
❑ 3.3.5.4 Receiving an SMB2 NEGOTIATE Request
SMB2 Compression - Capability Negotiation
BVT_Negotiate_SMB311_CompressionEnabled
Test Driver SUT
For Windows implementation, “is the first
common supported compression algorithm
“SUT supported compression algorithms” is configured in
SupportedCompressionAlgorithms of CommonTestSuite.deployment.ptfconfig
SMB2 Compression - Capability Negotiation
Negotiate_SMB311_Compression_InvalidSmbDialect
Test Driver SUT
When negotiated SMB dialect is less than 3.1.1, SMB2 compression capability MUST
be ignored by SUT
SMB2 Compression – Message Processing
• New SMB2 COMPRESSION_TRANSFORM_HEADER
❑ ProtocolId => 0x424D53FC
❑ On-wire message: (Encrypted(Compressed(Original)))
• On-demand compression for READ response
❑ Request can be compressed when compression shrinks message size
❑ Response can be compressed when request is compressed
❑ On-demand compression for READ response
• New test cases added
❑ BVT(3 compression algorithms, encryption enabled/disabled)
❑ Positive test cases(different read/write scenarios)
❑ Negative test cases
• For details, please refer to [MS-SMB2] v20190430
❑ 2.2.42 SMB2 COMPRESSION_TRANSFORM_HEADER
❑ 3.1.4.4 Compressing the Message
❑ 3.3.4.1.5 Compressing the Message
❑ 3.3.5.2.13 Decompressing the message
SMB2 Compression – Message Processing
BVT_SMB2Compression_LZ77
Test Driver SUT
If compression/decompression and message processing of SUT is correct, data
read out should be the same as written.
SUT should handle WRITE request compressed by LZ77
FSCC Updates
• 1 New Information Class
❑ FileIdInformation
• 3 IOCTL codes alignment
❑ FSCTL_QUERY_FILE_REGIONS
❑ FSCTL_GET_NTFS_VOLUME_DATA
❑ FSCTL_GET_REFS_VOLUME_DATA
• 8 test cases added
• For details, please refer to [MS-FSCC] v20180912 with errata
❑ 2.4.43 FileIdInformation
❑ 2.3.41 FSCTL_QUERY_FILE_REGIONS Request
❑ 2.3.42 FSCTL_QUERY_FILE_REGIONS Reply
❑ 2.3.17 FSCTL_GET_NTFS_VOLUME_DATA Request
❑ 2.3.18 FSCTL_GET_NTFS_VOLUME_DATA Reply
❑ 2.3.19 FSCTL_GET_REFS_VOLUME_DATA Request
❑ 2.3.20 FSCTL_GET_REFS_VOLUME_DATA Reply
FSCC UpdatesFileIdInformation
Test Driver SUT
SMB2 QueryInfo Request FileInfoClass : FileIdInformation
FSCTL_READ_FILE_USN_DATA Request
FSCTL_READ_FILE_USN_DATA Response
USN_RECORD_V3 returned
NTFS_VOLUME_DATA_BUFFER.VolumeSerialNumber ==
FileIdInformation.VolumeSerialNumber?
FSCTL_GET_NTFS_VOLUME_DATA Request
FSCTL_GET_NTFS_VOLUME_DATA Response
NTFS_VOLUME_DATA_BUFFER returned
USN_RECORD_V3 .FileReferenceNumber
== FileIdInformation.FileId?
SMB2 QUERY_INFO Response
Set up SMB2 connection
FSCC UpdatesFSCTL_QUERY_FILE_REGIONS
Test Driver SUT
FSCTL_QUERY_FILE_REGIONS Request
Test case will verify fields of
FSCTL_QUERY_FILE_REGIONS Response
Create a new test file
Set up SMB2 connection
FSCC UpdatesFSCTL_GET_NTFS_VOLUME_DATA/FSCTL_GET_REFS_VOLUME_DATA
Test Driver SUT
FSCTL_GET_NTFS_VOLUME_DATA/
FSCTL_GET_REFS_VOLUME_DATA RequestFileIdInformation
.VolumeSerialNumber ==
NTFS_VOLUME_DATA_BUFFER.
VolumeSerialNumber?FSCTL_GET_NTFS_VOLUME_DATA/
FSCTL_GET_REFS_VOLUME_DATA Response
Query FileIdInformation
Query FileFsFullSizeInformation
FileFsFullSizeInformation. TotalAllocationUnits ==
NTFS_VOLUME_DATA_BUFFER. TotalClusters?
FileFsFullSizeInformation. BytesPerSector ==
NTFS_VOLUME_DATA_BUFFER. BytesPerSector?
Set up SMB2 connection
Demo
Test Environment
Test Network Topology
Test Suites Provided
• File Server
• AD Family
On Premise
Domain Controller
Azure
SUT (Windows) Driver (Windows)
SUT (Windows) Driver (Windows)
Driver (Windows)Driver (Windows)
SUT (Linux) SUT (Linux) SUT (Linux)
SUT (Windows) SUT (Windows)
Subnet Gateway DNS Domain Name Domain Credential OS
10.10.0.0/22 10.10.0.1 10.10.0.253 DEVDAYS-16.org Administrator/Password01!
Windows 10 v1903Windows 2019
v1903
Test Environment
Open Source Community Meetup
• GitHub & Open Source
• Linux integration
❑Shell adapter
❑Solution to run testing remotely
Test Suite
First-hand TrialTime: 6/25 Tue 3:30 PM
Location: Bld 83 1040
Questions?
Yan ZENGMengyan LU Huiren JIANGJiajun WANG
Thank you.