Esempio n. 1
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)
        LiveWifiBase.__init__(self, tc_name, global_config)

        self._audio_file = str(self._tc_parameters.get_param_value("AUDIO_FILE"))
        self._duration = str(self._tc_parameters.get_param_value("DURATION"))
        self._a2dp_activity = str(self._tc_parameters.get_param_value("A2DP_ACTIVITY")).upper()
        self._wifi_activity = str(self._tc_parameters.get_param_value("WIFI_ACTIVITY")).upper()

        if self._wifi_activity == "WIFI_WEB_BROWSING":
            self._wifi_url = str(self._tc_parameters.get_param_value("URL_TO_BROWSE"))
        elif self._wifi_activity == "WIFI_FTP_DOWNLOAD":
            self._ftp_remote_file = str(self._tc_parameters.get_param_value("FTP_REMOTE_FILE"))
            self._timeout = 300

        self._bt_headset = self._em.get_bluetooth_headset("BT_HEADSET")
        self._bt_headset_addr = None

        self._thread_wifi_activity = None
        self._thread_a2dp_activity = None
        self._queue = Queue.Queue()
Esempio n. 2
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LiveBTBase.__init__(self, tc_name, global_config)

        # Get TC Parameters

        # Read DEVICE_BT_ADDRESS from test case xml file or BenchConfig
        self._device_to_search = \
            str(self._tc_parameters.get_param_value("DEVICE_TO_SEARCH"))
        if self._device_to_search.lower() in ["none", ""]:
            # Then search for the BT MAC address into the BenchConfig
            bench_bt_device = global_config.benchConfig\
                .get_parameters("BT_DEVICE")
            if bench_bt_device is not None:
                if str(bench_bt_device.get_param_value("MacAddress")).lower()\
                        not in ["none", "", "00:00:00:00:00:00"]:
                    self._device_to_search = str(
                        bench_bt_device.get_param_value("MacAddress"))
                else:
                    msg = "No BD addr defined in the TC and/or in bench_config"
                    self._logger.error(msg)
                    raise AcsConfigException(
                        AcsConfigException.INVALID_PARAMETER, msg)
            else:
                msg = "No BD address defined in the TC and/or in bench_config"
                self._logger.error(msg)
                raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                         msg)
Esempio n. 3
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        # Read CONNECT_INITIATOR from test case xml file
        self._connector = \
            str(self._tc_parameters.get_param_value("CONNECT_INITIATOR"))
        # Read MUSIC_CONTROL_SEQUENCE from test case xml file
        audiocmd_list = \
            str(self._tc_parameters.get_param_value("MUSIC_CONTROL_SEQUENCE"))
        # Read DURATION from test case xml file
        self._duration = \
            int(self._tc_parameters.get_param_value("DURATION"))

        # Name of the MP3 file to play
        self._file_name = str(
            self._tc_parameters.get_param_value("FILE_TO_PLAY"))

        # Split to create a list of audio command
        self._audiocmd_list = audiocmd_list.strip().split(",")

        # BT headset
        self._bt_headset = None

        # BD address of Headset
        self._hsaddr = ""
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LiveBTBase.__init__(self, tc_name, global_config)

        # Get PHONE2
        self._phone2 = DeviceManager().get_device(self.STR_PHONE_2)

        # Check if we have the second phone available
        if self._phone2 is not None:
            if not self._phone2.is_available():
                DeviceManager().boot_device(self.STR_PHONE_2)
            self._bt_api2 = self._phone2.get_uecmd("LocalConnectivity")

            # Get PHONE2 networking interface
            self._networking_api2 = self._phone2.get_uecmd("Networking")

            # Get BT device parameters
            self._dut2_config = DeviceManager().get_device_config(self.STR_PHONE_2)

        self._phone_system_api = self._device.get_uecmd("PhoneSystem")

        # Initialize phones address
        self._phone1_addr = ""
        self._phone2_addr = ""

        self._original_flight_mode2 = 0
