C# Class Microsoft.Protocol.TestSuites.Smbd.TestSuite.SmbdDataTransfer

Inheritance: Microsoft.Protocols.TestTools.TestClassBase
Mostrar archivo Open project: Microsoft/WindowsProtocolTestSuites

Public Methods

Method Description
CommonTestMethod_ModifyField_SmbdDataTransfer ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint bufferLength, int modifyFieldAddress, uint modifyValue, bool useMaxSendSize = false ) : void

Modify DataOffset in SMBDirect Data Transfer message

CommonTestMethod_RemainingDataLength_AgainstMaxFragmentedSize ( uint remainingDataLength, bool useMaxFragmentedSize = false ) : void
Initialize_ReceiveSmbdDataTransferTestCase ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint smb2ReadResponseSize, bool isUseMaxSendSize = false, bool isUseMaxFragmentedSize = false ) : void

Initialize receive SMBDirect data transfer test case And send the SMB2 READ request to peer

Initialize_SendSmbdDataTransferTestCase ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint smb2WriteRequestSize, byte &fileContent, byte &smb2WriteRequestPacket, bool isUseMaxSendSize = false ) : void

Initialize send SMBDirect data transfer test case. In this method, it will connect to server, SMBDirect negotiate with server and SMB2 intiailize. And generate SMB2 WRITE request according the size

LogSmbdEndpointEvent ( string log ) : void
SendMultipleSegmentsWithVariableDataLength ( byte data, bool isMininum = false, bool withRedundancyBytes = false ) : void

Send multiple segments If isMininum is not set, generate list of number from 128 to 0 and then 0 to ~. For example, 128, 127, 126 ... 1, 0, 1, 2, ... Else, generate list of number with all number one: 1, 1, 1, ..... Split the input data into slices. Data length of each slice follows the number and number sequence in the list just generated. Send the SMBD Data Transfer messages to server.

SendWithInvalidRemainingDataLength ( List messages, int messageNumber, int remainingDataLength, bool isModify = false ) : void
ValidateFileContent ( byte fileContent ) : void

Read back file content and validate whether read content is the same as written content

ValidateReadResponse ( int readResponseSize ) : void

Receive and validate SMB2 Read Response

ValidateWriteResponse ( byte fileContent ) : void

Receive and validate SMB2 Write Response

Protected Methods

Method Description
TestCleanup ( ) : void
TestInitialize ( ) : void

Private Methods

Method Description
BVT_SmbdDataTransfer_Basic_SendModerateBytesData ( ) : void
BVT_SmbdDataTransfer_Basic_SendSmallBytesOfData ( ) : void
ClassCleanup ( ) : void
ClassInitialize ( Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context ) : void
SmbdDataTransfer_IdleConnection_Client ( ) : void
SmbdDataTransfer_IdleConnection_Server ( ) : void
SmbdDataTransfer_IdleConnection_Server_Timeout ( ) : void
SmbdDataTransfer_NegativeParameter_AgainstMaxFragmentedSize ( ) : void
SmbdDataTransfer_NegativeParameter_DataLength_AgainstMaxReceiveSize ( ) : void
SmbdDataTransfer_NegativeParameter_DataLength_AgainstMessageLength ( ) : void
SmbdDataTransfer_NegativeParameter_DataOffset_Against8ByteAligned ( ) : void
SmbdDataTransfer_NegativeParameter_DataOffset_AgainstMessageLength ( ) : void
SmbdDataTransfer_NegativeParameter_RemainingDataLength_AgainstFragmentReassemblyRemaining ( ) : void
SmbdDataTransfer_NegativeParameter_RemainingDataLength_AgainstMaxFragmentedSize ( ) : void
SmbdDataTransfer_NegativeParameter_RemainingDataLength_Zero ( ) : void
SmbdDataTransfer_ReceiveMaxReceiveSize ( ) : void
SmbdDataTransfer_Redundancy ( ) : void
SmbdDataTransfer_SmallLengthSegment ( ) : void
SmbdDataTransfer_UncompletedMessage ( ) : void
SmbdDataTransfer_VariableLengthSegment ( ) : void

Method Details

CommonTestMethod_ModifyField_SmbdDataTransfer() public method

