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

   
Specifications
  • Filter.Driver.FileSystem.MiniFilter
  • Filter.Driver.AntiVirus.MiniFilter
  • Filter.Driver.FileSystem.Functionality
Platforms
  • Windows 10, client editions (x86)
  • Windows 10, client editions (x64)
  • Windows Server 2016 (x64)
  • Windows 10, mobile edition (Arm)
Supported Releases
  • Windows 10
  • Windows 10, version 1511
  • Windows 10, version 1607
  • Windows 10, version 1703
  • Windows 10, version 1709
  • Windows 10, version 1803
  • Windows 10, version 1809
  • Windows 10, version 1903
  • Next update to Windows 10
Expected run time (in minutes) 180
Category Development
Timeout (in minutes) 10800
Requires reboot false
Requires special configuration false
Type automatic

 

Additional documentation

Tests in this feature area might have additional documentation, including prerequisites, setup, and troubleshooting information, that can be found in the following topic(s):

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 generic troubleshooting of HLK test failures, see Troubleshooting Windows HLK Test Failures.

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 Lab Kit (Windows HLK) 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\

 

Parameters

Parameter name Parameter description
NTFS_DRIVE_LETTER The drive letter for the NTFS volume that the Syscache test will run on.
CNTFS_DRIVE_LETTER The drive letter for the Compressed NTFS volume that the Syscache test will run on.
FAT_DRIVE_LETTER The drive letter for the FAT volume that the Syscache test will run on.
FAT32_DRIVE_LETTER The drive letter for the FAT volume that the Syscache test will run on.
EXFAT_DRIVE_LETTER The drive letter for the ExFat volume that the Syscache test will run on.
UDF_DRIVE_LETTER The drive letter for the UDF volume that the Syscache test will run on.
LLU_LclAdminUser LLU for execute
LLU_NetAccessOnly LLU for copy
REFS_DRIVE_LETTER The drive letter for the ReFS volume that the test will run on. Enter NONE if not >= Win8 Server.