Esempio n. 5
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        # Get TestCase parameters
        # Read TURN_APM_SEQUENCE from test case xml file
        self._turn_apm_sequence = \
            str(self._tc_parameters.get_param_value("TURN_APM_SEQUENCE"))

        # Read BT_INIT_MODE from test case xml file
        self._bt_mode = \
            str(self._tc_parameters.get_param_value("BT_INIT_MODE"))
        if self._bt_mode is None:
            self._bt_mode = "on"

        # Read BT_GETMODE_TIMEOUT from test case xml file
        self._bt_getmode_timeout = \
            self._tc_parameters.get_param_value("BT_GETMODE_TIMEOUT")
        if self._bt_getmode_timeout is None \
           or not str(self._bt_getmode_timeout).isdigit():
            self._bt_getmode_timeout = int(self._device._uecmd_default_timeout)  # pylint: disable=W0212
        else:
            self._bt_getmode_timeout = int(self._bt_getmode_timeout)

        # get original bt mode
        self._original_bt_mode = self._bt_api.get_bt_power_status_eot()

        # local variable: BT power state when Airplane mode is disabled
        self._initial_bt_state = self._original_bt_mode
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)
        LiveWifiBase.__init__(self, tc_name, global_config)

        self._wifi_ip = self._wifirouter.get_param_value("IP")
        self._bt_headset = self._em.get_bluetooth_headset("BT_HEADSET")
Esempio n. 7
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        # Read TURN_BLUETOOTH_SEQUENCE from test case xml file
        self._turn_bluetooth_sequence = \
            str(self._tc_parameters.get_param_value("TURN_BLUETOOTH_SEQUENCE"))
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        self._duration = str(self._tc_parameters.get_param_value("DURATION"))

        self._thread_bt_switch = None
        self._thread_wifi_switch = None
        self._queue = Queue.Queue()
Esempio n. 9
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        LiveBTBase.__init__(self, tc_name, global_config)

        #Get TC parameters
        self._wifi_access_point = str(self._tc_parameters.get_param_value("WIFI_ACCESS_POINT", ""))
        self._connection_to_share = "WIFI"
        self.__global_config = global_config
        # Initialize data
        self._wait_btwn_cmd = 5.0
        self._bluetooth_connectivity_obj = BluetoothConnectivity(self._device, self._wait_btwn_cmd)
Esempio n. 10
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LabWifiIperf.__init__(self, tc_name, global_config)
        LiveBTBase.__init__(self, tc_name, global_config)
        LabWifiKPIBase.__init__(self, tc_name, global_config)

        self._bt_play_music = self._tc_parameters.get_param_value(
            "BT_PLAY_MUSIC")
        self._bt_headset = None
        self._bt_headset_addr = None
        self._thread_headset_check_music = None
        self._queue = Queue.Queue()
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        self._ref_bt_addr = str(self._tc_parameters.get_param_value("REF_BT_ADDR"))
        self._duration = str(self._tc_parameters.get_param_value("DURATION"))

        self._bench_config = global_config.benchConfig.get_parameters("BT_DEVICE")
        self._bt_headset = self._em.get_bluetooth_headset("BT_HEADSET")
        self._bt_headset_addr = None
        self._thread_bt_scan = None
        self._thread_headset_check_music = None
        self._queue = Queue.Queue()
Esempio n. 12
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LiveBTBase init function
        LiveBTBase.__init__(self, tc_name, global_config)

        # Read BT_INITIAL_STATE from test case xml file
        self._bt_initial_state = \
            str(self._tc_parameters.get_param_value("BT_INITIAL_STATE")).upper()

        # Read TURN_BLUETOOTH_TETHERING_SEQUENCE from test case xml file
        self._turn_bt_tethering_sequence = \
            str(self._tc_parameters.
                get_param_value("TURN_BLUETOOTH_TETHERING_SEQUENCE")).upper().strip()

        # Get Tethering default state after BT Off/On from device catalog file
        self._tethering_reset = str(self._dut_config.get("TetheringResetAfterBtOffOn"))
        if self._tethering_reset.lower() == "true":
            self._tethering_reset = True
        else:
            # By default, tethering is not reset
            self._tethering_reset = False