Storage Device Block Driver Read/Write Test Cases (Windows CE 5.0)

Send Feedback

The Storage Device Block Driver Read/Write Test executes the tux –o –d rwtest command line on default execution.

Warning   Prior to running this test, be aware that all information on the storage device is destroyed. The test writes to and reads from sectors on the storage device without preserving the contents of the sectors. It is strongly recommended that you back up data on all cards and disks that are attached to the tested device before running the test.

If you run the unmodified test, it will fail. In the results file you will see a message warning you to back up data on all cards and disks that are attached to the testing device before running the test. It then instructs you to modify the command line by right clicking on the test in the CETK tree control, choosing Edit Command Line, and adding the following switch to the command line:

-zorch

After saving this change, you can run the test successfully. You can also pass this parameter in with Tux's -c command-line parameter.

Test cases 2001-2004 assume a sector size of 512 bytes. If the device driver uses a different sector size, you must change the source code for the test to reflect the correct sector size.

Test cases 2001-2004 fill in the SG_BUF and SG_REQ structures and pass pointers to the device driver through the DeviceIoControl function. The following code example shows the syntax for these structures.

typedef struct _SG_BUF {
PUCHAR sb_buf;            // pointer to buffer
DWORD sb_len;             // length of buffer
} SG_BUF, *PSG_BUF;

typedef struct _SG_REQ {
DWORD sr_start;           // starting sector number
DWORD sr_num_sec;         // number of sectors
DWORD sr_num_sg;          // number of scatter/gather buffers
DWORD sr_status;          // request status
PFN_REQDONE sr_callback;  // request completion callback function
SG_BUF sr_sglist[1];      // first scatter/gather buffer
} SG_REQ, * PSG_REQ;

Test cases 2001-2004 may fill in additional sr_sglist entries, according to the value of sr_num_sg.

The following table shows the test cases for the Storage Device Block Driver Read/Write Test.

Test case Description
1001: Two threads, 1000 writes/thread, 1 sector/thread, starting sector: 100 Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates two threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

1002: Three threads Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates three threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

1003: Four threads Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates four threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

2001: Buffer Sizes: 512 Verifies that the block device driver can correctly handle scatter/gather buffers that are 512 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.
2002: Buffer Sizes: 512, 512 Verifies that the block device driver can correctly handle two scatter/gather buffers that are 1024 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.
2003: Buffer Sizes: 1024, 1024, 1024, 1024 Verifies that the block device driver can correctly handle four scatter/gather buffers that are 1024 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.
2004: Buffer Sizes: 65536 Verifies that the block device driver can correctly handle scatter/gather buffers that are 65536 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.
3001: R/W Sectors 0, 1 and 2 Assesses the behavior of read and write operations at boundary sectors 0, 1, and 2, where errors often occur. This test case provides a detailed description of the number and location of each DeviceIoControl function. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.
3002: R/W Around (Total Sectors / 2) Assesses the behavior of read and write operations at boundary sectors where errors often occur. This test case provides a detailed description of the number and location of each DeviceIoControl function. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

Remarks

This test library can have one or more optional command-line entries to change the behavior of the test. To specify one or more optional command-line entries to the test library, you must use the –c command-line option. This option forces Tux to pass the specified string into the test library.

See Also

Storage Device Block Driver Read/Write Test

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.