Syscache Test

This is an automated test that writes to a file and verifies that the data written is read back correctly. It can detect corruptions caused by anything in the path from firmware, drivers, file system, memory, etc. It uses standard Win32 File System and memory management APIs to read and write data from the file. The test binary is readwrit.exe.

Syscache opens a file with a certain flag/attribute and writes to the file. Each chosen flag may span several runs on the file.

A run is defined as a set of the following sequence:

  • Create/open a file.

  • Truncate the filesize to 0.

  • Write to the file.

  • Close the file.

  • Reopen the file.

  • Read the file.

  • Verify file content.

  • Close the file.

There is a set of zero and non-zero regions in the file. Zero regions are areas in the file where no data was written. Non-zero regions are areas in the file where data was written. The pattern is a DWORD of the format RRPPPPPP. The top two bytes are the run number, and the next 3 bytes are the one's complement of the offset of this DWORD in the file.

The following attributes are used for writing a file:

Write Attribute Explanation

FILE_ATTRIBUTE_NORMAL

See CreateFile() Documentation

FILE_FLAG_SEQUENTIAL_SCAN

See CreateFile() Documentation

FILE_FLAG_NO_BUFFERING

See CreateFile() Documentation

FILE_FLAG_NO_BUFFERING

See CreateFile() Documentation

FILE_FLAG_WRITE_THROUGH

See CreateFile() Documentation

FILE_ATTRIBUTE_TEMPORARY

See CreateFile() Documentation

NO_BUFFERING | WRITE_THROUGH

See CreateFile() Documentation

FILE_ATTRIBUTE_SPARSE_FILE

The file is set to sparse.

NORMAL APPEND_WRITE

Same as FILE_ATTRIBUTE_NORMAL; closes and reopening the file per write and appending the next region.

FILE_FLAG_SECTOR_CHUNKS

Same as FILE_FLAG_NO_BUFFERING, data is written one sector at a time.

FILE_MAP

Same as FILE_ATTRIBUTE_NORMAL, data is written via memory mapping.

FILE_FLAG_OVEREXTEND

Same as FILE_ATTRIBUTE_NORMAL, data is written via memory mapping.

 

The following attributes are used for reading from the file:

Read Attribute Explanation

FILE_MAP

FILE_ATTRIBUTE_NORMAL, data is read via memory mapping

NO_BUFFERING

FILE_FLAG_NO_BUFFERING

NORMAL

FILE_ATTRIBUTE_NORMAL

RANDOM_ACCESS

FILE_FLAG_RANDOM_ACCESS

SEQUENTIAL_SCAN

FILE_FLAG_SEQUENTIAL_SCAN

TEMPORARY

FILE_FLAG_TEMPORARY

WRITE_THROUGH

FILE_FLAG_WRITE_THROUGH

 

Test details

Associated requirements

Filter.Driver.AntiVirus.MiniFilter Filter.Driver.FileSystem.Functionality Filter.Driver.FileSystem.MiniFilter

See the filter hardware requirements.

Platforms

Windows 8 (x64) Windows 8 (x86) Windows Server 2012 (x64) Windows 8.1 x64 Windows 8.1 x86 Windows Server 2012 R2

Expected run time

~180 minutes

Categories

Certification

Type

Automated

 

Running the test

For more information about requirements, see File System Testing Prerequisites.

In addition, this test requires extra hard drive space for four simple 2,048-megabyte (MB) partitions and two simple 1,024-MB partitions.

Before you run the test, you must add the following partitions to the test computer.

Label File system Size Expected drive letter

NTFS

NTFS

2,048 MB

g:

CNTFS

NTFS (compressed)

2,048 MB

i:

FAT

FAT16

1,024 MB

k:

FAT32

FAT32

1,024 MB

l:

ExFAT

ExFAT

2,048 MB

m:

UDF

UDF

2,048 MB

n:

REFS

REFS

10240mb

o:

 

Troubleshooting

For troubleshooting information, see Troubleshooting File System Testing.

When the test fails, the log contains all of the information you need to analyze the failure. Look for the following information to reproduce the error:

  • The "Write Attribute". Look up the table of write attributes to find how the data was written to the file.

  • The "Read Attribute". Look up the table of read attributes to find out how the data was read back from the file.

  • The offset at which the error occurred.

  • The region of the file in which the error occurred. The test typically writes entire region using a single write (with the exception of the FILE_FLAG_SECTOR_CHUNKS option).

To run this test, make sure that the computer has NTFS, CNTFS, FAT16, FAT32, ExFAT, and UDF volumes set up. Also, make sure that the drive letter for this volume is entered in the <filesystem>_DRIVE_LETTER parameters.

This test returns Pass or Fail. To review test details, review the test log from Windows Hardware Certification Kit (Windows HCK) Studio.

More information

Command syntax

Command option Description

WrapSyscache.cmd [NTFS_DRIVE_LETTER] [CNTFS_DRIVE_LETTER] [FAT_DRIVE_LETTER] [FAT32_DRIVE_LETTER] [EXFAT_DRIVE_LETTER] [UDF_DRIVE_LETTER] [WTTRunWorkingDir]

Writes to a file and verifies that the data written is read back correctly

 

Note  

For command-line help for this test binary, type /h.

 

File list

File Location

Ntlog.dll

<[osbinroot]>\nttest\CommonTest\NtLog\

Ntlogger.ini

<[osbinroot]>\nttest\CommonTest\NtLog\

Readwrit.exe

<[testbinroot]>\nttest\BASETEST\core_file_services\cachemgr\

RunSyscache.cmd

<[testbinroot]>\nttest\BASETEST\Core_File_Services\FilterManager\TestSuite\Scripts\FileSystems\

Stresslog.dll

<[testbinroot]>\nttest\basetest\core_file_services\shared_libs\

WrapSyscache.cmd

<[testbinroot]>\nttest\BASETEST\Core_File_Services\FilterManager\TestSuite\Scripts\FileSystems\

 

 

 

Send comments about this topic to Microsoft