示例#1
0
        //does sleep association tests and hibernate association tests.
        public void AdvancedAssociationTests()
        {
            if (m_AssocTestOptions.HasFlag(ASSOC_TEST_OPTIONS.Sleep))
            {
                if (!(PowerManager.IsS3Supported() || PowerManager.IsAoAcCapableMachine()))
                {
                    LogError("S3 or AOAC is not supported.  At least one must be supported.  Run powercfg -a from an elevated cmd prompt to determine supported sleep states");
                }

                //test AP1 - sleep|CS - AP1 then AP1 - sleep|CS - AP2
                if (PowerManager.IsAoAcCapableMachine())
                {
                    //AP1 - CS - AP1
                    string sameAPName        = "Association sleep and resume - Same AP - Connected Standby";
                    string sameAPDescription = "Sleep and resume with manual profile - Connected device goes to CS - Test connection to same AP";

                    Helpers.LogVariationStart(sameAPName, sameAPDescription);
                    AssociateSameAP(0, false, false);
                    Helpers.LogVariationStop(sameAPName);

                    //AP1 - CS - AP2
                    string differentAPName        = "Association sleep and resume - Different AP - Connected Standby";
                    string differentAPDescription = "Sleep and resume with manual profile - Connected device goes to CS - Turn off AP radio - Turn on another AP radio - Test connection to new AP";

                    Helpers.LogVariationStart(differentAPName, differentAPDescription);
                    AssociateDifferentAP(0, 1, false, m_DeviceSupports5GHz, false);
                    Helpers.LogVariationStop(differentAPName);
                }
                else
                {
                    //AP1 - Sleep - AP1
                    string sameAPName        = "Association sleep and resume - Same AP";
                    string sameAPDescription = "Sleep and resume with manual profile - Connected device goes to sleep - Test connection to same AP";

                    Helpers.LogVariationStart(sameAPName, sameAPDescription);
                    AssociateSameAP(0, false, false);
                    Helpers.LogVariationStop(sameAPName);

                    //AP1 - Sleep - AP2
                    string differentAPName        = "Association sleep and resume - Different AP";
                    string differentAPDescription = "Sleep and resume with manual profile - Connected device goes to sleep - Turn off AP radio - Turn on another AP radio - Test connection to new AP";

                    Helpers.LogVariationStart(differentAPName, differentAPDescription);
                    AssociateDifferentAP(0, 1, false, m_DeviceSupports5GHz, false);
                    Helpers.LogVariationStop(differentAPName);
                }
            }

            if (m_AssocTestOptions.HasFlag(ASSOC_TEST_OPTIONS.Hibernate))
            {
                //test AP2 - hibernate - AP2 then AP2 - hibernate - AP1
                //AP2 - hiber - AP2
                if (PowerManager.IsS4Supported())
                {
                    string sameAPName        = "Association hibernate and resume - Same AP";
                    string sameAPDescription = "Hibernate and resume with manual profile - Connected device hibernates - Test connection to same AP";

                    Helpers.LogVariationStart(sameAPName, sameAPDescription);
                    AssociateSameAP(1, m_DeviceSupports5GHz, true);
                    Helpers.LogVariationStop(sameAPName);

                    //AP2 - hiber - AP1
                    string differentAPName        = "Association hibernate and resume - Different AP";
                    string differentAPDescription = "Hibernate and resume with manual profile - Connected device hibernates - Turn off AP radio - Turn on another AP radio - Test connection to new AP";

                    Helpers.LogVariationStart(differentAPName, differentAPDescription);
                    AssociateDifferentAP(1, 0, m_DeviceSupports5GHz, false, true);
                    Helpers.LogVariationStop(differentAPName);
                }
            }
        }
