Beispiel #1
0
        public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port)
        {
            this.ipv6Mode = ipv6;
            localPort     = port;

            if (testMode == TestMode.Wlan)
            {
                localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode);
            }
            else
            {
                localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid);
            }

            this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort);
            testLogger.LogComment("MulticastReceiver[{0}]  local address", this.identifier);


            testLogger.LogTrace("Creating Multicast Receive Socket");
            if (ipv6Mode)
            {
                if (testMode == TestMode.Wlan)
                {
                    using (Wlan wlanApi = new Wlan())
                    {
                        var wlanInterfaceList = wlanApi.EnumWlanInterfaces();
                        if (wlanInterfaceList.Count < 1)
                        {
                            throw new TestConfigException("No WLAN Interfaces were discovered.  Ensure that WLAN interfaces are enabled, discoverable, and operational.");
                        }
                        var wlanInterface = wlanInterfaceList[0];

                        UInt32 wlanInterfaceIndex = NetworkInterfaceDataPathTests.GetNetworkIndex(wlanInterface.Id);
                        listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port, wlanInterfaceIndex);
                    }
                }
                else
                {
                    UInt32 lanInterfaceIndex = NetworkInterfaceDataPathTests.GetNetworkIndex(localInterfaceGuid);
                    listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port, lanInterfaceIndex);
                }
            }
            else
            {
                listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port);
            }
        }
Beispiel #2
0
        public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port)
        {
            this.ipv6Mode = ipv6;
            localPort     = port;

            if (testMode == TestMode.Wlan)
            {
                localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode);
            }
            else
            {
                localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid);
            }
            this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort);
            testLogger.LogComment("BroadcastReceiver[{0}] local address", this.identifier);

            listenSocket = sockets.CreateUdpSocket(localAddress, localPort, ipv6Mode);
        }
Beispiel #3
0
        public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port)
        {
            this.ipv6Mode      = ipv6;
            this.remoteAddress = address;
            this.remotePort    = port;
            localPort          = port;

            if (testMode == TestMode.Wlan)
            {
                localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode);
            }
            else
            {
                localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid);
            }
            this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort);

            testLogger.LogComment("BroadcastSender[{0}]  Remote {1}:{2}", this.identifier, this.remoteAddress, this.remotePort);
        }
Beispiel #4
0
        public static void Associate(RunTimeConfiguration rc,
                                     APConfigParameter AP1Config24GHz,
                                     APConfigParameter AP1Config5GHz,
                                     APConfigParameter AP2Config24GHz,
                                     APConfigParameter AP2Config5GHz,
                                     ASSOC_TEST_OPTIONS AssocTestOptions)
        {
            WlanHckTestLogger traceProvider = new WlanHckTestLogger("Associate Driver");

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

                    WhckAssociation hckAssociation = new WhckAssociation(rc,
                                                                         AP1Config24GHz,
                                                                         AP1Config5GHz,
                                                                         AP2Config24GHz,
                                                                         AP2Config5GHz,
                                                                         AssocTestOptions);

                    g.Add(hckAssociation);

                    //Basic Association AP1 2.4GHz -> AP2 5 GHz (2.4 GHz if 5 not supported), no sleep
                    hckAssociation.BasicAssociationTest();

                    //If requested perform advanced association tests
                    if (AssocTestOptions.HasFlag(ASSOC_TEST_OPTIONS.Sleep) || AssocTestOptions.HasFlag(ASSOC_TEST_OPTIONS.Hibernate))
                    {
                        hckAssociation.AdvancedAssociationTests();
                    }
                }
                catch (Exception e)
                {
                    traceProvider.LogError("Error - " + e.Message);
                    throw;
                }
                finally
                {
                    traceProvider.Flush();
                }
            }
        }
Beispiel #5
0
 private void Log(String log)
 {
     testLogger.LogComment(log);
 }
Beispiel #6
0
        public static void ClassSetup(TestContext context)
        {
            APServer = null;

            if (context.Properties.Contains("DeviceSupports5Ghz"))
            {
                DeviceSupports5Ghz = bool.Parse(context.Properties["DeviceSupports5Ghz"].ToString());
                testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "DeviceSupports5Ghz = {0}", DeviceSupports5Ghz));
            }

            if (context.Properties.Contains("APServer"))
            {
                APServer = context.Properties["APServer"].ToString();
                testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "APServer Name = {0}", APServer));
            }
            if (context.Properties.Contains("ServiceAPChannelAddress"))
            {
                ServiceAPChannelAddress = context.Properties["ServiceAPChannelAddress"].ToString();
                testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "ServiceAPChannelAddress = {0}", ServiceAPChannelAddress));
            }

            if (context.Properties.Contains("Duration"))
            {
                int duration;
                if (Int32.TryParse(context.Properties["Duration"].ToString(), out duration))
                {
                    TestDuration = duration;
                    testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "Duration = {0} minutes", TestDuration));
                }
                else
                {
                    testLogger.LogComment("Could not parse Duration. Using default.");
                }
            }

            if (APServer == null)
            {
                testLogger.LogError("Did not get AP Server name as parameter");
                return;
            }


            testLogger.LogComment("Connecting to AP Config Server - " + APServer);
            using (ApConfigClient apConfigClient = new ApConfigClient(APServer))
            {
                bool connect = apConfigClient.Connect();
                if (connect)
                {
                    testLogger.LogComment("Connection Succeeded");
                }
                else
                {
                    testLogger.LogError("Connection failed");
                    return;
                }

                testLogger.LogComment("Enum Routers");
                routers = apConfigClient.EnumerateAccessPoints();
                if (routers == null)
                {
                    testLogger.LogError("Unable to enum routers, EnumerateAccessPoints returned null");
                    return;
                }
                if (routers.Count >= 2)
                {
                    testLogger.LogComment("Found 2 routers as expected");
                }
                else
                {
                    testLogger.LogError("Did not find both APs");
                    return;
                }
            }
        }
Beispiel #7
0
        public void TestSetup()
        {
            if (context.Properties.Contains("Dot11wSSID"))
            {
                dot11wSSID = context.Properties["Dot11wSSID"].ToString();
                testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "Dot11wSSID = {0}", dot11wSSID));
            }
            else
            {
                Log.Error("Dot11wSSID is a required field");
                return;
            }

            if (context.Properties.Contains("Dot11wPassword"))
            {
                dot11wPassword = context.Properties["Dot11wPassword"].ToString();
                testLogger.LogComment(string.Format(CultureInfo.InvariantCulture, "Dot11wPassword = {0}", dot11wPassword));
            }
            else
            {
                Log.Error("Dot11wPassword is a required field");
                return;
            }

            int customOptions = sConfig.WlanTestOptions;

            if (customOptions != 0)
            {
                enableSleepTest = true;
            }
        }
Beispiel #8
0
        public DataPathServer()
        {
            lockObject = new Object();
            testList   = new Dictionary <Guid, IDataPathProtocolTest>();

            testLogger.LogComment("For additional tracing use the following GUID: {0}", testLogger.TraceGuid.ToString());
        }
        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;
                }
            }
        }