Using The Windows Using The Windows Device Testing Device Testing Framework To Framework To Simplify Windows Simplify Windows Driver Testing Driver Testing Travis Martin, Lead Travis Martin, Lead Developer Developer Adam Shapiro, Program Adam Shapiro, Program Manager Manager Windows Device Experience Windows Device Experience Microsoft Corporation Microsoft Corporation
27
Embed
Using The Windows Device Testing Framework To Simplify Windows Driver Testing Travis Martin, Lead Developer Adam Shapiro, Program Manager Windows Device.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Using The Windows Using The Windows Device Testing Device Testing Framework To Simplify Framework To Simplify Windows Driver TestingWindows Driver Testing
Travis Martin, Lead DeveloperTravis Martin, Lead DeveloperAdam Shapiro, Program ManagerAdam Shapiro, Program ManagerWindows Device Experience Windows Device Experience Microsoft CorporationMicrosoft Corporation
Session OutlineSession Outline
Overview and framework goalsOverview and framework goals
Core WDTF conceptsCore WDTF concepts
WDTF-based scenariosWDTF-based scenariosDemoDemo
Extending the frameworkExtending the frameworkDemoDemo
What Is The Windows Device What Is The Windows Device Testing Framework? (WDTF)Testing Framework? (WDTF)
A set of building blocks that enable A set of building blocks that enable developers to build device centric developers to build device centric automated scenariosautomated scenarios
A set of easily customized test scenarios A set of easily customized test scenarios built using the frameworkbuilt using the framework
WDTF ReuseWDTF Reuse
Common Scenario Stress with IO Test (WDK)USB HID Test
Test PnP, Power Management, WMI, and Test PnP, Power Management, WMI, and Security features in your driver/deviceSecurity features in your driver/device
Compatible with the WDK’s Driver Test Compatible with the WDK’s Driver Test Manager (DTM)Manager (DTM)
Creating ScenariosCreating Scenarios
Write scenarios using any language Write scenarios using any language (JScript, VBScript, .NET languages, …)(JScript, VBScript, .NET languages, …)
Optionally wrap the scenario with DTMOptionally wrap the scenario with DTM
ExampleExampleScenarioScenario
// Instantiate WDTF
var WDTF = new ActiveXObject(“WDTF.WDTF”);
// Get collection of all video devices
var Devices = WDTF.DeviceDepot.Query(“class=Net”);
// Loop over each device in the collection
for (int x = 1; x <= Devices.Count; x++)
{
// Find the DeviceManagement action for devices
var DevMan = Devices.Item(x).GetInterface(“Action\\DeviceManagement\\Device”);
DevMan.Disable(); // Disable device
WScript.Sleep(10000); // wait 10 seconds
DevMan.Enable(); // Enable the device
}
Devices As TargetsDevices As Targets
A target object represents a single device A target object represents a single device or systemor system
Collections of TargetsCollections of TargetsA collection of zero or more target instancesA collection of zero or more target instances
Find each target by iterating through Find each target by iterating through a collectiona collection
A scenario can have several A scenario can have several target collectionstarget collections
WDTF ExampleWDTF Example
SimpleIO
Stress
Sleep Stress Script
(PMTE Replacement)
WDTF
Core
Target Device(s) or System
SimpleION
et
Au
dio
Dis
k
Vid
eo
…
Co
nso
le
Dev
Man
…
DTM IntegrationDTM Integration
DTM Jobs WTTLogger
Schedules Uses
Reporting
SimpleIO
Stress
Sleep Stress Script
(PMTE Replacement)
WDTF
Core
Target Device(s) or System
SimpleION
et
Au
dio
Dis
k
Vid
eo
…
Co
nso
le
Dev
Man
…
Instantiating WDTFInstantiating WDTF
The IWDTF interface is the starting pointThe IWDTF interface is the starting point
JScript example: Creating a WDTF objectJScript example: Creating a WDTF objectvar WDTF = new ActiveXObject(“WDTF.WDTF”);var WDTF = new ActiveXObject(“WDTF.WDTF”);
WDTF.SystemDepot propertyWDTF.SystemDepot propertyProvides a target that represents the system as a wholeProvides a target that represents the system as a whole
var System = WDTF.SystemDepot.ThisSystem;var System = WDTF.SystemDepot.ThisSystem;
WDTF.DeviceDepot propertyWDTF.DeviceDepot propertyRepresents a collection of all the devices on the systemRepresents a collection of all the devices on the system
Provides a target that represents the root deviceProvides a target that represents the root devicevar RootDevice = WDTF.DeviceDepot.RootDevice;var RootDevice = WDTF.DeviceDepot.RootDevice;
Query for any subset of those devicesQuery for any subset of those devices
Finding Your TargetFinding Your Target
Select a subset of targets from any collectionSelect a subset of targets from any collection(e.g.,: DeviceDepot)(e.g.,: DeviceDepot)
var Devices = DeviceDepot.Query(“Volume::FreeSize>10000000”);var Devices = DeviceDepot.Query(“Volume::FreeSize>10000000”);
Query criteriaQuery criteriaSystem configuration data – hardware and softwareSystem configuration data – hardware and software
This data is collected by WDTFThis data is collected by WDTF
Data can be technology type specific (disk, volume…)Data can be technology type specific (disk, volume…)
Action\SimpleIOAction\SimpleIOSmall, re-usable components that test one particular area of Small, re-usable components that test one particular area of functionality for a targetfunctionality for a target
Open, exercise, and close a deviceOpen, exercise, and close a device
Framework provides a set of device specific SimpleIO Framework provides a set of device specific SimpleIO (Audio, Network, Volumes, Optical Media, and Video)(Audio, Network, Volumes, Optical Media, and Video)
Framework finds and loads the correct implementation Framework finds and loads the correct implementation for a targetfor a target
Action\SimpleIOAction\SimpleIOSimple synchronous I/O verification for a targetSimple synchronous I/O verification for a target
MTest\SimpleIOMTest\SimpleIOImplemented by WDTF as an asynchronous layer Implemented by WDTF as an asynchronous layer over Action\SimpleIOover Action\SimpleIO
Planned for V2Planned for V2WMIWMI
IOCTLIOCTL
Running A Running A WDTF-Based ScenarioWDTF-Based Scenario
Travis MartinTravis MartinSDESDEWindows Device Experience GroupWindows Device Experience Group
Create new implementations of Actions for Create new implementations of Actions for new device types new device types
We provide guidelines, interfaces, base We provide guidelines, interfaces, base classes, and a Visual Studio wizard in classes, and a Visual Studio wizard in the WDKthe WDK
Create new Action or MTest interfaces to Create new Action or MTest interfaces to expose additional device functionalityexpose additional device functionality
Implement A New Implement A New SimpleIO ActionSimpleIO Action
Travis MartinTravis MartinSDESDEWindows Device Experience GroupWindows Device Experience Group
Call To ActionCall To Action
Attend the WDTF “Hands-On” LabAttend the WDTF “Hands-On” Lab
Run the WDTF-based scenarios in the Run the WDTF-based scenarios in the WDK kitsWDK kits
Create new WDTF-based scenariosCreate new WDTF-based scenarios
Create SimpleIO Actions for your devicesCreate SimpleIO Actions for your devices
Optionally, create new Actions Optionally, create new Actions and MTestsand MTests
Use your new Actions and MTests in Use your new Actions and MTests in your scenariosyour scenarios
Additional ResourcesAdditional Resources
DocumentationDocumentation““Other Tools” section of the WDK DocsOther Tools” section of the WDK Docs
Related SessionsRelated SessionsDEV010DEV010 Best Practices for Testing Best Practices for Testing Windows DriversWindows Drivers
DEV098DEV098 Using the Device Using the Device Simulation FrameworkSimulation Framework
E-mail questions toE-mail questions to WDTFSupp @ microsoft.comWDTFSupp @ microsoft.com
it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.