예제 #1
0
    def set_up(self):
        """
        Initialize the test
        """

        LabWifiDualBase.set_up(self)

        # Check TC parameters
        if self._ftp_transfer and not self._dl_filename_param:
            msg = "Missing TC parameter: FTP_DL_FILENAME: " + str(
                self._dl_filename_param)
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)

        if self._xfer_timeout in (None, ""):
            self._xfer_timeout = 200
        else:
            self._xfer_timeout = float(self._xfer_timeout)

        # Set Wifi sleep policy to "Never Sleep"
        self._networking_api.set_wifi_sleep_policy(
            self._networking_api.WIFI_SLEEP_POLICY["NEVER"])

        # Warn the user if the AP are not Cisco 12xx
        if not self._ns.get_model().startswith("CISCO_12") \
                or not self._ns_ap2.get_model().startswith("CISCO_12"):
            self._logger.warning(
                "You will have better reliability using 2 CISCO 12xx APs")

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Initialize the test
        """
        LabWifiDualBase.set_up(self)

        # Disconnect Wifi from both APs
        self._networking_api.wifi_disconnect_all()

        return Global.SUCCESS, "No errors"
예제 #3
0
    def set_up(self):
        """
        Initialize the test
        """
        LabWifiDualBase.set_up(self)
        # Connect DUT to AP 1
        self._networking_api.wifi_connect(self._ssid, False)
        # call the generic LabWifiDsf._set_up() method
        self._set_up()

        return Global.SUCCESS, "no_error"
    def set_up(self):
        """
        Initialize the test
        """
        # pylint: disable=E1101
        LabWifiDualBase.set_up(self)

        # Control that the TC parameters has been correctly set.
        if self._standard not in ["a", "n5G"]:
            msg = "AP1 is not set to 5GHz. Standard set: %s" % self._standard
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)
        if self._standard_ap2 not in ["gb", "ngb", "n2.4G"]:
            msg = "AP2 is not set to 2.4GHz. Standard set: %s" \
                % self._standard_ap2
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)
        if self._channel != "1":
            self._logger.warning("AP1 channel is not 1 as advise: %s" %
                                 self._channel)
        if self._channel_ap2 != "1":
            self._logger.warning("AP2 channel is not 1 as advise: %s" %
                                 self._channel_ap2)

        if not self._24to5 and not self._5to24:
            msg = "At least 1 of the parameter 2_4_TO_5_GHZ or 5_TO_2_4_GHZ "
            msg += "should be enabled"
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)

        # Set band selection to "auto"
        self._networking_api.set_wifi_frequency_band("auto", False,
                                                     self._dut_wlan_iface)

        if self._24to5:
            # Connect to 2.4GHz AP
            self._networking_api.wifi_connect(self._ssid_ap2)
            self._test_sequence += [["5GHz", self._ssid]]
        if self._5to24:
            if not self._24to5:
                # Connect to 5GHz AP
                self._networking_api.wifi_connect(self._ssid)
            self._test_sequence += [["2.4GHz", self._ssid_ap2]]

        # Set autoconnect for both SSIDs
        self._networking_api.set_autoconnect_mode(self._ssid,
                                                  AUTO_CONNECT_STATE.on)
        self._networking_api.set_autoconnect_mode(self._ssid_ap2,
                                                  AUTO_CONNECT_STATE.on)

        return Global.SUCCESS, "No errors"
예제 #5
0
    def set_up(self):
        """
        Initialize the test
        """
        LabWifiDualBase.set_up(self)

        # Control that the security is not OPEN
        if str(self._security_ap2).upper() in ["NONE", "OPEN"]:
            msg = "WIFI_SECURITY_AP2 UseCase parameter should not be " + \
                "undefined nor OPEN: %s" % str(self._security_ap2)
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)

        # Generate a corrupted passphrase
        if self._security_ap2 == "EAP-WPA" or self._security_ap2 == "EAP-WPA2":
            self._wrong_passphrase = self._eap_method_ap2 + "-" \
                + self._phase2_auth_ap2 + "_" + self._eap_user \
                + "_" + self._corrupt_pass(self._eap_password) + "_" \
                + self._certificat_name + "_" + str(self._mandatory_cert)
        else:
            self._wrong_passphrase = self._corrupt_pass(self._passphrase_ap2)

        return Global.SUCCESS, "No errors"