def tear_down(self): #disconnect tethering self._bluetooth_connectivity_obj.disconnect_bt_tethering_and_pan(self._bt_tethering_deactivation_test, self._nap_api, self._who_disconnect, self._panu_api, self._nap_addr, self._panu_addr) # Bluetooth unpairing self._logger.info("Unpair both devices") paired = False list_paired_devices = self._panu_api.list_paired_device() for element in list_paired_devices: if str(element.address).upper() == str(self._phone2_addr).upper(): paired = True if paired: self._bt_api.unpair_bt_device(self._phone2_addr) self._bt_api2.unpair_bt_device(self._phone1_addr) else: pass # Disconnect and clear WiFi networks if self._connection_to_share == "WIFI": self._wifi_api.wifi_remove_config("all") self._wifi_api.set_wifi_power("off") LiveDualPhoneBTBase.tear_down(self) result, output = Global.SUCCESS, "" return result, output
def tear_down(self): """ Finish the test and clear environment """ # Call UseCase base tear_down function LiveDualPhoneBTBase.tear_down(self) # Clear OPP transfer opp_terminate(self._device, self._phone2) # Delete sent file if self._dut_state == "DUT_CLIENT": self._bt_api2.bt_opp_init(self._opp_local_file) else: self._bt_api.bt_opp_init(self._opp_local_file) return Global.SUCCESS, "No errors"
def tear_down(self): """ Execute the test """ # Call UseCase base tear_down function LiveDualPhoneBTBase.tear_down(self) # Clear OPP transfer opp_terminate(self._device, self._phone2) # Delete sent file if self._dut_state == "DUT_CLIENT": self._bt_api2.bt_opp_init(self._opp_local_file) else: self._bt_api.bt_opp_init(self._opp_local_file) # Disable WiFi self._networking_api.set_wifi_power(0) return Global.SUCCESS, "No errors"
def tear_down(self): """ Execute the test """ # Call UseCase base tear_down function LiveDualPhoneBTBase.tear_down(self) # Clear OPP transfer opp_terminate(self._device, self._phone2) # WiFi configure if needed if self._component_use == "USE_WIFI" or self._component_use == "USE_BT_AND_WIFI": self._networking_api.set_wifi_power(0) # Delete sent file if self._dut_state == "DUT_CLIENT": self._bt_api2.bt_opp_init(self._opp_local_file) else: self._bt_api.bt_opp_init(self._opp_local_file) return Global.SUCCESS, "No errors"