File       : wsdreadme.txt
Author     : David Catlett, Microsoft Corporation
Description: Instructions on setting up and running the WinSock Direct Test Kit
Revision History: $Id: wsdreadme.txt#2 2002/09/16 12:53:50 REDMOND\\hctbld $
Date          Author      Comments
===============================================================================
02/19/2001    davidcat    Original
03/29/2001    davidcat    Updated for running individual HAPI scripts, fixed
                          some typos.
     C O N T E N T S
===============================================================================
1. Introduction
2. Setting up the tests
3. Running the tests
 3.1 Setting up for MP_Free test config
 3.2 Setting up for MP_Debug test config
 3.3 Launching the tests
 3.4 Interpreting the results
 3.4.1 View logs
 3.4.2 Debugging tips
4. Getting help
5. Known issues

1. I N T R O D U C T I O N
===============================================================================
This document will give a brief overview of the test kit, and then describe in
detail how to setup and run the WinSock Direct Test Kit. 

The test kit uses NDIS Tester Version 4.00, Beta 1 as the testing harness for 
the WinSock Direct-specific tests.

The core to the WinSock Direct tests though, is the LaunchIt.exe application.
This app launches and monitors the actual test app. With most of the apps it 
does "hang detection" where it will make sure that the log file for an app 
keeps getting updated within a certain amount of time, and if it doesn't, it 
concludes the app has "hung" and will attach ntsd.exe to the process and move 
on with testing (if you have more than one test chosen). See 3.4.2 Debugging tips
section for details on setting up symbols, etc.


2. S E T T I N G   U P   T H E   T E S T S
===============================================================================
To setup the tests from local directory or CD:
a. cd /d <root>\wsdtest
b. setup <target dir>, i.e. setup c:\wsd

To install latest patches/updates from a local directory:
a. cd /d <root>\wsdtest_patch
b. update <path to installed wsd test kit dir>, i.e. update c:\wsd

NOTE: If installing off of a share, be sure to redirect a drive letter first, 
change to that driver, cd into wsdtest or wsdtest_patch and run setup.cmd or
update.cmd from there.

Always run setup.cmd first, then update.cmd.

3. R U N N I N G   T H E   T E S T S
===============================================================================
These tests require two machines, each with at least one network card (NIC) 
along with the NDIS driver and WinSock Direct Provider that will be tested. 
The two machines' extra NIC must be on the same TCP/IP subnet as NDIS Tester
uses this as a control channel and for copying log files between the two 
machines.

For submitting logs to WHQL to apply for a logo, there are two configurations
that these test must be run on:
a. Multiprocessor Free machine (MP_Free)
b. Multiprocessor Checked machine (MP_Debug)

While these are the only sets of logs that will be submitted, we are assuming
that vendors will be running these tests on Uniprocessor machines as well.

3.1 Setting up for MP_Free config testing
===========================================
This is the 'normal' config one has when installing a free build of the OS.