示例#2
0
        public void BasicAssociationTest()
        {
            string variationName        = "Basic Association test";
            string variationDescription = "Associate to first AP with manual profile - Turn Off Radio - Associate to second AP with manual profile";

            Helpers.LogVariationStart(variationName, variationDescription);

            Log("Deleting all wlan profiles");
            DeleteProfiles();

            Log("Starting Echo Services");
            CreateEchoServer();

            //Radios of all APs are turned on by the SetupRoutersIfNeeded();
            Log("Setting up Routers");
            SetupRoutersIfNeeded();

            string   Profile;
            APConfig ap1Config = m_APConfigs[0];
            APConfig ap2Config = m_APConfigs[1];
            string   ap1_ssid  = ap1Config.SSID_24GHZ;
            string   ap2_ssid  = (m_DeviceSupports5GHz) ? ap2Config.SSID_5GHZ : ap2Config.SSID_24GHZ;

            //In general the typical usage pattern of radio states for APs should be that they are only turned on when needed
            // as this best matches the scenario where the user moves from location A to location B.

            //Turn off AP1 5 GHz (never used)
            SetRadioState(0, false, true);

            //Turn off AP2 (both 2.4 and 5, will be used later)
            SetRadioState(1, false, false);
            SetRadioState(1, false, true);

            LogMajor("Associate with manual profile to " + ap1_ssid + " - Turn AP off - Associate with manual profile to " + ap2_ssid);

            // Create a 2.4 GHz profile for first router.
            Log("Creating a manual profile for SSID " + ap1_ssid);
            Profile = CreateProfile(0, ConnectionMode.Manual, false);

            LogMajor("Connecting to " + ap1_ssid);
            if (!ConnectToAP(ap1_ssid))
            {
                return;
            }

            LogMajor("Validating association bssid");
            if (!ValidateRadioAssociation(0, false))
            {
                return;
            }
            LogMajor("Validating connection by connecting to echo services and performing echo");
            if (!PerformEcho(0, false))
            {
                return;
            }
            //Turn off AP1 2.4 GHz (not needed anymore)
            SetRadioState(0, false, false);

            m_WlanApi.DeleteProfile(m_TestInterface.Id, ap1_ssid);

            //AP2 next

            //Turn on AP2
            SetRadioState(1, true, m_DeviceSupports5GHz);

            // Create a profile for second router.
            Log("Creating a manual profile for SSID " + ap2_ssid);
            Profile = CreateProfile(1, ConnectionMode.Manual, m_DeviceSupports5GHz);

            LogMajor("Connecting to " + ap2_ssid);
            if (!ConnectToAP(ap2_ssid))
            {
                return;
            }

            LogMajor("Validating association bssid");
            if (!ValidateRadioAssociation(1, m_DeviceSupports5GHz))
            {
                return;
            }
            LogMajor("Validating connection by connecting to echo services and performing echo");
            if (!PerformEcho(1, m_DeviceSupports5GHz))
            {
                return;
            }

            m_WlanApi.DeleteProfile(m_TestInterface.Id, ap2_ssid);

            Helpers.LogVariationStop(variationName);
        }
        public static void Roam(RunTimeConfiguration rc,
                                APConfigParameter AP1Config24GHz,
                                APConfigParameter AP1Config5GHz,
                                APConfigParameter AP2Config24GHz,
                                APConfigParameter AP2Config5GHz,
                                ROAM_TEST_OPTIONS RoamTestOptions)
        {
            WlanHckTestLogger traceProvider = new WlanHckTestLogger("RoamingDriver");

            using (UsingGroup g = new UsingGroup())
            {
                traceProvider.LogComment("Roaming Scenarios Begin");

                try
                {
                    WhckRoaming hckRoaming = new WhckRoaming(rc,
                                                             AP1Config24GHz,
                                                             AP1Config5GHz,
                                                             AP2Config24GHz,
                                                             AP2Config5GHz,
                                                             RoamTestOptions);

                    g.Add(hckRoaming);


                    if (RoamTestOptions.HasFlag(ROAM_TEST_OPTIONS.SuddenLossOfSignal))
                    {
                        string scenarioName = "Roaming " + ROAM_TEST_OPTIONS.SuddenLossOfSignal.ToString();
                        Helpers.LogVariationStart(scenarioName, scenarioName);

                        traceProvider.LogComment("Testing sudden loss of Signal");
                        hckRoaming.SuddenLossOfSignal();
                        Helpers.LogVariationStop(scenarioName);
                    }

                    if (RoamTestOptions.HasFlag(ROAM_TEST_OPTIONS.SuddenDropOfSignal))
                    {
                        string scenarioName = "Roaming " + ROAM_TEST_OPTIONS.SuddenDropOfSignal.ToString();
                        Helpers.LogVariationStart(scenarioName, scenarioName);

                        traceProvider.LogComment("Testing sudden drop of Signal");
                        hckRoaming.SuddenDropOfSignal();
                        Helpers.LogVariationStop(scenarioName);
                    }

                    if (RoamTestOptions.HasFlag(ROAM_TEST_OPTIONS.GradualDropOfSignal))
                    {
                        string scenarioName = "Roaming " + ROAM_TEST_OPTIONS.GradualDropOfSignal.ToString();
                        Helpers.LogVariationStart(scenarioName, scenarioName);

                        traceProvider.LogComment("Testing gradual drop of Signal");
                        hckRoaming.GradualDropOfSignal();
                        Helpers.LogVariationStop(scenarioName);
                    }

                    if (RoamTestOptions.HasFlag(ROAM_TEST_OPTIONS.GradualLossOfSignal))
                    {
                        string scenarioName = "Roaming " + ROAM_TEST_OPTIONS.GradualLossOfSignal.ToString();
                        Helpers.LogVariationStart(scenarioName, scenarioName);

                        traceProvider.LogComment("Testing gradual loss of Signal");
                        hckRoaming.GradualLossOfSignal();
                        Helpers.LogVariationStop(scenarioName);
                    }
                }
                catch (Exception e)
                {
                    traceProvider.LogError("Error - " + e.Message);
                    throw;
                }
            }
        }