def tear_down(self): """ End and dispose the test """ UseCaseBase.tear_down(self) status = Global.SUCCESS msg = "No error" if self._computer is not None: self._computer.wifi_disconnect(self._wifi_interface) elif self._phone2 is not None: # disconnect from hotspot for Phone2 time.sleep(self._wait_btwn_cmd) self._networking_api2.\ wifi_disconnect(self._hotspot_ssid) time.sleep(self._wait_btwn_cmd) self._networking_api2.wifi_remove_config(self._hotspot_ssid) # set wifi power off for phone2 time.sleep(self._wait_btwn_cmd) self._networking_api2.set_wifi_power("off") # disable Portable wifi hotspot for Phone1 time.sleep(self._wait_btwn_cmd) self._networking_api.set_wifi_hotspot("off") # restore original flight mode if str_to_bool_ex(self._original_flight_mode) != str_to_bool_ex( self._flight_mode): time.sleep(self._wait_btwn_cmd) self._networking_api.set_flight_mode(self._original_flight_mode) # restore original wifi power status time.sleep(self._wait_btwn_cmd) self._networking_api.set_wifi_power(self._original_wifi_power_status) # If Bt to be (de-)activated for FIT tests if self._bt_fit_used: bt_final_status = self._localconnectivity_api.get_bt_power_status() # if Bt is not at the initial value, set it to the correct one. if bt_final_status != self._bt_initial_state: # restore Bt in initial state self._localconnectivity_api.set_bt_power( self._bt_initial_state) time.sleep(self._wait_btwn_cmd) return status, msg
def _manage_state(self, value): """ Handles the screen ON / OFF :type value: str :param value: Value to set (ON/OFF) """ if str_to_bool_ex(value): value_to_set = "1" elif str_to_bool_ex(value) is False: value_to_set = "0" else: self._raise_config_exception(STR_INVALID_VALUE) self._api.set_phone_screen_lock_on(value_to_set)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ WifiBase.run(self, context) self._logger.info("Getting the Wifi interface state...") # Where the information will be stored into the context? variable_to_set = self._pars.save_as value = self._api.get_wifi_power_status() if str_to_bool_ex(value): value = TestConst.STR_ON else: value = TestConst.STR_OFF # We have the value, let's save it into the context context.set_info(variable_to_set, value) self.ts_verdict_msg = "VERDICT: %s stored as {0}".format( value) % variable_to_set self._logger.debug(self.ts_verdict_msg)
def run_test(self): """ Execute the test """ UseCaseBase.run_test(self) # begin gps turn on off sequence self._logger.info("gps power sequence is :" + self._turn_gps_sequence) seqlist = self._turn_gps_sequence.strip().split() for switch in seqlist: str_switch = switch switch = str_to_bool_ex(switch) if switch is None: msg = "input wrong sequence, unrecognized value : %s" % str_switch \ + " , alter your sequence in test case xml file" raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg) self._location_api.set_gps_power(switch) time.sleep(self._wait_btwn_cmd) check = self._location_api.get_gps_power_status() time.sleep(self._wait_btwn_cmd) if switch != bool(check): msg = "set gps %s failure" % str(str_switch) raise DeviceException(DeviceException.OPERATION_FAILED, msg) return Global.SUCCESS, "No errors"
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ WifiBase.run(self, context) self._logger.info("Getting the Wifi Hotspot parameters state...") result_power = self._api.get_wifi_hotspot_status() if str_to_bool_ex(result_power): result_power = "on" else: result_power = "off" result_parameters = self._api.get_wifi_hotspot_parameters() context.set_nested_info([self._pars.wifi_hotspot_parameters, "POWER"], result_power) context.set_nested_info([self._pars.wifi_hotspot_parameters, "SSID"], result_parameters["SSID"]) context.set_nested_info( [self._pars.wifi_hotspot_parameters, "SECURITY"], result_parameters["SECURITY"]) context.set_nested_info( [self._pars.wifi_hotspot_parameters, "PASSPHRASE"], result_parameters["PASSPHRASE"]) context.set_nested_info( [self._pars.wifi_hotspot_parameters, "STANDARD"], result_parameters["STANDARD"]) context.set_nested_info( [self._pars.wifi_hotspot_parameters, "CHANNEL"], result_parameters["CHANNEL"]) context.set_nested_info([self._pars.wifi_hotspot_parameters, "HIDDEN"], result_parameters["HIDDEN"]) self._ts_verdict_msg = "VERDICT: %s stored as {0}:POWER".format( str(self._pars.wifi_hotspot_parameters)) % result_power self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:SSID".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["SSID"] self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:SECURITY".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["SECURITY"] self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:PASSPHRASE".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["PASSPHRASE"] self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:STANDARD".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["STANDARD"] self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:CHANNEL".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["CHANNEL"] self._ts_verdict_msg += "\nVERDICT: %s stored as {0}:HIDDEN".format( str(self._pars.wifi_hotspot_parameters) ) % result_parameters["HIDDEN"] self._logger.debug(self._ts_verdict_msg)
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) self._disconnected = False self._unplugged = False self._test_usb_disconnect = str_to_bool_ex(self._tc_parameters.get_param_value("TEST_USB_DISCONNECT"))
def __init__(self, tc_name, global_config): """ Constructor """ LabNfcBase.__init__(self, tc_name, global_config) # Instantiate the Secondary Report object self._secondary_report = SecondaryTestReport( self._device.get_report_tree().get_report_path()) # status for the test setup self.__flight_mode_status = self._tc_parameters.get_param_value( "FLIGHT_MODE_STATUS", "APM_NONE") # Get UECmdLayer self._phone_system_api = self._device.get_uecmd("PhoneSystem") self._networking_api = self._device.get_uecmd("Networking") self._appmgmt_api = self._phone_ref.get_uecmd("AppMgmt") # Get tag to manage from test case xml file self._tag_type = str(self._tc_parameters.get_param_value("TAG_TYPE")) # Get RTD to write in tag from test case xml file self._record_type_description = str( self._tc_parameters.get_param_value("RTD_TYPE")) # Get DATA to write in tag from test case xml file self._data_to_write = str(self._tc_parameters.get_param_value("DATA")) # Get DATA to write in tag from test case xml file self._should_erase = str_to_bool_ex( self._tc_parameters.get_param_value("ERASE")) if self._should_erase is None: self._should_erase = False # Get NFC Tags application package name self._tag_app = str(self._dut_config.get("TagsAppPackageName")) # Get Browsers application package name (need to disable in order to be able to read URI tags) self._browser_app = str(self._dut_config.get("BrowserAppPackageName")) self._chrome_app = str(self._dut_config.get("ChromeAppPackageName")) self._nfc_robot_param = global_config.benchConfig.get_parameters( "NFC_ROBOT1") # Get "Beam control check" from test case xml file (set ON, set OFF) self._beam_checked = self._get_beam_config() # Initialize up down robot values self._tag_up = "0" self._tag_down = "0" self._read_max_duration = "5" self._write_max_duration = "5" # Measure read time self._read_time_list = list() self._current_iteration_num = 0
def _is_state_reached(self, expected): # Get state and convert it to on or off state = str_to_bool_ex(self._api.get_wifi_power_status()) if state: state = TestConst.STR_ON else: state = TestConst.STR_OFF self._state_reached = (expected == state) return self._state_reached
def set_bt_visibility(self, hci_interface, enableVisibility): """ Set on/off the visibility of a given computer. :rtype: none """ if enableVisibility == True: cmd = "sudo hciconfig " + hci_interface + " piscan" else: cmd = "sudo hciconfig " + hci_interface + " noscan" output = self.run_cmd(cmd) return not str_to_bool_ex(output["ret"])
def run(self, context): """ Run the test step """ APBase.run(self, context) if str_to_bool_ex(self._pars.wmm) is True: mode = "on" else: mode = "off" # Set the WiFi WMM self._configurable_ap.set_wifi_wmm(mode)
def set_up(self): """ Initialize the test """ UseCaseBase.set_up(self) # Initialize the test # First store the initial gps power status self._initial_gps_power_status = self._location_api.get_gps_power_status( ) time.sleep(self._wait_btwn_cmd) # Get the first element of the sequence first_sequence_element = str_to_bool_ex( self._turn_gps_sequence.strip().split()[0].lower()) # Check the size of the sequence if len(self._turn_gps_sequence.strip().split()) < 2: msg = \ "input wrong sequence , failed ." \ + "add more elements to the sequence in test case xml file" raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg) if first_sequence_element is None: msg = \ "input wrong sequence , failed ." \ + "alter your sequence in test case xml file" raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg) # Check if the first element of the sequence is equal to # the actual state of gps if bool(self._initial_gps_power_status) == first_sequence_element: # Put gps power status unlike the first element # of the sequence self._logger.info("set gps initial status : " + str(not first_sequence_element)) self._location_api.set_gps_power(not first_sequence_element) time.sleep(self._wait_btwn_cmd) return Global.SUCCESS, "No errors"
def _process_fork_tag(self, path, test_steps, pars, ts_name=None): """ Process **<Fork>** tag, to create parallel test steps. :type path: str :param path: is the current XML path the fork tag is in :type test_steps: list :param test_steps: list of test steps :type pars: dict :param pars: the test step's parameters :type ts_name: str :param ts_name: the test step's parent name """ fork_id = pars[TestStepConstants.STR_FORK_ID] new_path = "%s/%s[@Id='%s']" % (path, TestStepConstants.STR_PATH_FORK, fork_id) # Before passing the current attributes (in pars) remove # ForkId (just to avoid confusion) pars.pop(TestStepConstants.STR_FORK_ID, None) # Create test steps ts_name = "{0}.{1}".format(ts_name, fork_id) if ts_name else fork_id fork_steps = self._create_test_steps_list(new_path, pars, ts_name) # If STR_SERIALIZE is specified <Fork> behaves like a <TestStepSet> # Useful to switch parallel / serial just changing the attribute if (TestStepConstants.STR_SERIALIZE not in pars.keys() or not str_to_bool_ex(pars[TestStepConstants.STR_SERIALIZE])): fork_set = ParallelTestStepSet(self._conf, self._global_conf, pars, self._factory) else: fork_set = TestStepSet(self._conf, self._global_conf, pars, self._factory) fork_set.name = ts_name fork_set.add_steps(fork_steps) # Add the test step set to the test step list test_steps.append(fork_set)
def __init__(self, tc_name, global_config): """ Constructor """ LiveNfcBase.__init__(self, tc_name, global_config) # Create NFC robot self._nfc_robot = self._em.get_nfc_robot("NFC_ROBOT1") # Get the TC parameter: Should we use offset for robot moves (considering antenna position on DUT) self._use_antenna_offset = str_to_bool_ex( self._tc_parameters.get_param_value("USE_ANTENNA_OFFSET", "")) self._x_offset = None self._y_offset = None if self._use_antenna_offset: # Get the NFC antenna position from Device_Catalog.xml nfc_antenna_position = self._device.get_config( "NfcAntennaPosition", "").split(',') if len(nfc_antenna_position) == 2 and \ is_number(nfc_antenna_position[0]) and is_number(nfc_antenna_position[1]): self._x_offset = int(nfc_antenna_position[0]) self._y_offset = int(nfc_antenna_position[1])
def _is_serial_port_used(self, silent_mode=False): """ Internal method that retrieves the parameters indicating if serial is used. :type silent_mode: bool :param silent_mode: Flag indicating some information are display as log. :rtype: boolean :return: true if serial enabled and configured in the config files """ status = False if (str_to_bool_ex( self._device.get_config("retrieveSerialTrace", "False")) and self._device.get_config("serialPort", "") != "" and self._device.get_config("serialBaudRate") is not None): status = True else: if not silent_mode: self._logger.warning( "Serial connection undefined in the config") return status
def set_phone_lock(self, mode): """ When phone is in idle mode, force the phone to stay locked/unlocked. :type mode: int :param mode: phone lock state in idle mode. Can be: -{0}: unlocked -{1}: lock """ lockEnabled = str_to_bool_ex(mode) if lockEnabled is None: self._logger.error("set_phone_lock : Parameter mode %s is not valid" % str(lockEnabled)) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, "Parameter 'mode' is not valid !") module_name, class_name = self._get_module_and_class_names("Display") if lockEnabled: lock_enabled = 1 else: lock_enabled = 0 params = "lockEnabled=%d" % lock_enabled output = self._internal_uecmd_exec(module_name, class_name, "setPhoneLock", params) print output
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) # Get FTP server parameters self._wifi_server = global_config.benchConfig.get_parameters( "WIFI_SERVER") self._ftp_ip_address = self._wifi_server.get_param_value("IP") self._ftp_username = self._wifi_server.get_param_value("username") self._ftp_password = self._wifi_server.get_param_value("password") if self._wifi_server.has_parameter("ftp_path"): self._ftp_path = self._wifi_server.get_param_value("ftp_path") else: self._ftp_path = "" # Get host spot configuration according HOTSPOT_SSID self._hotspot_ssid = \ str(self._tc_parameters.get_param_value("HOTSPOT_SSID")) # Get host spot configuration according HOTSPOT_SECURITY self._hotspot_security = \ str(self._tc_parameters.get_param_value("HOTSPOT_SECURITY")) # Get host spot configuration according HOTSPOT_PASSWORD self._hotspot_passphrase = \ str(self._tc_parameters.get_param_value("HOTSPOT_PASSWORD")) # Get host spot configuration according HOTSPOT_STANDARD self._hotspot_standard = \ self._tc_parameters.get_param_value("HOTSPOT_STANDARD") # Get flight mode configuration according FLIGHT_MODE self._flight_mode = \ str(self._tc_parameters.get_param_value("FLIGHT_MODE")) self._flight_mode = str_to_bool_ex(self._flight_mode) # Get Data connection mode self._is_pdp_context_activated = \ str(self._tc_parameters.get_param_value("IS_PDP_CONTEXT_ACTIVATED")) self._is_pdp_context_activated = str_to_bool_ex( self._is_pdp_context_activated) # Default is True if self._is_pdp_context_activated == None: self._is_pdp_context_activated = True # Get the optional DUT wrong passphrase to test connection failure self._wrong_passphrase = self._tc_parameters. \ get_param_value("WIFI_PASSPHRASE") # Get computer type self._computer = self._tc_parameters.get_param_value("COMPUTER") if self._computer == "": self._computer = None # empty computer: use second DUT # Get UECmdLayer self._networking_api = self._device.get_uecmd("Networking") # Load computer equipment if self._computer is not None: self._computer = self._em.get_computer(self._computer) self._wifi_interface = self._computer.get_wifi_interface() if self._wifi_interface == "": self._wifi_interface = None else: self._wifi_interface = None # Get PHONE2 self._phone2 = None self._networking_api2 = None if self._computer is None: self._phone2 = DeviceManager().get_device("PHONE2") if self._phone2 is not None: self._networking_api2 = self._phone2.get_uecmd("Networking") # init original wifi power status for phone1 self._original_wifi_power_status = 0 # init original flight mode for phone1 self._original_flight_mode = 0 self._interface_ip = None self._hotspot_ext_interface = \ str(self._dut_config.get("hotspotExtInterface")) # Set BT prerequisite (set ON, set OFF or nothing) for FIT BT/WIFI tests self._bt_fit_used, self._bt_wished_value = self._get_bt_fit_config() # BT initial state self._bt_initial_state = 'STATE_ON' # Instantiate generic UECmd self._localconnectivity_api = self._device.get_uecmd( "LocalConnectivity") # MAC Address of the STA device that will be connected to the softAP self._client_mac_address = ""
def __init__(self, tc_name, global_config): """ Constructor """ LiveDualPhoneBTBase.__init__(self, tc_name, global_config) # Get device_config and phone system apis self._dut2_config = DeviceManager().get_device_config("PHONE2") self._phonesystem_api = self._device.get_uecmd("PhoneSystem") self._phonesystem2_api = self._phone2.get_uecmd("PhoneSystem") # Get mandatory TC Parameters self._direction = str( self._tc_parameters.get_param_value("DIRECTION")).upper() self._filename = str(self._tc_parameters.get_param_value("FILENAME")) # Get optional TC Parameters self._is_bidirectional = \ str(self._tc_parameters.get_param_value("BOTH_DIRECTIONS", "")).lower() self._tp_enable = \ str(self._tc_parameters.get_param_value("THROUGHPUT_ENABLE", "")).lower() self._tp_margin = \ str(self._tc_parameters.get_param_value("ERROR_MARGIN", "")) # Will contain self._tp_margin value as an integer # If self._tp_margin is empty, by default _throughtput_margin will be 0. self._throughtput_margin = 0 # Format _is_bidirectional to boolean self._is_bidirectional = str_to_bool_ex(self._is_bidirectional) if self._is_bidirectional is None: self._is_bidirectional = False # Format _tp_enable to boolean self._tp_enable = str_to_bool_ex(self._tp_enable) # Initialize sender/receiver pointers self._sender_api = None self._sender_add = None self._sender_device = None self._sender_phonesys_api = None self._receiver_api = None self._receiver_add = None self._receiver_device = None self._receiver_phonesys_api = None # Get the Multimedia folder name self._multimedia_path1 = self._device.multimedia_path self._multimedia_path2 = DeviceManager().get_device( "PHONE2").multimedia_path self._fullpath_filenames = "" self._fp_filename_other_dir = "" # Initialize other protected attributes self._timeout1 = 0 self._timeout2 = 0 # Split the file names and strip each of them self._file_list = [ x.strip() for x in self._filename.split(self.FILE_NAME_SEPARATOR) ] # Initialize variables for average throughput calculation self._throughput_targets = None self._tp_meas = {} self._tp_meas_bidir = {}
def set_up(self): """ Initialize the test """ UseCaseBase.set_up(self) # Check if we have second wifi interface or second phone available if self._networking_api2 is None: msg = "PHONE2 is required in BenchConfig" self._logger.error(msg) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg) # store original wifi power status time.sleep(self._wait_btwn_cmd) self._original_wifi_power_status = \ self._networking_api.get_wifi_power_status() # store original flight mode time.sleep(self._wait_btwn_cmd) self._original_flight_mode = self._networking_api.get_flight_mode() # Enable/Disable flight mode if str_to_bool_ex(self._original_flight_mode) != str_to_bool_ex( self._flight_mode): time.sleep(self._wait_btwn_cmd) self._networking_api.set_flight_mode(self._flight_mode) # Enable Cellular Data connection if self._flight_mode == False and self._is_pdp_context_activated: time.sleep(self._wait_btwn_cmd) self._networking_api.activate_pdp_context() # disable wifi for Phone1 time.sleep(self._wait_btwn_cmd) self._networking_api.set_wifi_power("off") time.sleep(self._wait_btwn_cmd) self._networking_api.set_wifi_hotspot("off") # Boot the other phone (the DUT is already booted) if self._phone2.get_state() != "alive" \ or not self._phone2.is_available(): DeviceManager().boot_device("PHONE2") # If Bt to be (de-)activated for FIT tests if self._bt_fit_used: self._bt_initial_state = self._localconnectivity_api.get_bt_power_status( ) # if Bt is not at the wished value, set it to the correct one. if self._bt_initial_state != self._bt_wished_value: self._localconnectivity_api.set_bt_power(self._bt_wished_value) time.sleep(self._wait_btwn_cmd) # set wifi power on for Phone2 time.sleep(self._wait_btwn_cmd) self._networking_api2.set_wifi_power("on") # disconnect all wifi for Phone2 time.sleep(self._wait_btwn_cmd) self._networking_api2.wifi_remove_config("all") # Set networks as remembered SSIDs for security in self._hotspot_securities: # Build the SSID name ssid = self._hotspot_ssid_basename + "_" + security # set ssid for Phone2 as remembered network time.sleep(self._wait_btwn_cmd) self._networking_api2.set_wificonfiguration( ssid, self._hotspot_passphrase, security) # Need to restart Wifi interface to enable SSIDs self._networking_api2.set_wifi_power(0) time.sleep(self._wait_btwn_cmd) self._networking_api2.set_wifi_power(1) time.sleep(self._wait_btwn_cmd) self._networking_api2.set_wifi_sleep_policy( self._networking_api.WIFI_SLEEP_POLICY["NEVER"]) return Global.SUCCESS, "No error"
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveBTBase init function UseCaseBase.__init__(self, tc_name, global_config) # Get UECmdLayer self._bt_api = self._device.get_uecmd("LocalConnectivity") self._networking_api = self._device.get_uecmd("Networking") # Get TestCase parameters self._wifi_init_mode = self._tc_parameters.get_param_value("WIFI_INIT_MODE") self._bt_init_mode = self._tc_parameters.get_param_value("BT_INIT_MODE") self._nfc_init_mode = self._tc_parameters.get_param_value("NFC_INIT_MODE") self._nfc_beam_init_mode = self._tc_parameters.get_param_value("NFC_BEAM_INIT_MODE") self._hotspot_wifi_init_mode = self._tc_parameters.get_param_value("HOTSPOT_WIFI_INIT_MODE") self._hotspot_bt_init_mode = self._tc_parameters.get_param_value("HOTSPOT_BT_INIT_MODE") # Format TC parameter in order to have defined boolean or None values self._wifi_init_mode = str_to_bool_ex(self._wifi_init_mode) self._bt_init_mode = str_to_bool_ex(self._bt_init_mode) self._nfc_init_mode = str_to_bool_ex(self._nfc_init_mode) self._nfc_beam_init_mode = str_to_bool_ex(self._nfc_beam_init_mode) self._hotspot_wifi_init_mode = str_to_bool_ex(self._hotspot_wifi_init_mode) self._hotspot_bt_init_mode = str_to_bool_ex(self._hotspot_bt_init_mode) # Database of all functions to control and check features states self._DB = [{self._FEATURE_NAME: "WIFI", self._INIT_VALUE: self._wifi_init_mode, self._SET_ON: self._networking_api.set_wifi_power, self._SET_ON_PARAM: ['1'], self._SET_OFF: self._networking_api.set_wifi_power, self._SET_OFF_PARAM: ['0'], self._GET_STATE: self._networking_api.get_wifi_power_status, self._EXPECTED_ON: 1, self._EXPECTED_OFF: 0}, {self._FEATURE_NAME: "BT", self._INIT_VALUE: self._bt_init_mode, self._SET_ON: self._bt_api.set_bt_power, self._SET_ON_PARAM: ['1'], self._SET_OFF: self._bt_api.set_bt_power, self._SET_OFF_PARAM: ['0'], self._GET_STATE: self._bt_api.get_bt_power_status, self._EXPECTED_ON: str(BT_STATE.STATE_ON), # pylint: disable=E1101 self._EXPECTED_OFF: str(BT_STATE.STATE_OFF)}, # pylint: disable=E1101 {self._FEATURE_NAME: "NFC", self._INIT_VALUE: self._nfc_init_mode, self._SET_ON: self._bt_api.nfc_enable, self._SET_ON_PARAM: [], self._SET_OFF: self._bt_api.nfc_disable, self._SET_OFF_PARAM: [], self._GET_STATE: self._bt_api.get_nfc_status, self._EXPECTED_ON: "ON", self._EXPECTED_OFF: "OFF"}, {self._FEATURE_NAME: "NFC_BEAM", self._INIT_VALUE: self._nfc_beam_init_mode, self._SET_ON: self._bt_api.enable_nfc_beam, self._SET_ON_PARAM: [], self._SET_OFF: self._bt_api.disable_nfc_beam, self._SET_OFF_PARAM: [], self._GET_STATE: self._bt_api.get_nfc_beam_status, self._EXPECTED_ON: True, self._EXPECTED_OFF: False}, {self._FEATURE_NAME: "HOTSPOT_WIFI", self._INIT_VALUE: self._hotspot_wifi_init_mode, self._SET_ON: self._networking_api.set_wifi_hotspot, self._SET_ON_PARAM: ["on", self._WIFI_TETHERING_SSID, self._WIFI_TETHERING_SECURITY, self._WIFI_TETHERING_PASSPHRASE], self._SET_OFF: self._networking_api.set_wifi_hotspot, self._SET_OFF_PARAM: ['off'], self._GET_STATE: self._networking_api.get_wifi_hotspot_status, self._EXPECTED_ON: 1, self._EXPECTED_OFF: 0}, {self._FEATURE_NAME: "HOTSPOT_BT", self._INIT_VALUE: self._hotspot_bt_init_mode, self._SET_ON: self._bt_api.set_bt_tethering_power, self._SET_ON_PARAM: ['1'], self._SET_OFF: self._bt_api.set_bt_tethering_power, self._SET_OFF_PARAM: ['0'], self._GET_STATE: self._bt_api.get_bt_tethering_power, self._EXPECTED_ON: True, self._EXPECTED_OFF: False} ] self._apm_cycle_effect_config = dict() self._features_on = list() # Instantiate the Secondary Report object self._secondary_report = SecondaryTestReport(self._device.get_report_tree().get_report_path()) self._initial_flight_mode_state = 0