To ensure you are running a free config do the following:
1.  Run the GetBuildType.cmd in <root>\wsdbin dir. It should return 
    MP_Free. 
   
    If not, do the following to restore your free binaries (and turn off 
    driver verifier if it's enabled):
        a. <root>\wsdbin\disableSFP.vbs
	    b. reboot (must have kernel debugger attached)
	    c. <root>\wsdbin\CheckedPrep <src of free binaries> /u
	    d. Do step #2
   
2.  If GetBuildType returns MP_Free, then make sure driver verifier isn't 
    running on any drivers. From a command prompt type verifier /query. It 
    should return "No drivers are currently verified." If not, do the 
    following:
        a. From a command prompt type: verifier /reset
        b. reboot

After any reboots, go through 1 & 2 again to ensure you have a free system that
is not running any drivers under driver verifier, then proceed to 3.3.

3.2 Setting up for MP_Debug config testing
===========================================
This is not a full debug/checked build of the OS. This is the base "free" 
system with a few selected Microsoft system debug binaries. You will need a 
debug/checked version of the OS on CD though in order to copy the files over.

If you are running a service pack build, you will need the debug binaries 
from the service pack as well. You may want to copy all the checked binaries 
to a single directory if the latest binaries are in separate locations.

To find out exactly what files are needed, open a command prompt and run:
    <root>\wsdbin\CheckedPrep.vbs /?

1.  Run the GetBuildType.cmd in <root>\wsdbin dir. It should return 
    MP_Debug. 
    
    If not, do the following to copy the debug binaries and turn on driver 
    verifier for required drivers:
        a. <root>\wsdbin\disableSFP.vbs
	    b. reboot (must have kernel debugger attached)
	    c. <root>\wsdbin\CheckedPrep <src of debug binaries>
	    d. reboot again
   
2.  If GetBuildType returns MP_Debug, then make sure driver verifier is running
    on all the drivers list in CheckedPrep.vbs /?, as well as any vendor drivers. 
    From a command prompt type verifier /query. It will return a list of drivers 
    that are currently being verified. If all the required drivers are not listed,
    then do step 1 over again.

After any reboots, go through 1 & 2 again to ensure you have a debug system that
is running the required drivers under driver verifier, then proceed to 3.3.

It should be noted that if your system is not in the right state, the tests will
fail. For example if you have a MP_Debug system, but driver verifier hasn't been
enabled, the tests will immediately fail.

3.3 Launching the tests
===========================================
Once the machine configuration has been correctly set up, do the following to
start NDIS Tester on each of Machine A and Machine B.
1. cd /d <root>
2. wsdstart.cmd

This sets some environment variables as well as registry settings and then
launches NDIS Tester.
3. On both machines, click on the "Tests" tab if it's not already selected.

Machine A will be our "Server" and Machine B our "Client" in NDIS Tester terms.

4. Setup Machine A:
    a. If not selected, click on the "Server" radio button
    b. In MESSAGE drop down box, choose one of the extra NICs, not the SAN adapter
    c. In the SUPPORT DEVICES list, choose "WSD over <IP Address> over SAN Adapter"
    d. Check "server.wsf" if it's not already
    e. Click "Start" button

5. Setup Machine B:
    a. If not selected, click on the "Client" radio button
    b. In TEST drop down box, choose "WSD over <IP Address> over SAN Adapter"
    c. In MESSAGE drop down box, choose one of the extra NICs, not the SAN adapter.
        NOTE: this adapter and the MESSAGE adapter on Machine A have to be on the
        same TCP/IP subnet.
    d. In the SUPPORT DEVICES list, check "MACHINEA:WSD over <IP Address> over SAN Adapter"
    NOTE: If Machine A's shared support device does not appear, then make sure
    the MESSAGE adapters are on the same subnet and make sure that you clicked
    the Start button on Machine A and there were no errors.
6. Run scripts that appear in the right pane by checking the script you want to
   run and clicking the "Start" button.

7. To rerun an individual HAPI script, read the <root>\scripts\wsd\hapi_single_readme.txt.

T I P S
* Click on "MANUAL TESTS" and you can check/uncheck specific scripts to run.
* Double-clicking on a script, will bring it up in notepad.
* CTRL+Up/Down Arrow will change the order of a selected script.


3.4 Interpreting the results
===========================================
When you click on Start, a "Test Progress" window will open giving you feedback
on what tests are running and how they are doing. 

When a test is completed you'll get a popup: "Tests completed." 

Dismiss the popup. Then you can select the test, and click on "View Log" button.

3.4.1 Viewing logs
======================
For WinSock Direct tests, if an error was reported, you will need to drill down
until you find the specific log file that contains the detailed information.

Do that by:
1. View Log file, scroll to bottom of log and click on the link
2. This opens a summary log that contains summaries of the client and server
logs collected from each machine. Failures are flagged in red with a link
to the log that contains the further information on the failures towards the
bottom of the log file. You will need to scroll down until you see a summary
section.
3. Click on links to failed logs.
4. This may contain yet another summary page of all the logs on a particular
machine. Again, you'll need to scroll down towards the bottom of the log
to see either the individual results or links to the specific log files that
failed.

In this manner you can drill down to find out exactly why the test failed.

All of these logs will be required for a submission to WHQL.

3.4.1 Debugging tips
======================
So, if you see an NTSD window, this most likely means that one of the test apps
hung and should be debugged. All the symbols for the test apps are in the 
<wsdkitroot>\wsdbin\x86 directory, so you can do:

> !sympath <wdskitroot>\wsdbin\x86;<path to vendor symbols>;<path to MS OS symbols>
> !reload
> ~0kb

...and you should get a good stack trace to start debugging.


4. G E T T I N G  H E L P
===============================================================================
mailto:santest@microsoft.com

5. K N O W N  I S S U E S
===============================================================================
None.

5.2 Future improvements already in the works
===========================================
* HAPI scripts will be broken out into individual scripts that can be run 
  and rerun from NDIS Tester
