Exploit databaseDownload repository ZIP
GH-88d8bc551618926a04536090300b4292
dungnm24/cve-2020-0796
Sources for CVE-2020-0796
81 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files53
dungnm24/cve-2020-0796Revision fe7aebbe1789
- ↑..Parent directory
- obj/
- AppInstanceIdTestCase.cs
- BreakReadHandleLeaseV1TestCase.cs
- BreakReadHandleLeaseV2TestCase.cs
- BreakReadLeaseV1TestCase.cs
- BreakReadLeaseV2TestCase.cs
- BreakReadWriteHandleLeaseV1TestCase.cs
- BreakReadWriteHandleLeaseV2TestCase.cs
- BreakReadWriteLeaseV1TestCase.cs
- BreakReadWriteLeaseV2TestCase.cs
- ConflictTestCase.cs
- CreateCloseTestCase.cs
- CreditMgmtTestCase.cs
- DurableHandleV1PreparedWithBatchOplockReconnectTestCase.cs
- DurableHandleV1PreparedWithLeaseV1ReconnectTestCase.cs
- DurableHandleV2PreparedWithBatchOplockReconnectTestCase.cs
- DurableHandleV2PreparedWithLeaseV1ReconnectTestCase.cs
- DurableHandleV2PreparedWithLeaseV2ReconnectTestCase.cs
- EncryptionTestCase.cs
- LeaseOplockTestCase.cs
- MS-SMB2Model_ServerTestSuite.csproj
- MS-SMB2Model_ServerTestSuite.deployment.ptfconfig
- MS-SMB2Model_ServerTestSuite.ptfconfig
- NegotiateTestCase.cs
- OplockLeaseTestCase.cs
- OplockOnShareWithForceLevel2AndSOFSTestCase.cs
- OplockOnShareWithForceLevel2WithoutSOFSTestCase.cs
- OplockOnShareWithoutForceLevel2OrSOFSTestCase.cs
- OplockOnShareWithoutForceLevel2WithSOFSTestCase.cs
- PersistentHandleReconnectTestCase.cs
- ReplayCreateDurableHandleV1TestCase.cs
- ReplayCreateDurableHandleV2PersistentTestCase.cs
- ReplayCreateDurableHandleV2TestCase.cs
- ReplayCreateNormalHandleTestCase.cs
- ReplayCreateWithoutHandleTestCase.cs
- ReplayFileOperationTestCase.cs
- RequestDurableHandleV1BatchOplockTestCase.cs
- RequestDurableHandleV1LeaseV1TestCase.cs
- RequestDurableHandleV2BatchOplockTestCase.cs
- RequestDurableHandleV2LeaseV1TestCase.cs
- RequestDurableHandleV2LeaseV2TestCase.cs
- RequestPersistentHandleTestCase.cs
- ResilientHandleBasicTestCase.cs
- ResilientHandleDurableTestCase.cs
- SMB2ModelTestAssemblyCleanup.cs
- SessionMgmtBindSessionAfterDisconnectionScenarioTestCase.cs
- SessionMgmtBindSessionAfterLogOffScenarioTestCase.cs
- SessionMgmtBindSessionScenarioTestCase.cs
- SessionMgmtNewSessionScenarioTestCase.cs
- SessionMgmtReconnectSessionScenarioTestCase.cs
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
WindowsProtocolTestSuites/TestSuites/FileServer/src/SMB2Model/TestSuite/TreeMgmtTestCase.cs
C# · 131,626 bytes// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18449
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.TestSuite {
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Microsoft.Protocols.TestTools;
using Microsoft.Protocols.TestTools.Messages.Runtime;
[Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
public partial class TreeMgmtTestCase : PtfTestClassBase {
public TreeMgmtTestCase() {
this.SetSwitch("ProceedControlTimeout", "100");
this.SetSwitch("QuiescenceTimeout", "30000");
}
#region Expect Delegates
public delegate void TreeConnectResponseDelegate1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config);
public delegate void TreeDisconnectResponseDelegate1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status);
public delegate void TreeDisconnectRequestDelegate1();
#endregion
#region Event Metadata
static System.Reflection.MethodBase TreeDisconnectRequestInfo = TestManagerHelpers.GetMethodInfo(typeof(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter), "TreeDisconnectRequest", typeof(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId));
static System.Reflection.EventInfo TreeDisconnectResponseInfo = TestManagerHelpers.GetEventInfo(typeof(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter), "TreeDisconnectResponse");
static System.Reflection.EventInfo TreeConnectResponseInfo = TestManagerHelpers.GetEventInfo(typeof(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter), "TreeConnectResponse");
#endregion
#region Adapter Instances
private Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter ITreeMgmtAdapterInstance;
#endregion
#region Variables
private IVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig> c;
private IVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig> config;
private IVariable<int> shareType;
private IVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig> v;
private IVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig> v1;
private IVariable<int> v2;
#endregion
#region Class Initialization and Cleanup
[Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()]
public static void ClassInitialize(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) {
PtfTestClassBase.Initialize(context);
}
[Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute()]
public static void ClassCleanup() {
PtfTestClassBase.Cleanup();
}
#endregion
#region Test Initialization and Cleanup
protected override void TestInitialize() {
this.InitializeTestManager();
this.ITreeMgmtAdapterInstance = ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter)(this.GetAdapter(typeof(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ITreeMgmtAdapter))));
this.ITreeMgmtAdapterInstance.TreeConnectResponse += ITreeMgmtAdapterInstance_TreeConnectResponse;
this.ITreeMgmtAdapterInstance.TreeDisconnectResponse += ITreeMgmtAdapterInstance_TreeDisconnectResponse;
this.c = this.Manager.CreateVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>("c");
this.config = this.Manager.CreateVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>("config");
this.shareType = this.Manager.CreateVariable<int>("shareType");
this.v = this.Manager.CreateVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>("v");
this.v1 = this.Manager.CreateVariable<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>("v1");
this.v2 = this.Manager.CreateVariable<int>("v2");
}
private void ITreeMgmtAdapterInstance_TreeDisconnectResponse(Adapter.ModelSmb2Status status)
{
this.Manager.AddEvent(TreeDisconnectResponseInfo, this.ITreeMgmtAdapterInstance, status);
}
private void ITreeMgmtAdapterInstance_TreeConnectResponse(Adapter.ModelSmb2Status status, TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Adapter.TreeMgmt.TreeMgmtServerConfig config)
{
this.Manager.AddEvent(TreeConnectResponseInfo, this.ITreeMgmtAdapterInstance, new object[] { status, shareType, config });
}
protected override void TestCleanup() {
this.ITreeMgmtAdapterInstance.TreeConnectResponse -= ITreeMgmtAdapterInstance_TreeConnectResponse;
this.ITreeMgmtAdapterInstance.TreeDisconnectResponse -= ITreeMgmtAdapterInstance_TreeDisconnectResponse;
base.TestCleanup();
this.CleanupTestManager();
}
#endregion
#region Test Starting in S0
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS0() {
this.Manager.BeginTest("TreeMgmtTestCaseS0");
this.Manager.Comment("reaching state \'S0\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp0;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp0);
this.Manager.Comment("reaching state \'S1\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp0, "config of ReadConfig, state S1");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S2\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S3\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S4\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS5();
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS5() {
this.Manager.Comment("reaching state \'S5\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS0TreeDisconnectRequestChecker)));
this.Manager.Comment("reaching state \'S6\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS0TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S7\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S8\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S9\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS0TreeDisconnectResponseChecker1))) != -1)) {
this.Manager.Comment("reaching state \'S10\'");
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS0TreeDisconnectResponseChecker1)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS0TreeDisconnectResponseChecker)));
}
}
private void TreeMgmtTestCaseS0TreeDisconnectRequestChecker() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS0TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S6");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is ValidExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is Va" +
"lidExistTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS0TreeDisconnectResponseChecker1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S9");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S105
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS105() {
this.Manager.BeginTest("TreeMgmtTestCaseS105");
this.Manager.Comment("reaching state \'S105\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp1;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp1);
this.Manager.Comment("reaching state \'S106\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp1, "config of ReadConfig, state S106");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S107\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S108\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S109\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S110\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S111\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS105TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S112\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS5();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS105TreeDisconnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS105TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S111");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S11
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS11() {
this.Manager.BeginTest("TreeMgmtTestCaseS11");
this.Manager.Comment("reaching state \'S11\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp2;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp2);
this.Manager.Comment("reaching state \'S12\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp2, "config of ReadConfig, state S12");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S13\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S14\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S15\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(ValidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(1)));
this.Manager.Comment("reaching state \'S16\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S17\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S18\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS19();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS11TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_SUCCESS,SHARE_TYPE_DISK,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeConnectResponse, state S17");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values>(this.Manager, ((Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values)(1)), shareType, "shareType of TreeConnectResponse, state S17");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S17");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
}
private void TreeMgmtTestCaseS19() {
this.Manager.Comment("reaching state \'S19\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectRequestChecker)));
this.Manager.Comment("reaching state \'S20\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S21\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS22();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker)));
}
}
private void TreeMgmtTestCaseS11TreeDisconnectRequestChecker() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS11TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_SUCCESS)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeDisconnectResponse, state S20");
}
catch (TransactionFailedException ) {
this.Manager.Comment("This step would have covered \"[MS-SMB2] 3.3.5.8: The tree connect MUST then be re" +
"moved from Session.TreeConnectTable and freed\", \"[TestInfo] TreeConnect is remov" +
"ed from Session.TreeConnectTable\"");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.8: The tree connect MUST then be removed from Session.TreeConnec" +
"tTable and freed\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect is removed from Session.TreeConnectTable\"");
}
private void TreeMgmtTestCaseS22() {
this.Manager.Comment("reaching state \'S22\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectRequestChecker1)));
this.Manager.Comment("reaching state \'S23\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker1))) != -1)) {
this.Manager.Comment("reaching state \'S24\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS25();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker1)));
}
}
private void TreeMgmtTestCaseS11TreeDisconnectRequestChecker1() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS11TreeDisconnectResponseChecker1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S23");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is ValidExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is Va" +
"lidExistTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS25() {
this.Manager.Comment("reaching state \'S25\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectRequestChecker2)));
this.Manager.Comment("reaching state \'S26\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker2))) != -1)) {
this.Manager.Comment("reaching state \'S27\'");
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS11TreeDisconnectResponseChecker2)));
}
}
private void TreeMgmtTestCaseS11TreeDisconnectRequestChecker2() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS11TreeDisconnectResponseChecker2(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S26");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S113
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS113() {
this.Manager.BeginTest("TreeMgmtTestCaseS113");
this.Manager.Comment("reaching state \'S113\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp3;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp3);
this.Manager.Comment("reaching state \'S114\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp3, "config of ReadConfig, state S114");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S115\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S116\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S117\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(ValidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(1)));
this.Manager.Comment("reaching state \'S118\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S119\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S120\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S121\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S122\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S123\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S124\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S125\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker1))) != -1)) {
this.Manager.Comment("reaching state \'S126\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS44();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker1)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS113TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_SUCCESS,SHARE_TYPE_DISK,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeConnectResponse, state S119");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values>(this.Manager, ((Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values)(1)), shareType, "shareType of TreeConnectResponse, state S119");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S119");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
}
private void TreeMgmtTestCaseS113TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S122");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTre" +
"eId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS113TreeDisconnectResponseChecker1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S125");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTre" +
"eId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS44() {
this.Manager.Comment("reaching state \'S44\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectRequestChecker)));
this.Manager.Comment("reaching state \'S45\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker2))) != -1)) {
this.Manager.Comment("reaching state \'S46\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS47();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker2)));
}
}
private void TreeMgmtTestCaseS113TreeDisconnectRequestChecker() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS113TreeDisconnectResponseChecker2(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_SUCCESS)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeDisconnectResponse, state S45");
}
catch (TransactionFailedException ) {
this.Manager.Comment("This step would have covered \"[MS-SMB2] 3.3.5.8: The tree connect MUST then be re" +
"moved from Session.TreeConnectTable and freed\", \"[TestInfo] TreeConnect is remov" +
"ed from Session.TreeConnectTable\"");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.8: The tree connect MUST then be removed from Session.TreeConnec" +
"tTable and freed\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect is removed from Session.TreeConnectTable\"");
}
private void TreeMgmtTestCaseS47() {
this.Manager.Comment("reaching state \'S47\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectRequestChecker1)));
this.Manager.Comment("reaching state \'S48\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker3))) != -1)) {
this.Manager.Comment("reaching state \'S49\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS50();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker3)));
}
}
private void TreeMgmtTestCaseS113TreeDisconnectRequestChecker1() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS113TreeDisconnectResponseChecker3(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S48");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS50() {
this.Manager.Comment("reaching state \'S50\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectRequestChecker2)));
this.Manager.Comment("reaching state \'S51\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker4))) != -1)) {
this.Manager.Comment("reaching state \'S52\'");
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS113TreeDisconnectResponseChecker4)));
}
}
private void TreeMgmtTestCaseS113TreeDisconnectRequestChecker2() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS113TreeDisconnectResponseChecker4(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S51");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is ValidExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is Va" +
"lidExistTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S127
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS127() {
this.Manager.BeginTest("TreeMgmtTestCaseS127");
this.Manager.Comment("reaching state \'S127\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp4;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp4);
this.Manager.Comment("reaching state \'S128\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp4, "config of ReadConfig, state S128");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S129\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S130\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S131\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(SpecialSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath.SpecialSharePath);
this.Manager.Comment("reaching state \'S132\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S133\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS127TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S134\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS47();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS127TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS127TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_ACCESS_DENIED,shareType,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_ACCESS_DENIED, status, "status of TreeConnectResponse, state S133");
TestManagerHelpers.AssertBind<int>(this.Manager, this.shareType, (System.Int32)shareType, "shareType of TreeConnectResponse, state S133");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S133");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.7: The server MUST determine whether the user represented by Session.SecurityContext should be granted access based on the authorization policy specified in Share.ConnectSecurity. If the server determines that access should not be granted, the server MUST fail the request with STATUS_ACCESS_DENIED."", ""[MS-SMB2] 3.3.4.13: If Share.Name is equal to ""IPC$"" or Share.Type does not have the STYPE_SPECIAL bit set, then Share.ConnectSecurity SHOULD be set to a security descriptor allowing all users. Otherwise, Share.ConnectSecurity SHOULD be set to a security descriptor allowing only administrators."", ""[TestInfo] User authenticated the session is a NonAdmin, and share in the TreeConnect request has STYPE_SPECIAL bit set"", ""[TestTag] Compatibility""");
throw;
}
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
TestManagerHelpers.AssertBind<int>(this.Manager, this.v2, this.shareType, "v2 == shareType");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.5.7: The server MUST determine whether the user represented by Session.SecurityContext should be granted access based on the authorization policy specified in Share.ConnectSecurity. If the server determines that access should not be granted, the server MUST fail the request with STATUS_ACCESS_DENIED.""");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.4.13: If Share.Name is equal to ""IPC$"" or Share.Type does not have the STYPE_SPECIAL bit set, then Share.ConnectSecurity SHOULD be set to a security descriptor allowing all users. Otherwise, Share.ConnectSecurity SHOULD be set to a security descriptor allowing only administrators.""");
this.Manager.Checkpoint("\"[TestInfo] User authenticated the session is a NonAdmin, and share in the TreeCo" +
"nnect request has STYPE_SPECIAL bit set\"");
this.Manager.Checkpoint("\"[TestTag] Compatibility\"");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
this.Manager.Comment("Unbinding variable \'v2\'");
this.v2.Unbind();
}
#endregion
#region Test Starting in S135
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS135() {
this.Manager.BeginTest("TreeMgmtTestCaseS135");
this.Manager.Comment("reaching state \'S135\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp5;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp5);
this.Manager.Comment("reaching state \'S136\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp5, "config of ReadConfig, state S136");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S137\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S138\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S139\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S140\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S141\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S142\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS66();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS135TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S141");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS66() {
this.Manager.Comment("reaching state \'S66\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectRequestChecker)));
this.Manager.Comment("reaching state \'S67\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker1))) != -1)) {
this.Manager.Comment("reaching state \'S68\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.Comment("reaching state \'S69\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S70\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker2))) != -1)) {
this.Manager.Comment("reaching state \'S71\'");
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker2)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS135TreeDisconnectResponseChecker1)));
}
}
private void TreeMgmtTestCaseS135TreeDisconnectRequestChecker() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS135TreeDisconnectResponseChecker1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S67");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is ValidExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is Va" +
"lidExistTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS135TreeDisconnectResponseChecker2(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S70");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect does not exist in Session.TreeConnectTable, tree id is In" +
"validTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S28
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS28() {
this.Manager.BeginTest("TreeMgmtTestCaseS28");
this.Manager.Comment("reaching state \'S28\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp6;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp6);
this.Manager.Comment("reaching state \'S29\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp6, "config of ReadConfig, state S29");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S30\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S31\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S32\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(InvalidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(0)));
this.Manager.Comment("reaching state \'S33\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S34\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS28TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S35\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS25();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS28TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS28TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_BAD_NETWORK_NAME,shareType,TreeMg" +
"mtServerConfig(Platform=c.Platform))\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_BAD_NETWORK_NAME, status, "status of TreeConnectResponse, state S34");
TestManagerHelpers.AssertBind<int>(this.Manager, this.shareType, (System.Int32)shareType, "shareType of TreeConnectResponse, state S34");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S34");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.7: Otherwise, the server MUST provide the tuple <hostname, sharename> parsed from the request message to invoke the event specified in [MS-SRVS] section 3.1.6.8, to normalize the hostname by resolving server aliases and evaluating share scope. The server MUST use <normalized hostname, sharename> to look up the Share in ShareList. If no share with a matching share name and server name is found, the server MUST fail the request with STATUS_BAD_NETWORK_NAME"", ""[TestInfo] Share path is an invalid share path"", ""[TestTag] UnexpectedFields""");
throw;
}
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
TestManagerHelpers.AssertBind<int>(this.Manager, this.v2, this.shareType, "v2 == shareType");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.5.7: Otherwise, the server MUST provide the tuple <hostname, sharename> parsed from the request message to invoke the event specified in [MS-SRVS] section 3.1.6.8, to normalize the hostname by resolving server aliases and evaluating share scope. The server MUST use <normalized hostname, sharename> to look up the Share in ShareList. If no share with a matching share name and server name is found, the server MUST fail the request with STATUS_BAD_NETWORK_NAME""");
this.Manager.Checkpoint("\"[TestInfo] Share path is an invalid share path\"");
this.Manager.Checkpoint("\"[TestTag] UnexpectedFields\"");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
}
#endregion
#region Test Starting in S36
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS36() {
this.Manager.BeginTest("TreeMgmtTestCaseS36");
this.Manager.Comment("reaching state \'S36\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp7;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp7);
this.Manager.Comment("reaching state \'S37\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp7, "config of ReadConfig, state S37");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S38\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S39\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S40\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(ValidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(1)));
this.Manager.Comment("reaching state \'S41\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S42\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS36TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S43\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS44();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS36TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS36TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_SUCCESS,SHARE_TYPE_DISK,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeConnectResponse, state S42");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values>(this.Manager, ((Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values)(1)), shareType, "shareType of TreeConnectResponse, state S42");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S42");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
}
#endregion
#region Test Starting in S53
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS53() {
this.Manager.BeginTest("TreeMgmtTestCaseS53");
this.Manager.Comment("reaching state \'S53\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp8;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp8);
this.Manager.Comment("reaching state \'S54\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp8, "config of ReadConfig, state S54");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S55\'");
this.Manager.Comment("executing step \'call SetupConnection(NonAdmin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(1)));
this.Manager.Comment("reaching state \'S56\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S57\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(SpecialSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath.SpecialSharePath);
this.Manager.Comment("reaching state \'S58\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S59\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS53TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S60\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS50();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS53TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS53TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_ACCESS_DENIED,shareType,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_ACCESS_DENIED, status, "status of TreeConnectResponse, state S59");
TestManagerHelpers.AssertBind<int>(this.Manager, this.shareType, (System.Int32)shareType, "shareType of TreeConnectResponse, state S59");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S59");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.7: The server MUST determine whether the user represented by Session.SecurityContext should be granted access based on the authorization policy specified in Share.ConnectSecurity. If the server determines that access should not be granted, the server MUST fail the request with STATUS_ACCESS_DENIED."", ""[MS-SMB2] 3.3.4.13: If Share.Name is equal to ""IPC$"" or Share.Type does not have the STYPE_SPECIAL bit set, then Share.ConnectSecurity SHOULD be set to a security descriptor allowing all users. Otherwise, Share.ConnectSecurity SHOULD be set to a security descriptor allowing only administrators."", ""[TestInfo] User authenticated the session is a NonAdmin, and share in the TreeConnect request has STYPE_SPECIAL bit set"", ""[TestTag] Compatibility""");
throw;
}
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
TestManagerHelpers.AssertBind<int>(this.Manager, this.v2, this.shareType, "v2 == shareType");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.5.7: The server MUST determine whether the user represented by Session.SecurityContext should be granted access based on the authorization policy specified in Share.ConnectSecurity. If the server determines that access should not be granted, the server MUST fail the request with STATUS_ACCESS_DENIED.""");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.4.13: If Share.Name is equal to ""IPC$"" or Share.Type does not have the STYPE_SPECIAL bit set, then Share.ConnectSecurity SHOULD be set to a security descriptor allowing all users. Otherwise, Share.ConnectSecurity SHOULD be set to a security descriptor allowing only administrators.""");
this.Manager.Checkpoint("\"[TestInfo] User authenticated the session is a NonAdmin, and share in the TreeCo" +
"nnect request has STYPE_SPECIAL bit set\"");
this.Manager.Checkpoint("\"[TestTag] Compatibility\"");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
this.Manager.Comment("Unbinding variable \'v2\'");
this.v2.Unbind();
}
#endregion
#region Test Starting in S61
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS61() {
this.Manager.BeginTest("TreeMgmtTestCaseS61");
this.Manager.Comment("reaching state \'S61\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp9;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp9);
this.Manager.Comment("reaching state \'S62\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp9, "config of ReadConfig, state S62");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S63\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S64\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S65\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS66();
this.Manager.EndTest();
}
#endregion
#region Test Starting in S72
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS72() {
this.Manager.BeginTest("TreeMgmtTestCaseS72");
this.Manager.Comment("reaching state \'S72\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp10;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp10);
this.Manager.Comment("reaching state \'S73\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp10, "config of ReadConfig, state S73");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S74\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S75\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S76\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(ValidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(1)));
this.Manager.Comment("reaching state \'S77\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S78\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS72TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S79\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS80();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS72TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS72TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_SUCCESS,SHARE_TYPE_DISK,TreeMgmtS" +
"erverConfig(Platform=c.Platform))\'");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeConnectResponse, state S78");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values>(this.Manager, ((Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values)(1)), shareType, "shareType of TreeConnectResponse, state S78");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S78");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
}
private void TreeMgmtTestCaseS80() {
this.Manager.Comment("reaching state \'S80\'");
this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(TreeMgmtTestCase.TreeDisconnectRequestInfo, null, new TreeDisconnectRequestDelegate1(this.TreeMgmtTestCaseS72TreeDisconnectRequestChecker)));
this.Manager.Comment("reaching state \'S81\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS72TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S82\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS19();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS72TreeDisconnectResponseChecker)));
}
}
private void TreeMgmtTestCaseS72TreeDisconnectRequestChecker() {
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
}
private void TreeMgmtTestCaseS72TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S81");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is InvalidTre" +
"eId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S83
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS83() {
this.Manager.BeginTest("TreeMgmtTestCaseS83");
this.Manager.Comment("reaching state \'S83\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp11;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp11);
this.Manager.Comment("reaching state \'S84\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp11, "config of ReadConfig, state S84");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S85\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S86\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S87\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(SpecialSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath.SpecialSharePath);
this.Manager.Comment("reaching state \'S88\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S89\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S90\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidNotExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId.ValidNotExistTreeId);
this.Manager.Comment("reaching state \'S91\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S92\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeDisconnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S93\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidNotExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId.ValidNotExistTreeId);
this.Manager.Comment("reaching state \'S94\'");
this.Manager.Comment("checking step \'return TreeDisconnectRequest\'");
this.Manager.Comment("reaching state \'S95\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeDisconnectResponseChecker1))) != -1)) {
this.Manager.Comment("reaching state \'S96\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(InvalidTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(0)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS80();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeDisconnectResponseChecker1)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeDisconnectResponseInfo, null, new TreeDisconnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeDisconnectResponseChecker)));
}
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS83TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS83TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_SUCCESS,shareType,TreeMgmtServerC" +
"onfig(Platform=c.Platform))\'");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, ((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status)(0)), status, "status of TreeConnectResponse, state S89");
TestManagerHelpers.AssertBind<int>(this.Manager, this.shareType, (System.Int32)shareType, "shareType of TreeConnectResponse, state S89");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S89");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
TestManagerHelpers.AssertBind<int>(this.Manager, this.v2, this.shareType, "v2 == shareType");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
this.Manager.Comment("Unbinding variable \'v2\'");
this.v2.Unbind();
}
private void TreeMgmtTestCaseS83TreeDisconnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S92");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is ValidNotExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is ValidNotEx" +
"istTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
private void TreeMgmtTestCaseS83TreeDisconnectResponseChecker1(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status) {
this.Manager.Comment("checking step \'event TreeDisconnectResponse(STATUS_NETWORK_NAME_DELETED)\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_NETWORK_NAME_DELETED, status, "status of TreeDisconnectResponse, state S95");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeConnectTable by using the TreeId in the SMB2 header of the request. If no tree connect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED"", ""[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is ValidNotExistTreeId"", ""[TestTag] InvalidIdentifier""");
throw;
}
this.Manager.Checkpoint("\"[MS-SMB2] 3.3.5.2.11: The server MUST look up the TreeConnect in Session.TreeCon" +
"nectTable by using the TreeId in the SMB2 header of the request. If no tree conn" +
"ect is found, the request MUST be failed with STATUS_NETWORK_NAME_DELETED\"");
this.Manager.Checkpoint("\"[TestInfo] TreeConnect exists in Session.TreeConnectTable, tree id is ValidNotEx" +
"istTreeId\"");
this.Manager.Checkpoint("\"[TestTag] InvalidIdentifier\"");
}
#endregion
#region Test Starting in S97
[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod()]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Model)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Positive)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Smb2002)]
[Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory(Microsoft.Protocols.TestSuites.FileSharing.Common.Adapter.TestCategories.Tree)]
public void TreeMgmtTestCaseS97() {
this.Manager.BeginTest("TreeMgmtTestCaseS97");
this.Manager.Comment("reaching state \'S97\'");
Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig temp12;
this.Manager.Comment("executing step \'call ReadConfig(out _)\'");
this.ITreeMgmtAdapterInstance.ReadConfig(out temp12);
this.Manager.Comment("reaching state \'S98\'");
this.Manager.Comment("checking step \'return ReadConfig/[out c]\'");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.c, temp12, "config of ReadConfig, state S98");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v, this.c, "v == c");
this.Manager.Comment("reaching state \'S99\'");
this.Manager.Comment("executing step \'call SetupConnection(Admin)\'");
this.ITreeMgmtAdapterInstance.SetupConnection(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSessionSecurityContext)(0)));
this.Manager.Comment("reaching state \'S100\'");
this.Manager.Comment("checking step \'return SetupConnection\'");
this.Manager.Comment("reaching state \'S101\'");
this.Manager.Comment("executing step \'call TreeConnectRequest(InvalidSharePath)\'");
this.ITreeMgmtAdapterInstance.TreeConnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelSharePath)(0)));
this.Manager.Comment("reaching state \'S102\'");
this.Manager.Comment("checking step \'return TreeConnectRequest\'");
this.Manager.Comment("reaching state \'S103\'");
if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS97TreeConnectResponseChecker))) != -1)) {
this.Manager.Comment("reaching state \'S104\'");
this.Manager.Comment("executing step \'call TreeDisconnectRequest(ValidExistTreeId)\'");
this.ITreeMgmtAdapterInstance.TreeDisconnectRequest(((Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.ModelTreeId)(1)));
this.Manager.AddReturn(TreeDisconnectRequestInfo, null);
TreeMgmtTestCaseS22();
}
else {
this.Manager.CheckObservationTimeout(false, new ExpectedEvent(TreeMgmtTestCase.TreeConnectResponseInfo, null, new TreeConnectResponseDelegate1(this.TreeMgmtTestCaseS97TreeConnectResponseChecker)));
}
this.Manager.EndTest();
}
private void TreeMgmtTestCaseS97TreeConnectResponseChecker(Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status status, Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smb2.ShareType_Values shareType, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig config) {
this.Manager.Comment("checking step \'event TreeConnectResponse(STATUS_BAD_NETWORK_NAME,shareType,TreeMg" +
"mtServerConfig(Platform=c.Platform))\'");
try {
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status>(this.Manager, Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.ModelSmb2Status.STATUS_BAD_NETWORK_NAME, status, "status of TreeConnectResponse, state S103");
TestManagerHelpers.AssertBind<int>(this.Manager, this.shareType, (System.Int32)shareType, "shareType of TreeConnectResponse, state S103");
TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), config, "config of TreeConnectResponse, state S103");
}
catch (TransactionFailedException ) {
this.Manager.Comment(@"This step would have covered ""[MS-SMB2] 3.3.5.7: Otherwise, the server MUST provide the tuple <hostname, sharename> parsed from the request message to invoke the event specified in [MS-SRVS] section 3.1.6.8, to normalize the hostname by resolving server aliases and evaluating share scope. The server MUST use <normalized hostname, sharename> to look up the Share in ShareList. If no share with a matching share name and server name is found, the server MUST fail the request with STATUS_BAD_NETWORK_NAME"", ""[TestInfo] Share path is an invalid share path"", ""[TestTag] UnexpectedFields""");
throw;
}
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.config, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "config == TreeMgmtServerConfig(Platform=c.Platform)");
TestManagerHelpers.AssertBind<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(this.Manager, this.v1, this.Make<Microsoft.Protocols.TestSuites.FileSharing.SMB2Model.Adapter.TreeMgmt.TreeMgmtServerConfig>(new string[] {
"Platform"}, new object[] {
this.c.Value.Platform}), "v1 == TreeMgmtServerConfig(Platform=c.Platform)");
this.Manager.Assert(TestManagerHelpers.Equality(((object)(((int)(this.v1.Value.Platform)))), ((object)(((int)(this.c.Value.Platform))))), "Fail to check the assumption : v1.Platform == c.Platform");
TestManagerHelpers.AssertBind<int>(this.Manager, this.v2, this.shareType, "v2 == shareType");
this.Manager.Checkpoint(@"""[MS-SMB2] 3.3.5.7: Otherwise, the server MUST provide the tuple <hostname, sharename> parsed from the request message to invoke the event specified in [MS-SRVS] section 3.1.6.8, to normalize the hostname by resolving server aliases and evaluating share scope. The server MUST use <normalized hostname, sharename> to look up the Share in ShareList. If no share with a matching share name and server name is found, the server MUST fail the request with STATUS_BAD_NETWORK_NAME""");
this.Manager.Checkpoint("\"[TestInfo] Share path is an invalid share path\"");
this.Manager.Checkpoint("\"[TestTag] UnexpectedFields\"");
this.Manager.Comment("Unbinding variable \'config\'");
this.config.Unbind();
this.Manager.Comment("Unbinding variable \'shareType\'");
this.shareType.Unbind();
this.Manager.Comment("Unbinding variable \'v1\'");
this.v1.Unbind();
this.Manager.Comment("Unbinding variable \'v2\'");
this.v2.Unbind();
}
#endregion
}
}