def setup_class(self): super(WifiTethering2GOpenOTATest, self).setup_class() ota_updater.initialize(self.user_params, self.android_devices) self.hotspot_device = self.android_devices[0] self.tethered_device = self.android_devices[1] req_params = ("wifi_hotspot_open", ) self.unpack_userparams(req_params) # verify hotspot device has lte data and supports tethering nutils.verify_lte_data_and_tethering_supported(self.hotspot_device) # Save a wifi soft ap configuration and verify that it works wutils.save_wifi_soft_ap_config(self.hotspot_device, self.wifi_hotspot_open, WIFI_CONFIG_APBAND_2G) self._verify_wifi_tethering() # Run OTA below, if ota fails then abort all tests. try: ota_updater.update(self.hotspot_device) except Exception as err: raise signals.TestAbortClass( "Failed up apply OTA update. Aborting tests")
def test_initialize(self): user_params = {'a': 1, 'b': 2, 'c': 3} android_devices = ['x', 'y', 'z'] with mock.patch('acts.libs.ota.ota_runners.ota_runner_factory.' 'create_from_configs') as fn: ota_updater.initialize(user_params, android_devices) for i in range(len(android_devices)): fn.assert_any_call(user_params, android_devices[i]) self.assertSetEqual(set(android_devices), set(ota_updater.ota_runners.keys()))
def setup_class(self): super(BtOtaTest, self).setup_class() ota_updater.initialize(self.user_params, self.android_devices) self.dut = self.android_devices[0] self.pre_ota_name = self.dut.droid.bluetoothGetLocalName() self.pre_ota_address = self.dut.droid.bluetoothGetLocalAddress() self.sec_address = self.android_devices[ 1].droid.bluetoothGetLocalAddress() # Pairing devices if not pair_pri_to_sec(self.dut, self.android_devices[1]): raise signals.TestAbortClass( "Failed to bond devices prior to update") #Run OTA below, if ota fails then abort all tests try: ota_updater.update(self.dut) except Exception as err: raise signals.TestAbortClass( "Failed up apply OTA update. Aborting tests")
def setup_class(self): super(WifiAutoUpdateTest, self).setup_class() ota_updater.initialize(self.user_params, self.android_devices) self.dut = self.android_devices[0] wutils.wifi_test_device_init(self.dut) req_params = [] opt_param = [ "open_network", "reference_networks", "iperf_server_address" ] self.unpack_userparams(req_param_names=req_params, opt_param_names=opt_param) if "AccessPoint" in self.user_params: self.legacy_configure_ap_and_start() asserts.assert_true( len(self.reference_networks) > 0, "Need at least two reference network with psk.") asserts.assert_true( len(self.open_network) > 0, "Need at least two open network with psk.") wutils.wifi_toggle_state(self.dut, True) self.wifi_config_list = [] # Disabling WiFi setup before OTA for debugging. # Setup WiFi and add few open and wpa networks before OTA. # self.add_network_and_enable(self.open_network[0]['2g']) # self.add_network_and_enable(self.reference_networks[0]['5g']) # Add few dummy networks to the list. # self.add_and_enable_dummy_networks() # Run OTA below, if ota fails then abort all tests. try: ota_updater.update(self.dut) except Exception as err: raise signals.TestAbortClass( "Failed up apply OTA update. Aborting tests")
def test_ota_upgrade(self): ota_package = self.user_params.get("ota_package") if isinstance(ota_package, list): ota_package = ota_package[0] if ota_package and "dev/null" not in ota_package: self.log.info("Upgrade with ota_package %s", ota_package) self.log.info("Before OTA upgrade: %s", get_info(self.android_devices)) else: raise signals.TestSkip("No ota_package is defined") ota_util = self.user_params.get("ota_util") if isinstance(ota_util, list): ota_util = ota_util[0] if ota_util: if "update_engine_client.zip" in ota_util: self.user_params["UpdateDeviceOtaTool"] = ota_util self.user_params["ota_tool"] = "UpdateDeviceOtaTool" else: self.user_params["AdbSideloadOtaTool"] = ota_util self.user_params["ota_tool"] = "AdbSideloadOtaTool" self.log.info("OTA upgrade with %s by %s", ota_package, self.user_params["ota_tool"]) ota_updater.initialize(self.user_params, self.android_devices) tasks = [(self._ota_upgrade, [ad]) for ad in self.android_devices] try: result = multithread_func(self.log, tasks) except Exception as err: abort_all_tests(self.log, "Unable to do ota upgrade: %s" % err) device_info = get_info(self.android_devices) self.log.info("After OTA upgrade: %s", device_info) self.results.add_controller_info("AndroidDevice", device_info) if len(self.android_devices) > 1: caller = self.android_devices[0] callee = self.android_devices[1] return call_setup_teardown( self.log, caller, callee, caller, self._get_call_verification_function(caller), self._get_call_verification_function(callee)) and result return result
def setup_class(self): ota_updater.initialize(self.user_params, self.android_devices) self.dut = self.android_devices[0]