Modify DataOffset in SMBDirect Data Transfer message
public CommonTestMethod_ModifyField_SmbdDataTransfer ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint bufferLength, int modifyFieldAddress, uint modifyValue, bool useMaxSendSize = false ) : void
maxSendSize uint
maxFragmentSize uint
maxReceiveSize uint
bufferLength uint
modifyFieldAddress int
modifyValue uint
useMaxSendSize bool
return void

CommonTestMethod_RemainingDataLength_AgainstMaxFragmentedSize() public method

public CommonTestMethod_RemainingDataLength_AgainstMaxFragmentedSize ( uint remainingDataLength, bool useMaxFragmentedSize = false ) : void
remainingDataLength uint
useMaxFragmentedSize bool
return void

Initialize_ReceiveSmbdDataTransferTestCase() public method

Initialize receive SMBDirect data transfer test case And send the SMB2 READ request to peer
public Initialize_ReceiveSmbdDataTransferTestCase ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint smb2ReadResponseSize, bool isUseMaxSendSize = false, bool isUseMaxFragmentedSize = false ) : void
maxSendSize uint The maximum single-message size which can be sent by the local peer for this connection.
maxFragmentSize uint The maximum fragmented upper-layer payload receive size supported by the local peer for this connection.
maxReceiveSize uint The maximum single-message size which can be received from the remote peer for this connection.
smb2ReadResponseSize uint The size of SMB2 Read response.
isUseMaxSendSize bool Use client's MaxReceivedSize as smb2ReadResponseSize
isUseMaxFragmentedSize bool Use client's MaxFragmentedSize as smb2ReadResponseSize
return void

Initialize_SendSmbdDataTransferTestCase() public method

Initialize send SMBDirect data transfer test case. In this method, it will connect to server, SMBDirect negotiate with server and SMB2 intiailize. And generate SMB2 WRITE request according the size
public Initialize_SendSmbdDataTransferTestCase ( uint maxSendSize, uint maxFragmentSize, uint maxReceiveSize, uint smb2WriteRequestSize, byte &fileContent, byte &smb2WriteRequestPacket, bool isUseMaxSendSize = false ) : void
maxSendSize uint The maximum single-message size which can be sent by the local peer for this connection.
maxFragmentSize uint The maximum fragmented upper-layer payload receive size supported by the local peer for this connection.
maxReceiveSize uint The maximum single-message size which can be received from the remote peer for this connection.
smb2WriteRequestSize uint Size of SMB2 WRITE request packet
fileContent byte file content according the input file size
smb2WriteRequestPacket byte SMB2 WRITE request packet
isUseMaxSendSize bool /// If this flag is true, smb2WriteRequestSize will be data offset /// file content size = negotiated MaxSendSize - smb2WriteRequestSize (DataOffset) ///
return void

LogSmbdEndpointEvent() public method

public LogSmbdEndpointEvent ( string log ) : void
log string
return void

SendMultipleSegmentsWithVariableDataLength() public method

Send multiple segments If isMininum is not set, generate list of number from 128 to 0 and then 0 to ~. For example, 128, 127, 126 ... 1, 0, 1, 2, ... Else, generate list of number with all number one: 1, 1, 1, ..... Split the input data into slices. Data length of each slice follows the number and number sequence in the list just generated. Send the SMBD Data Transfer messages to server.
public SendMultipleSegmentsWithVariableDataLength ( byte data, bool isMininum = false, bool withRedundancyBytes = false ) : void
data byte Data to be sent.
isMininum bool Indicate whether the function is used by test case "SmbdDataTransfer_SmallLengthSegment".
withRedundancyBytes bool With Redundancy Bytes at the end of SMBD Data Transfer messages
return void

SendWithInvalidRemainingDataLength() public method

public SendWithInvalidRemainingDataLength ( List messages, int messageNumber, int remainingDataLength, bool isModify = false ) : void
messages List
messageNumber int
remainingDataLength int
isModify bool
return void

TestCleanup() protected method

protected TestCleanup ( ) : void
return void

TestInitialize() protected method

protected TestInitialize ( ) : void
return void

ValidateFileContent() public method

Read back file content and validate whether read content is the same as written content
public ValidateFileContent ( byte fileContent ) : void
fileContent byte
return void

ValidateReadResponse() public method

Receive and validate SMB2 Read Response
public ValidateReadResponse ( int readResponseSize ) : void
readResponseSize int Size of SMB2 read response
return void

ValidateWriteResponse() public method

Receive and validate SMB2 Write Response
public ValidateWriteResponse ( byte fileContent ) : void
fileContent byte
return void