Using The Windows Device Testing Framework To Simplify Windows Driver Testing Travis Martin, Lead Developer Adam Shapiro, Program Manager Windows Device.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training. Windows ® 7 Compatibility Installer Detection.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Using The WDK For Windows Logo And Signature Testing Craig Rowland Program Manager Windows Driver Kits Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Using the WDK for Windows Logo and Signature Testing Craig Rowland Program Manager Windows Driver Kits Microsoft Corporation.
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
SQL Server SQL Azure Visual Studio“Quadrant” SQL Server Modeling Services Entity Framework ADO.NET“M”/EDM Data Services …
announcing Dev Manager Do I understand what we’ve built? Developer Can I bet on using this shared component? Testers What’s changed since I last.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Travis Martin, Lead Developer Adam Shapiro, Program Manager Windows Device Platform Group Microsoft Corporation.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
Windows Azure SQL Data Sync Name Title Microsoft Corporation.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Developing Drivers in Visual Studio
Возможности Excel 2010, о которых следует знать
Title of Presentation 12/2/2018 3:48 PM
Customizing ADK assessment reports
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Inside the Windows 8 driver developer workflow
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Presentation transcript:

Using The Windows Device Testing Framework To Simplify Windows Driver Testing Travis Martin, Lead Developer Adam Shapiro, Program Manager Windows Device Experience Microsoft Corporation

Session Outline Overview and framework goals Core WDTF concepts WDTF-based scenarios Demo Extending the framework Demo

What Is The Windows Device Testing Framework? (WDTF) A set of building blocks that enable developers to build device centric automated scenarios A set of easily customized test scenarios built using the framework

WDTF Reuse Common Scenario Stress with IO Test (WDK) USB HID Test DMI Install/Uninstall/Upgrade/Rollback Test Simple IO Power Management Enable Disable Install Uninstall Transfer

Frameworks Improve Quality

WDTF Advantages Simplified Testing Generic Testing Test PnP, Power Management, WMI, and Security features in your driver/device Compatible with the WDK’s Driver Test Manager (DTM)

Creating Scenarios Write scenarios using any language (JScript, VBScript,.NET languages, …) Scenario writer uses WDTF to Find devices Control devices Control the system Verify functionality Log results Optionally wrap the scenario with DTM

Example Scenario // 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 Targets A target object represents a single device or system Collections of Targets A collection of zero or more target instances Find each target by iterating through a collection A scenario can have several target collections

WDTF Example SimpleIO Stress Sleep Stress Script (PMTE Replacement) WDTF Core Target Device(s) or System SimpleIO NetAudioDiskVideo … ConsoleDevMan …

DTM Integration DTM Jobs WTTLogger Schedules Uses Reporting SimpleIO Stress Sleep Stress Script (PMTE Replacement) WDTF Core Target Device(s) or System SimpleIO NetAudioDiskVideo … ConsoleDevMan …

Instantiating WDTF The IWDTF interface is the starting point JScript example: Creating a WDTF object var WDTF = new ActiveXObject(“WDTF.WDTF”); WDTF.SystemDepot property Provides a target that represents the system as a whole var System = WDTF.SystemDepot.ThisSystem; WDTF.DeviceDepot property Represents a collection of all the devices on the system Provides a target that represents the root device var RootDevice = WDTF.DeviceDepot.RootDevice; Query for any subset of those devices

Finding Your Target Select a subset of targets from any collection (e.g.,: DeviceDepot) var Devices = DeviceDepot.Query(“Volume::FreeSize> ”); Query criteria System configuration data – hardware and software This data is collected by WDTF Data can be technology type specific (disk, volume…) Reference “WDTF Developer’s Guide” in WDK documentation

// Instantiate WDTF var WDTF = new ActiveXObject(“WDTF.WDTF”); if (WDTF.DeviceDepot.RootDevice.Eval(“child/service=‘ftdisk’”); { WScript.Echo(“The Root device has a direct child who’s ” + “service name is ‘ftdisk’”); } else { WScript.Echo(“The Root device does not have any direct child with a ” + “service name of ‘ftdisk’”); } Target::Eval(…) Classifying a Target

Target::GetValue(…) Retrieving Information from Targets // Instantiate WDTF var WDTF = new ActiveXObject(“WDTF.WDTF”); var ProcArch = WDTF.SystemDepot.ThisSystem.GetValue(“ProcArch”); WScript.Echo(“We are executing on an ” + ProcArch + “ build of Windows.”);

Target::GetRelations(…) Finding Related Targets // Instantiate WDTF var WDTF = new ActiveXObject(“WDTF.WDTF”); // Start with the root device PrintAll_recursive(WDTF.DeviceDepot.RootDevice); function PrintAll_recursive(Device) { WScript.Echo(“Name: ” + Device.GetValue(“#FriendlyName”); WScript.Echo(“Class: ” + Device.GetValue(“Class”); WScript.Echo(“DeviceID: ” + Device.GetValue(“DeviceID”); WScript.Echo(“”); var Devices = Device.GetRelations(“child”); // Recurse down for each device in the collection for (int x = 1; x <= Devices.Count; x++) { PrintAll_recursive(Devices.Item(x)); }

Action Interfaces Simple control interfaces for a target Synchronous DevMan = Device.GetInterface(“Action\\DeviceManagement\\Device”); Console = WDTF.SystemDepot.ThisSystem.GetInterface(“Action\\Console”); Action\SimpleIO Small, re-usable components that test one particular area of functionality for a target Open, exercise, and close a device Framework provides a set of device specific SimpleIO (Audio, Network, Volumes, Optical Media, and Video) Framework finds and loads the correct implementation for a target

Manageable Tests (MTest) Asynchronous Action Wrapper Start, Pause, Stop, Resume, etc. Framework finds and loads the correct implementation for a target var MTest = Device.GetInterface(“MTest\\SimpleIO”);

Example Scenario // 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 }

WDTF Actions And MTests ReleasedAction\Console Power management, reboot, shutdown, logoff, etc Action\DeviceManagement Disable/Enable, Install/Uninstall, resources, driver packages Action\SimpleIO Simple synchronous I/O verification for a target MTest\SimpleIO Implemented by WDTF as an asynchronous layer over Action\SimpleIO Planned for V2 WMIIOCTL

Running A WDTF-Based Scenario Travis Martin SDE Windows Device Experience Group

Extending WDTF Modify existing scenarios Create new implementations of Actions for new device types We provide guidelines, interfaces, base classes, and a Visual Studio wizard in the WDK Create new Action or MTest interfaces to expose additional device functionality

Implement A New SimpleIO Action Travis Martin SDE Windows Device Experience Group

Call To Action Attend the WDTF “Hands-On” Lab Run the WDTF-based scenarios in the WDK kits Create new WDTF-based scenarios Create SimpleIO Actions for your devices Optionally, create new Actions and MTests Use your new Actions and MTests in your scenarios

Additional Resources Documentation “Other Tools” section of the WDK Docs Related Sessions DEV010 Best Practices for Testing Windows Drivers DEV098 Using the Device Simulation Framework questions to microsoft.com

© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, 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.