File System Driver Test (CF-exFAT) (Compact 2013)
3/26/2014
The File System Driver Test is designed to uncover problems with a file system driver (FSD) that uses the Microsoft Win32 application programming interface (API). You can use this test to find problems with a storage device block driver that runs under the file allocation table (FAT) FSD. You can also test a custom FSD.
Test Prerequisites
Your device must meet the following requirements before you run this test.
The following table shows the hardware requirement for the File System Driver Test.
Requirement |
Description |
---|---|
Storage device |
A storage device that is supported by the FSD and storage device block driver; for example a memory card. |
The following table shows the software requirements for the File System Driver Test.
Requirements Description
Tux.exe |
Tux Test Harness, required for executing the test |
---|---|
Kato.dll |
Kato logging engine, required for logging test data |
Fsdtst.dll |
Library containing the test |
Subtests
The table below lists the subtests included in this test.
SubTest ID |
Description |
---|---|
1001 |
Creates, writes to, verifies, and then deletes a 256-byte file. This test fails if the CreateDirectory, WriteFile, or SetFilePointer function calls fail. This test also fails if the data written to the file does not match the data read from the file. |
1002 |
Creates, copies, and then deletes a file. This test fails if the CreateDirectory, CreateFile, CopyFile, or DeleteFile function calls fail. |
1003 |
Creates, moves, and then deletes a file. This test fails if the CreateDirectory, CreateFile, MoveFile, or DeleteFile function calls fail. |
1004 |
Creates, enumerates, and deletes two files. This test fails if the CreateDirectory, CreateFile, FindFirstFile, FindNextFile, FindClose, or DeleteFile function calls fail. |
1005 |
Creates multiple files, finds the first file, and then deletes all files. This test fails if the CreateDirectory, CreateFile, FindFirstFile, FindNextFile, FindClose, or DeleteFile function calls fail. |
1006 |
Creates, gets attributes for, and then deletes a file. This test fails if the CreateDirectory, CreateFile, GetFileAttributes, or DeleteFile function calls fail. |
1007 |
Creates, gets information by handle for, and then deletes a file. This test fails if the CreateFile, GetFileInformationByHandle, or DeleteFile function calls fail. |
1008 |
Creates 32 empty files in a directory. This test fails if it cannot create 32 empty files in the directory. |
1009 |
Creates 128 empty files in a directory. This test fails if it cannot create 128 empty files in the directory. |
1010 |
Creates a file and then writes data to the file. The test then maps the file to memory and verifies that the data read from mapped memory is correct. This test fails if the storage device does not support paging on demand or if the FSD does not export a ReadFileWithSeek or WriteFileWithSeek function. This test also fails if the operation that maps the file to memory fails or if the data read from mapped memory is not the same as the data written to the file. |
5001 |
Creates, modifies, and deletes a file that is the same size as a cluster. The test performs this operation with every possible combination of attributes. This test fails if it is unable to set or retrieve the attributes of a file for any combination of attributes. |
5002 |
Creates, modifies, and deletes a file that is one byte smaller than the size of a cluster. The test performs this operation with every possible combination of attributes. This test fails if it is unable to set or retrieve the attributes of a file for any combination of attributes. |
5003 |
Creates, modifies, and deletes a file that is one byte larger than the size of a cluster. The test performs this operation with every possible combination of attributes. This test fails if it is unable to set or retrieve the attributes of a file for any combination of attributes. |
5004 |
Creates, modifies, and deletes a file that is one byte in size. The test performs this operation with every possible combination of attributes. This test fails if it is unable to set or retrieve the attributes of a file for any combination of attributes. |
5005 |
Creates, modifies, and deletes a file that is zero bytes in size. The test performs this operation with every possible combination of attributes. This test fails if it is unable to set or retrieve the attributes of a file for any combination of attributes. |
5006 |
Creates single directories with names that have a lengths varying from MAX_PATH-10 to MAX_PATH+10 characters. This test fails if a directory with a name longer than MAX_PATH characters is successfully created. The test also fails if it cannot create a directory with a name that contains MAX_PATH or fewer characters. |
5007 |
Creates nested directories with one-character names and complete paths that have lengths varying from MAX_PATH-10 to MAX_PATH+10 characters. This test fails if a directory with a path longer than MAX_PATH characters is successfully created. The test also fails if it cannot create a directory with a name that contains MAX_PATH or fewer characters. The test may fail if the FSD imposes a limit on the depth of nested directories. |
5008 |
Attempts to create a file in a directory that does not exist. This test fails if it successfully creates the file. |
5009 |
Creates subdirectories within a directory and then creates one file in each subdirectory. This test fails if it cannot create a subdirectory or file. |
5010 |
Creates files within a directory and then copies the files to a second directory. The test then moves the second directory to another directory. Finally, the test deletes the files from the original directory and deletes the files from the second directory. This test fails if it cannot copy or move files to a directory. The test also fails if the copied or moved files do not match the original files. |
5011 |
Tests the FileTimeToLocalTime, FileTimeToSystemTime, and LocalTimeToFileTime functions. This test fails if it cannot set file times properly or if it cannot convert a time to system time. |
5012 |
Fills the drive with four-byte files and then deletes every other file. This test fails if it cannot fill the drive with files, if it cannot delete a file, or if the files do not enumerate properly after every other file is deleted. |
5013 |
Fills the drive with cluster-sized files and then deletes every other file. This test fails if it cannot fill the drive with files, if it cannot delete a file, or if the files do not enumerate properly after every other file is deleted. |
5014 |
Creates files in a directory, copies the files to a different directory, copies the files back to the original directory, and then moves the directory. This test fails if it cannot copy or move files to a directory. The test also fails if the copied or moved files do not match the original files. |
5015 |
Creates files on the drive, copies the files to the object store, and then moves the files back to the drive. This test fails if it cannot copy or move files from the drive to the object store. The test also fails if the copied or moved files do not match the original files. |
5016 |
Creates files on the object store, copies the files to the drive, and then moves the files back to the object store. This test fails if it cannot copy or move files from the object store to the drive. The test also fails if the copied or moved files do not match the original files. |
5017 |
Attempts to call the CreateFile, CreateDirectory, and RemoveDirectory functions using the name of the root directory. This test fails if it successfully calls the CreateFile, CreateDirectory, or RemoveDirectory function using the name of the root directory. |
5018 |
Creates a 100-KB file, truncates 10 KB from the end of the file, and then truncates 10 KB from the beginning of the file using the SetFilePointer function. This test fails if the SetFilePointer or SetEndOfFile function calls fail. |
5019 |
Creates the maximum number of entries in the root directory. This test fails if it cannot create the maximum number of entries in the root directory. |
5020 |
Attempts to create a file that has the same name as an existing directory. This test fails if it successfully creates a file with the same name as an existing directory. |
5021 |
Attempts to create a directory that has the same name as an existing file. This test fails if it successfully creates a directory with the same name as an existing file. |
5022 |
Attempts to create more than 999 files with the same file name extension and the same first eight characters in the file name. This test fails if it creates more than 999 files or creates fewer than 999 files. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. This test will automatically be skipped on any media formatted as ExFAT or TexFAT. |
5023 |
Creates a 100-byte file on a volume that has only two clusters available. This test fails if it cannot create the 100-byte file. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. |
5024 |
Creates a directory on a volume that has only one cluster available. This test fails if it cannot create the directory. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. This test will automatically be skipped on any media formatted as TexFAT. |
5025 |
Creates a 100-byte file on a volume that has only one cluster available. This test fails if it cannot create the 100-byte file. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. This test will automatically be skipped on any media formatted as TexFAT. |
5026 |
Creates directories on a volume that has only one cluster available. This test fails if it cannot create at least one directory. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. |
5027 |
Attempts to create a directory on a volume that has no clusters available. This test fails if it successfully creates a directory. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. This test will automatically be skipped on any media formatted as TexFAT. |
5028 |
Attempts to create an empty file on a volume that has no clusters available. This test fails if it cannot create an empty file. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. |
5029 |
Attempts to create a 100-byte file on a volume that has no clusters available. This test fails if it successfully creates a 100-byte file. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. |
5030 |
Attempts to write a file using the WriteFileWithSeek function, if the function is supported by the file system, when there is only one cluster available on the drive. This test fails if the WriteFileWithSeek function writes no data to the file. If this test fails on a volume that is not a FAT volume, failure does not necessarily indicate that the implementation of the file system is faulty. |
5031 |
Writes data to and reads data from the volume using the WriteFileWithSeek and ReadFileWithSeek functions. This test fails if the data written does not match the data read. This test is skipped if the file system does not support these operations. |
5032 |
Attempts to move a directory that contains a file with an open file handle. This test fails if the directory move does not succeed or if the file handle cannot be closed after the move completes. |
Setting Up the Test
This test has no additional requirements, beyond the standard test environment setup.
You must update the Current Command Line to use the desired profile name. If profile name is unknown, then the root directory of the memory device can be specified using the "-r" option.
The memory card must also be formatted to a supported file system format - i.e. exFat, FAT, TFAT, texFat, etc.
Running the Test
You can modify the test by editing the Current Command Line.
Syntax:
tux -o -d fsdtst -c "[-p PROFILE] [-s FILESYSTEM.DLL] [-r PATH] [-c clusterbytes] [-d maxrootdirs] -q -f"
The following table shows the command line parameters for the File System Driver Test.
Command line parameter |
Description |
---|---|
-zorch |
Runs all test cases, destroying all information on the storage device. Test cases write to and read from sectors on the storage device without preserving the contents of the sectors. |
-p <profile> |
Specifies the storage profile to which to restrict testing, found in the registry under the HKEY_LOCAL_MACHINE\System\StorageManager\Profiles key. |
-s <filesystem> |
Specifies the file system to which to restrict testing. The default file system is Fatfs.dll. You only need to specify a file system when testing a new FSD. |
-r <\root> |
Specifies the root directory in which to run the test. If you provide this option, the test only runs in the specified directory and ignores the -s and -p options. This flag is useful for a file system driver that does not use storage profiles such as a network file system driver. If the name of the root directory includes spaces, surround the name of the directory with single quotation marks; for example, -r '\Storage Card'. |
-c <clusterbytes> |
Specifies the size of a cluster used by the FSD. You can use this option to specify the size of a cluster for a file system that is not a FAT file system. Specifying this option does not affect the cluster size for a FAT volume. By default, the test uses a cluster size of 4096 bytes. You can use the default value if the file system being tested does not have a cluster-like data structure. |
-d <maxrootdirs> |
Specifies the maximum number of directory entries that the test attempts to create in the root directory. Specifying this option does not affect the number of directory entries for a FAT volume. The default value is 255 directory entries. You can use the default value if the file system being tested does not limit the number of directory entries that can exist in the root directory. |
-q |
Disables quick filling of partitions. Quick filling is enabled by default and, for a test case that requires the creation of a large file to fill the partition, a large filler file is artificially created by calling the SetFilePointer and SetEndOfFile functions. If you specify this option, disabling quick filling, a large file is created by repeated calls to the WriteFile function. |
-f |
Disables automatic formatting of each mounted partition before testing. Automatic formatting is enabled by default and each mounted partition is formatted as a FAT volume before each test case runs. If you specify this option, the test does not automatically format each mounted partition. If this flag is used, it should always come at the end of the command line; otherwise, the command line will not parse correctly. |
Tux -o -d fsdtst.dll -c "-p <profile name> -zorch"
Verifying the Test
When the test completes running, verify that "PASS" appears in the test log for all sub-tests.
Troubleshooting the Test
Make sure that the profile name or root path in the command line after the -c is correct. You must update the command line with the name of the profile or root location your device is using.