def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)
        self._peer_device = self._pars.peer_device

        if self._pars.go_intent in Constants.LIST_GO_INTENT_VALUES:
            self._go_intent = self._pars.go_intent

        if (self._pars.p2p_com_freq in Constants.LIST_US_2G_CHANNELS) or (
                self._pars.p2p_com_freq in Constants.LIST_US_5G_CHANNELS):
            self._regulatory_domain = "US"
            self._force_freq = self._pars.p2p_com_freq

        if (self._pars.p2p_com_freq in Constants.LIST_FR_2G_CHANNELS) or (
                self._pars.p2p_com_freq in Constants.LIST_FR_5G_CHANNELS):
            self._regulatory_domain = "FR"
            self._force_freq = self._pars.p2p_com_freq

        if self._regulatory_domain != None:
            self._nw_api.set_regulatorydomain(self._regulatory_domain)

        self._api.wifi_direct_invite(self._peer_device, self._force_freq)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """

        WifiDirectBase.run(self, context)

        state = self._pars.state

        assert state in ["all", "available", "invited",
                         "connected"], "state value (%s) is invalid" % state

        value = self._api.get_wifi_direct_peer_devices(state)

        str_result = ""
        for cur_value in value:
            str_result = str_result + cur_value + '|'
        if str_result.endswith('|'):
            str_result = str_result[:-1]

        context.set_info(self._pars.save_as, str_result)
        self.ts_verdict_msg = "VERDICT: %s stored as {0}".format(
            str(str_result)) % self._pars.save_as
        self._logger.debug(self.ts_verdict_msg)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)
        self._peer_device = self._pars.peer_device
        if self._pars.timeout != None:
            self._cnx_timeout = int(self._pars.timeout)

        if self._pars.go_intent in Constants.LIST_GO_INTENT_VALUES:
            self._go_intent = self._pars.go_intent

        if (self._pars.p2p_com_freq in Constants.LIST_US_2G_CHANNELS) or (self._pars.p2p_com_freq in Constants.LIST_US_5G_CHANNELS):
            self._regulatory_domain = "US"
            self._force_freq = self._pars.p2p_com_freq

        if (self._pars.p2p_com_freq in Constants.LIST_FR_2G_CHANNELS) or (self._pars.p2p_com_freq in Constants.LIST_FR_5G_CHANNELS):
            self._regulatory_domain = "FR"
            self._force_freq = self._pars.p2p_com_freq

        if self._regulatory_domain != None:
            self._nw_api.set_regulatorydomain(self._regulatory_domain)

        if self._pars.pin_code != None:
            self._pin = self._pars.pin_code


        self._api.wifi_direct_connect(self._peer_device, self._cnx_timeout, self._go_intent, self._force_freq, self._pars.connect_type, self._pars.authentication_type,
                                      self._pin)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        if (self._pars.p2p_com_freq in Constants.LIST_US_2G_CHANNELS) or (self._pars.p2p_com_freq in Constants.LIST_US_5G_CHANNELS):
            self._regulatory_domain = "US"

        if (self._pars.p2p_com_freq in Constants.LIST_FR_2G_CHANNELS) or (self._pars.p2p_com_freq in Constants.LIST_FR_5G_CHANNELS):
            self._regulatory_domain = "FR"

        if self._regulatory_domain != None:
            self._nw_api.set_regulatorydomain(self._regulatory_domain)

        incoming_peer = self._pars.peer_dev_mac
        valid_mac = is_valid_mac_address(incoming_peer)
        if valid_mac is not True:
            msg = "Invalid MAC address provided for incoming_peer (%s)" % incoming_peer
            self._logger.error(msg)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg)

        self._api.wifi_direct_accept_connection(incoming_peer)
    def __init__(self, tc_conf, global_conf, ts_conf, factory=None):
        WifiDirectBase.__init__(self, tc_conf, global_conf, ts_conf, factory)

        self._peer_device = None
        self._cnx_timeout = 0
        self._go_intent = 8
        self._force_freq = 0
        self._regulatory_domain = None
        self._pin = ""
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        self._api.set_wifi_direct_dev_name(self._pars.peer_device_name)
Exemple #7
0
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        self._api.wifi_direct_remove_remembered_groups()
Exemple #8
0
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        self._api.wifi_direct_scan_peer_devices()
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """

        WifiDirectBase.run(self, context)

        self._logger.info("Getting the WiFi Direct Interface...")

        value = self._api.get_wifi_direct_interface()

        context.set_info(self._pars.save_as, value)
        self.ts_verdict_msg = "VERDICT: %s stored as {0}".format(value) % self._pars.save_as
        self._logger.debug(self.ts_verdict_msg)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """

        WifiDirectBase.run(self, context)

        self._logger.info("Getting the WiFi Direct RSSI...")

        p2p_rssi = self._api.get_wifi_direct_rssi(self._pars.interface)

        context.set_info(self._pars.save_wifi_direct_rssi, p2p_rssi)
        self.ts_verdict_msg = "VERDICT: %s stored as {0}".format(
            p2p_rssi) % self._pars.save_wifi_direct_rssi
        self._logger.debug(self.ts_verdict_msg)
Exemple #11
0
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        group_owner = self._pars.group_owner
        assert group_owner != "", "Value (%s) is invalid for group_owner" % group_owner

        remembered_groups_list = self._pars.remembered_groups_list

        value = self._api.check_wifi_direct_groups(group_owner,
                                                   remembered_groups_list)
        if value is not True:
            self._raise_device_exception(
                "Can't find a matching group for peer %s" % group_owner)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """

        WifiDirectBase.run(self, context)

        value = self._api.get_wifi_direct_mac_address()

        if is_valid_mac_address(value) is not True:
            self._raise_device_exception("Invalid mac address detected %s" %
                                         (value))

        context.set_info(self._pars.save_as, value)
        self.ts_verdict_msg = "VERDICT: %s stored as {0}".format(
            str(value)) % self._pars.save_as
        self._logger.debug(self.ts_verdict_msg)
