コード例 #1
0
        public void SmbdCreditMgmt_NegativeParameter_CreditRequested()
        {
            // define data for test case
            const ushort RECEIVE_CREDIT_MAX = 10;
            const ushort SEND_CREDIT_TARGET = 10;

            BaseTestSite.Log.Add(LogEntryKind.TestStep, "Connect to server over RDMA");
            NtStatus status = smbdAdapter.ConnectToServerOverRDMA();

            BaseTestSite.Assert.AreEqual <NtStatus>(NtStatus.STATUS_SUCCESS, status, "Status of SMBD connection is {0}", status);

            BaseTestSite.Log.Add(LogEntryKind.TestStep, "SMBD Negotiate");
            SmbdNegotiateResponse response;

            status = smbdAdapter.SmbdNegotiate(
                SEND_CREDIT_TARGET,
                RECEIVE_CREDIT_MAX,
                out response);
            BaseTestSite.Assert.AreEqual <NtStatus>(NtStatus.STATUS_SUCCESS, status, "Status of SMBD negotiate is {0}", status);

            BaseTestSite.Log.Add(LogEntryKind.TestStep, "Send SMBD Data Transfer Message request with 0 credit.");
            status = smbdAdapter.SmbdSendDataTransferMessage(
                0,
                0,
                SmbdDataTransfer_Flags.NONE,
                0,
                0,
                0,
                new byte[0]);
            BaseTestSite.Assert.AreEqual <NtStatus>(NtStatus.STATUS_SUCCESS, status, "Status of send SMBD Data Transfer message is {0}", status);

            BaseTestSite.Log.Add(LogEntryKind.TestStep, "Verify server connection will be terminated.");
            smbdAdapter.WaitRdmaDisconnect();
            BaseTestSite.Assert.IsFalse(smbdAdapter.ClientConnection.Endpoint.IsConnected, "Connection should be terminated");
        }