public void Rdprfx_MUST_NegativeTest_TsRfxChannels()
        {
            //Test Type List
            RdprfxNegativeType[] negTestTypeArr = new RdprfxNegativeType[]{
                RdprfxNegativeType.TsRfxChannels_InvalidChannelId};

            //Start RDP listening.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Starting RDP listening.");
            this.rdpbcgrAdapter.StartRDPListening(transportProtocol);

            Dictionary<RdprfxNegativeType, bool> testResultDic = new Dictionary<RdprfxNegativeType, bool>();

            foreach (RdprfxNegativeType negType in negTestTypeArr)
            {
                bool fDisconnected = rdprfxNegativeTest(negType);
                testResultDic.Add(negType, fDisconnected);
            }

            logNegativeTestResult(testResultDic);
        }
Exemple #2
0
        public void Rdprfx_MUST_NegativeTest_TsRfxSync()
        {
            //Test Type List
            RdprfxNegativeType[] negTestTypeArr = new RdprfxNegativeType[] {
                RdprfxNegativeType.TsRfxSync_InvalidMagic,
                RdprfxNegativeType.TsRfxSync_InvalidVersion
            };

            //Start RDP listening.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Starting RDP listening.");
            this.rdpbcgrAdapter.StartRDPListening(transportProtocol);

            Dictionary <RdprfxNegativeType, bool> testResultDic = new Dictionary <RdprfxNegativeType, bool>();

            foreach (RdprfxNegativeType negType in negTestTypeArr)
            {
                bool fDisconnected = rdprfxNegativeTest(negType);
                testResultDic.Add(negType, fDisconnected);
            }

            logNegativeTestResult(testResultDic);
        }
        private bool rdprfxNegativeTest(RdprfxNegativeType negType)
        {
            StartRDPConnection();

            this.rdprfxAdapter.SetTestType(negType);

            #region Fill parameters
            TS_RFX_ICAP[] clientSupportedCaps;
            rdprfxAdapter.ReceiveAndCheckClientCapabilities(maxRequestSize, out clientSupportedCaps);

            OperationalMode opMode = OperationalMode.ImageMode;
            EntropyAlgorithm enAlgorithm = EntropyAlgorithm.CLW_ENTROPY_RLGR3;
            ushort destLeft = 0; //the left bound of the frame.
            ushort destTop = 0; //the top bound of the frame.

            //Set OperationalMode/EntropyAlgorithm to valid pair.
            if (clientSupportedCaps != null)
            {
                opMode = (OperationalMode)clientSupportedCaps[0].flags;
                enAlgorithm = (EntropyAlgorithm)clientSupportedCaps[0].entropyBits;
            }
            #endregion

            this.TestSite.Log.Add(LogEntryKind.Comment, "Sending one frame of encoded bitmap data to client. Operational Mode = {0}, Entropy Algorithm = {1}, destLeft = {2}, destTop = {3}.",
            opMode, enAlgorithm, destLeft, destTop);
            this.rdprfxAdapter.SendImageToClient(image_64X64, opMode, enAlgorithm, destLeft, destTop);

            bool fDisconnected = this.rdpbcgrAdapter.WaitForDisconnection(waitTime);

            StopRDPConnection();

            return fDisconnected;
        }
 /// <summary>
 /// Set the type of current test.
 /// </summary>
 /// <param name="testType">The test type.</param>
 public void SetTestType(RdprfxNegativeType testType)
 {
     currentTestType = testType;
 }
 public override void Reset()
 {
     base.Reset();
     pduCache.Clear();
     pendingBuffer.Clear();
     currentTestType = RdprfxNegativeType.None;
 }
 public override void Initialize(ITestSite testSite)
 {
     this.site = testSite;
     rdprfxServerDecoder = new RdprfxServerDecoder();
     rdprfxServer = new RdprfxServer();
     pduCache = new List<StackPacket>();
     pendingBuffer = new List<byte>();
     syncLocker = new object();
     currentTestType = RdprfxNegativeType.None;
 }
 /// <summary>
 /// Set the type of current test.
 /// </summary>
 /// <param name="testType">The test type.</param>
 public void SetTestType(RdprfxNegativeType testType)
 {
     currentTestType = testType;
 }