Exemple #13
0
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """
        WifiDirectBase.run(self, context)

        assert self._pars.p2p_mode in [None, "GO", "CLI"], \
            "passed value (%s) is invalid at this stage" % self._pars.p2p_mode
        assert self._pars.p2p_frequency in [None, 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462,
                                            2467, 2472, 5180, 5200, 5220, 5240], \
            "passed value (%s) is invalid at this stage" % self._pars.p2p_frequency

        # Force GO/CLI P2P mode
        if self._pars.p2p_mode is not None:
            self._api.set_wifi_direct_mode(self._pars.p2p_mode)

        # Force channel
        if self._pars.p2p_frequency is not None:
            self._api.set_wifi_direct_frequency(self._pars.p2p_frequency)
    def run(self, context):
        """
        Runs the test step

        @type context: TestStepContext
        @param context: test case context
        """

        WifiDirectBase.run(self, context)

        dest_variable = self._pars.save_wifi_direct_channel

        cur_freq = self._api.get_wifi_direct_channel_freq()
        cur_channel = AcsWifiFrequencies.get_wifi_channel_from_frequency(
            str(cur_freq))

        context.set_nested_info([dest_variable, "FREQUENCY"], cur_freq)
        context.set_nested_info([dest_variable, "CHANNEL"], cur_channel)
        self.ts_verdict_msg = "VERDICT: %s stored as {0}\n".format(
            str(cur_freq)) % "FREQUENCY"
        self.ts_verdict_msg += "%s stored as {0}\n".format(
            str(cur_channel)) % "CHANNEL"
        self._logger.debug(self.ts_verdict_msg)
 def __init__(self, tc_conf, global_conf, ts_conf, factory=None):
     WifiDirectBase.__init__(self, tc_conf, global_conf, ts_conf, factory)
    def __init__(self, tc_conf, global_conf, ts_conf, factory=None):
        WifiDirectBase.__init__(self, tc_conf, global_conf, ts_conf, factory)

        self._accept_connection = 0
        self._regulatory_domain = None