Storage Block Driver ReadWrite Test for SD Card (Compact 2013)

3/26/2014

The Storage Device Block Driver Read/Write Test assesses the functionality of a mass storage block driver for a Secure Digital (SD) card. With this test, you can assess a driver that implements sector management in software, for example a driver for a removable storage device. The test assesses the ability of the device driver to handle:

* Multiple threads

* Multiple scatter/gather buffers

* Boundary limits

* Bad parameters

Test Prerequisites

Your device must meet the following requirements before you run this test.

The following tables show the hardware requirements for the Storage Device Block Driver Read/Write Test.

Requirements

Description

A storage device

A Secure Digital (SD) Card

The following tables show the software requirements for the Storage Device Block Driver Read/Write Test.

Requirements

Description

Tux.exe

Test harness, required for test execution

Kato.dll

Logging engine, required for logging test data

Rwtest.dll

Library containing the test

Subtests

The table below lists the subtests included in this test.

SubTest ID

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.

Setting Up the Test

The SD card must be connected to the Widows Embedded Compact device and be enumerated.

The removable SD card must be formatted so that it will be enumerated when plugged in. There is two ways to format the device:

The storage device can be formatted using a Windows-based desktop machine's; built-in formatting application. This assumes the use of one partition.

Running the Test

The Storage Device Block Driver Read/Write Test executes the default command line of: tux -o -d rwtest -c "-profile SDMemory -zorch". The command line syntax is as follows:

tux -o -d rwtest -c "-zorch [-disk DSKX:] [-profile <profile>] [-threads <count>] [-sectors <count>] [-writesector <sector>] [-writes <count>] [-store]"

Command Line parameter

Description

-disk DSKx:

Specifies the device name of the disk to be tested. If you do not specify this parameter, the test probes for a mass storage disk on devices "DSK1"-"DSK9". Specifying this parameter overrides the automatic detection process and forces the test to use the disk that you specify.

-profile <profile>

Specifies the storage profile and limits testing to the devices with the specified storage profile. The default storage profile is "all profiles".

-threads <count>

Specifies the number of threads that will simultaneous write data to the disk.

-sectors <count>

Specifies the number of contiguous sectors to which each thread reads and writes data.

-writesector <sector>

Specifies the fist sector on the disk that the test will begin reading and writing data. The first enumerated thread starts reading and writing at the specified sector. The second enumerated thread starts at the sector that is count number of sectors from the first sector, where count is determined from the "/sector" parameter. Each thread is designated a block of count number of contiguous sectors where the first sector is spaced count number of sectors from the first sector belonging to the previous enumerated thread.

-writes <count>

Specifies the number of times that each thread writes to its designated block of sectors.

-store

Specifies that the test opens a handle to the disk by calling the OpenStore function instead of the CreateFile function. Notice that you are not required to open a handle by using "OpenStore" in order to test block driver functionality. However, it is useful for testing a storage device that FileSys.exe loads automatically if you cannot open the storage device as a stream device. For example, you can open a handle to a flash driver for ROM by using the "OpenStore" function.

-zorch

Enables the functionality of the test. Without this parameter, the test will fail. With this parameter, the test will run and destroy all data on the storage device.

Note: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.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all sub-tests.

Troubleshooting the Test

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.

See Also

Other Resources

Storage Media - SD Card Tests