Oplocks Test

This automated test verifies the basic behavior of legacy opportunistic locks (oplocks) and enhanced oplocks. The legacy oplocks are Level2 (L2), Level1 (L1), Filter, and Batch. The enhanced oplocks are Read (R), Read-Write (RW), Read-Handle (RH), and Read-Write-Handle (RWH).

Note

   For more information about the behavior of file systems (including oplocks), see File System Behavior in the Microsoft Windows Environment.

 

The test runs variations for each of the six partitions that are described in the Running the test section.

This test has the following variations:

  • Legacy_Acquire_Release. Acquire a legacy oplock and then release it.

  • Enhanced_Acquire_Release. Acquire an enhanced oplock and then release it.

  • Enhanced_Acquire_Release_Opkey. Acquire an enhanced oplock by using an oplock key.

  • Legacy_Break_L2. Break an L2 oplock with various file operations.

  • Enhanced_Break_R. Break an R oplock with various file operations.

  • Legacy_Break_L1. Break an L1 oplock with various file operations.

  • Enhanced_Break_RW. Break an RW oplock with various file operations.

  • Enhanced_Break_RH. Break an RH oplock with various file operations.

  • Legacy_Break_Batch. Break a Batch oplock with various file operations.

  • Enhanced_Break_RWH. Break an RWH oplock with various file operations.

  • EnhancedMultipleSharedOplocks. Acquire multiple enhanced oplocks on the same file.

  • EnhancedUpgradeOplocks. Upgrade an enhanced oplock.

  • EnhancedOplockBreakAckOtherHandle. Acknowledge an enhanced oplock break on another handle that opened via the same key.

  • EnhancedOplockStealthUpgrade. Acknowledge an oplock break and request an upgrade-level oplock.

  • AtomicOplocksVariation. Atomic open (open a handle by using CreatOptions=FILE_OPEN_REQUIRING_OPLOCK).

  • AtomicOplocksNonIntrusiveVariation. Atomic open when an oplock already exists on the file.

  • BreakingRHOplocks. Conduct special operations to break an RH oplock.

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) 540
Category Development
Timeout (in minutes) 32400
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 the following 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.

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:

Note

   RunFileIO.cmd contains references to environment variables that you can change to allow for skipping of certain file systems.

 

Troubleshooting

For generic troubleshooting of HLK test failures, see Troubleshooting Windows HLK Test Failures.

For troubleshooting information, see Troubleshooting File System Testing.

All test cases return Pass or Fail. To review test case details, review the test log from Windows Hardware Lab Kit (Windows HLK) Studio.

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.

More information

Command syntax

Command option Description

runkarr %DRIVE_1% %DRIVE_2% -bvt

Requires two drive letters and the appropriate bvt parameter.

Note

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

 

File list

File Location

Enhancedoplocks.exe

<[testbinroot]>\NTTest\BASETEST\core_file_services\Shared_Tests\Regression\Oplocks\

Opkey.inf

<[testbinroot]>\NTTest\BASETEST\core_file_services\FilterManager\

Opkey.sys

<[testbinroot]>\NTTest\BASETEST\core_file_services\FilterManager\

RunOplocks.cmd

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

WrapOplocks.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 Oplocks test will run on.
CNTFS_DRIVE_LETTER The drive letter for the Compressed NTFS volume that the Oplocks test will run on.
FAT_DRIVE_LETTER The drive letter for the FAT volume that the Oplocks test will run on.
FAT32_DRIVE_LETTER The drive letter for the Fat32 volume that the Oplocks test will run on.
EXFAT_DRIVE_LETTER The drive letter for theExFat volume that the Oplocks test will run on.
UDF_DRIVE_LETTER The drive letter for the UDF volume that the Oplocks 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.