private void LeaseOplockTestCaseS34VerificationChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType breakType, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.OplockLevel_Values grantedOplockType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelLeaseStateType grantedLeaseType) { this.Manager.Comment("checking step \'event Verification(NoBreak,OPLOCK_LEVEL_NONE,grantedLeaseType)\'"); try { TestManagerHelpers.AssertAreEqual <Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType)(0)), breakType, "breakType of Verification, state S40"); TestManagerHelpers.AssertAreEqual <Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.OplockLevel_Values>(this.Manager, ((Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.OplockLevel_Values)(0)), grantedOplockType, "grantedOplockType of Verification, state S40"); TestManagerHelpers.AssertBind <int>(this.Manager, this.grantedLeaseType, (System.Int32)grantedLeaseType, "grantedLeaseType of Verification, state S40"); } catch (TransactionFailedException) { this.Manager.Comment(@"This step would have covered ""[TestTag] Compatibility"", ""[TestInfo] The first client requests lease, and lease state is Lease_RH."", ""[TestInfo] Refer to the below matrix to check if lease break should exist and what the granted oplock level is."", ""[TestInfo] Note: the matrix is made based on Windows behavior"", ""[TestInfo] ================================================================================"", ""[TestInfo] 1st Client(Lease) 2nd Client(Oplock) LeaseBreakExist GrantedOplockLevel"", ""[TestInfo] ================================================================================"", ""[TestInfo] Lease_R Any Oplock No OPLOCK_LEVEL_II"", ""[TestInfo] Lease_RH Any Oplock No OPLOCK_LEVEL_NONE"", ""[TestInfo] Lease_RW Any Oplock Yes OPLOCK_LEVEL_II"", ""[TestInfo] Lease_RWH Any Oplock Yes OPLOCK_LEVEL_NONE"", ""[TestInfo] ================================================================================"""); throw; } TestManagerHelpers.AssertBind <int>(this.Manager, this.v, this.grantedLeaseType, "v == grantedLeaseType"); this.Manager.Checkpoint("\"[TestTag] Compatibility\""); this.Manager.Checkpoint("\"[TestInfo] The first client requests lease, and lease state is Lease_RH.\""); this.Manager.Checkpoint("\"[TestInfo] Refer to the below matrix to check if lease break should exist and wh" + "at the granted oplock level is.\""); this.Manager.Checkpoint("\"[TestInfo] Note: the matrix is made based on Windows behavior\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Checkpoint("\"[TestInfo] 1st Client(Lease)\t2nd Client(Oplock)\tLeaseBreakExist\tGrantedOplockLev" + "el\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Checkpoint("\"[TestInfo] Lease_R\t\tAny Oplock\t\tNo\t\tOPLOCK_LEVEL_II\""); this.Manager.Checkpoint("\"[TestInfo] Lease_RH\t\tAny Oplock\t\tNo\t\tOPLOCK_LEVEL_NONE\""); this.Manager.Checkpoint("\"[TestInfo] Lease_RW\t\tAny Oplock\t\tYes\t\tOPLOCK_LEVEL_II\""); this.Manager.Checkpoint("\"[TestInfo] Lease_RWH\t\tAny Oplock\t\tYes\t\tOPLOCK_LEVEL_NONE\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Comment("Unbinding variable \'grantedLeaseType\'"); this.grantedLeaseType.Unbind(); this.Manager.Comment("Unbinding variable \'v\'"); this.v.Unbind(); }
private void OplockLeaseTestCaseS26VerificationChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType breakType, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.OplockLevel_Values grantedOplockType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelLeaseStateType grantedLeaseType) { this.Manager.Comment("checking step \'event Verification(OplockBreak,grantedOplockType,Lease_R)\'"); try { TestManagerHelpers.AssertAreEqual <Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelBreakType)(1)), breakType, "breakType of Verification, state S32"); TestManagerHelpers.AssertBind <int>(this.Manager, this.grantedOplockType, (System.Int32)grantedOplockType, "grantedOplockType of Verification, state S32"); TestManagerHelpers.AssertAreEqual <Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelLeaseStateType>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.MixedOplockLease.ModelLeaseStateType)(1)), grantedLeaseType, "grantedLeaseType of Verification, state S32"); } catch (TransactionFailedException) { this.Manager.Comment(@"This step would have covered ""[TestTag] Compatibility"", ""[TestInfo] The first client requests oplock, and oplock level is OPLOCK_LEVEL_BATCH."", ""[TestInfo] Refer to the below matrix to check if oplock break should exist and what the granted lease state is."", ""[TestInfo] Note: the matrix is made based on Windows behavior"", ""[TestInfo] ================================================================================"", ""[TestInfo] 1st Client(Oplock) 2nd Client(Lease) OplockBreakExist GrantedLeaseState"", ""[TestInfo] ================================================================================"", ""[TestInfo] OPLOCK_LEVEL_II Any Lease No Lease_R"", ""[TestInfo] OPLOCK_LEVEL_EXCLUSIVE Any Lease Yes Lease_R"", ""[TestInfo] OPLOCK_LEVEL_BATCH Any Lease Yes Lease_R"", ""[TestInfo] ================================================================================"""); throw; } TestManagerHelpers.AssertBind <int>(this.Manager, this.v, this.grantedOplockType, "v == grantedOplockType"); this.Manager.Checkpoint("\"[TestTag] Compatibility\""); this.Manager.Checkpoint("\"[TestInfo] The first client requests oplock, and oplock level is OPLOCK_LEVEL_BA" + "TCH.\""); this.Manager.Checkpoint("\"[TestInfo] Refer to the below matrix to check if oplock break should exist and w" + "hat the granted lease state is.\""); this.Manager.Checkpoint("\"[TestInfo] Note: the matrix is made based on Windows behavior\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Checkpoint("\"[TestInfo] 1st Client(Oplock)\t\t2nd Client(Lease)\tOplockBreakExist\tGrantedLeaseSt" + "ate\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Checkpoint("\"[TestInfo] OPLOCK_LEVEL_II\t\tAny Lease\tNo\t\tLease_R\""); this.Manager.Checkpoint("\"[TestInfo] OPLOCK_LEVEL_EXCLUSIVE\tAny Lease\tYes\t\tLease_R\""); this.Manager.Checkpoint("\"[TestInfo] OPLOCK_LEVEL_BATCH\tAny Lease\tYes\t\tLease_R\""); this.Manager.Checkpoint("\"[TestInfo] =====================================================================" + "===========\""); this.Manager.Comment("Unbinding variable \'grantedOplockType\'"); this.grantedOplockType.Unbind(); this.Manager.Comment("Unbinding variable \'v\'"); this.v.Unbind(); }