CD.DVD-ROM Block Driver Test (Compact 7)
3/12/2014
Learn how to test CD/DVD-ROM driver functionality in your application for Windows Embedded Compact 7.
Introduction
The CD/DVD-ROM Block Driver Test verifies the functionality of CD/DVD-ROM drivers and the integrity of data read from a CD-ROM or DVD. This test reads raw data from any CD or DVD and compares it to data in an image file located on your development computer. The CD/DVD-ROM Block Driver Test also assesses functionality of the CD/DVD ROM drive; for example, whether the drive correctly loads and ejects media.
Test Prerequisites
The following table shows the hardware requirements for the CD/DVD-ROM Block Driver Test.
Requirement | Description |
---|---|
CD/DVD-ROM drive |
A CD-ROM drive or CD/DVD-ROM drive. The drive can be connected via ATA or USB. |
CD/DVD image located on the development computer |
A complete image of the CD or DVD media used for testing. The image is stored on the development computer in a file named Cdsector.dat. To create Cdsector.dat for media in the CD-ROM drive or CD/DVD-ROM drive, run test case 6101. |
The following table shows the software requirements for the CD/DVD-ROM File System Driver Test.
Requirement | Description |
---|---|
Tux.exe |
Test harness |
Kato.dll |
Logging engine |
cdromtest.dll |
Library containing the test cases |
Subtests
The table below lists the subtests included in this test.
SubTest ID | Description |
---|---|
6001 |
Device ready check Tests the functionality of IOCTL_CDROM_TEST_UNIT_READY. This test case fails if the DeviceIoControl function call returns FALSE. Failure also occurs when the DeviceIoControl function call does not set the bUnitReady flag to TRUE in the CDROM_TESTUNITREADY structure. This test case fails if there is no media in the drive. |
6002 |
Query CD-ROM Disk information Tests the functionality of IOCTL_CDROM_DISC_INFO. This test case fails if the DeviceIoControl function call returns FALSE. Failure occurs if there is no CD or DVD in the drive. |
6003 |
Perform 1 Sector Reads Reads each sector from the media, one sector at a time, and compares the contents of each sector to the contents of the image file in the release directory. For information about specifying the location of the image file by using the /image command line parameter, see Command Line Parameters for the CD/DVD-ROM Block Driver Test. This test case fails if it is unable to read any sector from the media in the drive, when the drive reads fewer bytes than were requested, and when there is a discrepancy between the data on the media and the data in the image file. |
6004 |
Perform 32 Sector Reads Reads each sector from the media, 32 sectors at a time, and compares the contents of the sectors to the contents of the image file in the release directory. For information about specifying the location of the image file by using the /image command line parameter, see Command Line Parameters for the CD/DVD-ROM Block Driver Test. This test case fails when it is unable to read any sector from the media in the drive, when the drive reads fewer bytes than were requested, and when there is a discrepancy between the data on the media and the data in the image file. |
6005 |
Perform 128 Sector Reads Reads each sector from the media, 128 sectors at a time, and compares the contents of the sectors to the contents of the image file in the release directory. For information about specifying the location of the image file by using the /image command line parameter, see Command Line Parameters for the CD/DVD-ROM Block Driver Test. This test case fails when it is unable to read any sector from the media in the drive, when the drive reads fewer bytes than were requested, and when there is a discrepancy between the data on the media and the data in the image file. |
6006 |
Test increasing read request sizes Performs multiple-sector reads. The number of sectors included in each read starts at one and increases with each read until the number reaches the maximum number of sectors that can be read, as specified by the /maxsectors command line parameter. The data that is read is compared to the data in the specified image file. For information about specifying the location of the image file by using the /image command line parameter, see Command Line Parameters for the CD/DVD-ROM Block Driver Test. This test case fails if the test is unable to allocate a large enough buffer to store the data being read. Such a failure does not indicate a problem and can be solved by setting a smaller maximum number of sectors using the /maxsectors parameter. |
6007 |
Perform Multi-SG Reads Tests the ability of the block driver to support reads with multiple scatter-gather (SG) buffers. This test reads data from the disk using a single SG buffer, and then reads the same data in multiple SG buffers. The test verifies that the data read is the same in both cases. This test case fails if the device does not support multiple SG buffer reads. |
6008 |
Test various buffer allocation types Tests the ability of the drive to read data into the following types of buffers:
This test case might fail if the drive does not appropriately support reading into an unaligned buffer. |
6009 |
Read CD-ROM table of contents Verifies that the driver supports IOCTL_CDROM_READ_TOC. If the values in the table of contents seem incorrect, the test case generates a warning, but does not fail. The test writes table of contents information to the test log. Microsoft recommends that you manually verify the log. This test case might fail if the driver does not support IOCTL_CDROM_READ_TOC or if there is no media in the drive. |
6011 |
Issue an ATAPI device info inquiry Tests the functionality of IOCTL_CDROM_ISSUE_INQUIRY, passing an INQUIRY_DATA structure as the output parameter. This test case fails if the DeviceIoControl function call returns FALSE for IOCTL_CDROM_ISSUE_INQUIRY |
6012 |
Verify media eject and load functionality Tests the functionality of IOCTL_CDROM_LOAD_MEDIA and IOCTL_CDROM_UNLOAD MEDIA. The test case first attempts to eject the media, and then follows with an IOCTL_CDROM_TEST_UNIT_READY to verify that the media is not present. The test case then loads the media and follows with a second IOCTL_CDROM_TEST_UNIT_READY to verify that the media is loaded. This test case fails if any of the DeviceIoControl function calls return FALSE, if the unit appears to be ready after ejecting the media, or if the unit is not ready after reloading the media. |
6101 |
Make image of CD media Creates an image of the media that is loaded in the drive and saves the file containing the image in the release directory on the development computer. For information about specifying the location of the image file by using the /image command line parameter, see Command Line Parameters for the CD/DVD-ROM Block Driver Test. This test executes until it fails or until 328220 sectors are read. If the /dvd parameter is specified, a maximum number of 3725375 sectors are read. This test case is skipped if the test cannot access the release directory. |
Setting Up the Test
There must be an audio CD in the CD or DVD drive.
Running the Test
The CD/DVD-ROM Block Driver Test executes the "tux -o -d cdromtest" command on default execution. With the default command line, the test runs on the first enumerated CD/DVD ROM drive that matches the BLOCK_DRIVER_GUID interface and supports IOCTL_CDROM_DISC_INFO and IOCTL_CDROM_READ_TOC.
You can modify the test by editing the command line. To specify one or more of the following optional command line parameters for this test, use the -c command line parameter. The -c parameter forces Tux to pass the specified string into the test module. The following table shows the command line parameters for the CD/DVD-ROM Block Driver Test.
Command line parameter | Description |
---|---|
/disk DSKx: |
Specify the device name of the disk to be tested. If the test cannot open the disk that you specify, the test skips test cases. If you do not specify this parameter, the CD/DVD-ROM Block Driver Test probes for a CD-ROM drive or CD/DVD-ROM drive on devices DSK1-9. Specifying this parameter overrides the automatic detection process and forces the test to use the disk that you specify. |
/profile profile |
Specify a profile to filter devices for testing. If you specify a profile, the test runs on each device that responds to IOCTL_DISK_DEVICE_INFO and, in the STORAGEDEVICEINFO structure, returns a profile name matching the name that you specify. By default, the test does not filter devices by profile. |
/image filename |
Specify the name of a file that contains an image of the data on the media in the CD/DVD-ROM drive. If the image file that you want to use is in the release directory, specify \release\file_name. You can specify an .iso file or other type of CD-ROM or DVD-ROM image. Test cases 6003 through 6005 use this parameter. The contents of the image file are compared to the actual contents of the media in the drive. If you do not specify this parameter, the test attempts to open the Cdsector.dat file in the release directory. If the test cannot access the release directory on the development computer, the image file is not used. If you specify this parameter for test case 6101, the test creates an image of the media in the drive and stores the image in the release directory under the specified file name. |
/maxsectors num |
Set the maximum number of sectors that can be read from the disk in any single read request. Test cases 6003 through 6006 use this value. The default value is 64 sectors. |
/retries num |
Set the maximum number of retry attempts for a failed read operation. The default value is 5. |
/endsector num |
Specify the final sector to read. Test cases 6003 through 6006 use this value. If you do not specify this value, the test reads until failure. |
/dvd |
Specify that the media in the CD/DVD-ROM drive is a DVD rather than a CD. This parameter determines the maximum final sector that the test attempts to read. If this parameter is not set, the maximum sector read is 328220. If this parameter is set, the maximum sector read is 3725375. |
/store |
Specify that the test opens a handle to the CD/DVD-ROM drive by using the OpenStore function instead of the CreateFile function. Opening a handle by using the OpenStore function is not required to test block driver functionality, but might be useful in certain scenarios. |
/vol |
Specify that the test opens a volume handle to the CD/DVD-ROM drive; for example, use CreateFile("CDROM Drive\VOL:") instead of CreateFile("DSK1:"). Opening a volume handle is not required to test block driver functionality, but can be useful in certain scenarios. |
Verifying the Test
When the test completes running, verify that "PASS" appears in the test log for all sub-tests.
Troubleshooting the Test
Be sure that there is media in the drive and that the specified image file in the release directory on the development computer matches the contents of the media.
For additional platform specific issues, consult the CTK articles on the TechNet wiki.