/tools/tradefederation/core/tests/src/com/android/tradefed/util/ |
D | AbiFormatterTest.java | 19 import com.android.tradefed.device.ITestDevice; 48 ITestDevice device = EasyMock.createMock(ITestDevice.class); in testGetDefaultAbi() local 50 EasyMock.expect(device.getProperty("ro.product.cpu.abilist32")).andReturn(null); in testGetDefaultAbi() 51 EasyMock.expect(device.getProperty("ro.product.cpu.abi")).andReturn(null); in testGetDefaultAbi() 52 EasyMock.replay(device); in testGetDefaultAbi() 53 assertEquals(null, AbiFormatter.getDefaultAbi(device, "32")); in testGetDefaultAbi() 55 EasyMock.reset(device); in testGetDefaultAbi() 56 EasyMock.expect(device.getProperty(EasyMock.eq("ro.product.cpu.abilist32"))) in testGetDefaultAbi() 58 EasyMock.replay(device); in testGetDefaultAbi() 59 assertEquals("abi", AbiFormatter.getDefaultAbi(device, "32")); in testGetDefaultAbi() [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/targetprep/ |
D | CdmaDeviceFlasher.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 73 public void flash(ITestDevice device, IDeviceBuildInfo deviceBuild) throws TargetSetupError, in flash() argument 77 device.getSerialNumber(), deviceBuild.getBuildId())); in flash() 80 String systemBuildId = device.getBuildId(); in flash() 81 String systemBuildFlavor = device.getBuildFlavor(); in flash() 83 device.rebootIntoBootloader(); in flash() 85 downloadFlashingResources(device, deviceBuild); in flash() 87 checkAndFlashBootloader(device, deviceBuild); in flash() 88 if (checkShouldFlashBaseband(device, deviceBuild)) { in flash() [all …]
|
D | DeviceFlashPreparer.java | 23 import com.android.tradefed.device.DeviceNotAvailableException; 24 import com.android.tradefed.device.DeviceUnresponsiveException; 25 import com.android.tradefed.device.IDeviceManager; 26 import com.android.tradefed.device.ITestDevice; 27 import com.android.tradefed.device.ITestDevice.RecoveryMode; 165 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 171 CLog.i("Performing setup on %s", device.getSerialNumber()); in setUp() 183 checkDeviceProductType(device, deviceBuild); in setUp() 184 device.setRecoveryMode(RecoveryMode.ONLINE); in setUp() 185 IDeviceFlasher flasher = createFlasher(device); in setUp() [all …]
|
D | FastbootDeviceFlasher.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 23 import com.android.tradefed.device.TestDeviceState; 138 public void flash(ITestDevice device, IDeviceBuildInfo deviceBuild) throws TargetSetupError, in flash() argument 141 CLog.i("Flashing device %s with build %s", device.getSerialNumber(), in flash() 145 String systemBuildId = device.getBuildId(); in flash() 146 String systemBuildFlavor = device.getBuildFlavor(); in flash() 148 device.rebootIntoBootloader(); in flash() 150 downloadFlashingResources(device, deviceBuild); in flash() 151 preFlashSetup(device, deviceBuild); in flash() [all …]
|
D | DeviceCleaner.java | 22 import com.android.tradefed.device.DeviceNotAvailableException; 23 import com.android.tradefed.device.DeviceUnresponsiveException; 24 import com.android.tradefed.device.ITestDevice; 25 import com.android.tradefed.device.TestDeviceState; 74 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 80 public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e) in tearDown() argument 85 device.executeShellCommand("stop"); in tearDown() 90 clean(device); in tearDown() 97 protected void clean(ITestDevice device) throws DeviceNotAvailableException { in clean() argument 98 if (TestDeviceState.ONLINE.equals(device.getDeviceState())) { in clean() [all …]
|
D | WifiPreparer.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 57 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 63 if (!device.isWifiEnabled()) { in setUp() 65 "The device does not have wifi enabled.", device.getDeviceDescriptor()); in setUp() 66 } else if (!device.checkConnectivity()) { in setUp() 68 "The device has no wifi connection.", device.getDeviceDescriptor()); in setUp() 74 throw new TargetSetupError("wifi-network not specified", device.getDeviceDescriptor()); in setUp() 77 if (!device.connectToWifiNetworkIfNeeded(mWifiNetwork, mWifiPsk)) { in setUp() 79 mWifiNetwork, device.getSerialNumber()), device.getDeviceDescriptor()); in setUp() [all …]
|
D | AppSetup.java | 23 import com.android.tradefed.device.CollectingOutputReceiver; 24 import com.android.tradefed.device.DeviceNotAvailableException; 25 import com.android.tradefed.device.ITestDevice; 88 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 94 CLog.i("Performing setup on %s", device.getSerialNumber()); in setUp() 97 if (mUninstallAll && !uninstallAllApps(device)) { in setUp() 102 "Failed to uninstall apps on %s", device.getSerialNumber()), in setUp() 103 device.getSerialNumber()); in setUp() 113 apkFile.getFile().getName()), device.getDeviceDescriptor()); in setUp() 115 if (device.getApiLevel() < aaptParser.getSdkVersion()) { in setUp() [all …]
|
D | DeviceWiper.java | 22 import com.android.tradefed.device.DeviceNotAvailableException; 23 import com.android.tradefed.device.ITestDevice; 37 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 43 device.rebootIntoBootloader(); in setUp() 45 doErase(device); in setUp() 47 doFormat(device); in setUp() 49 device.executeFastbootCommand("reboot"); in setUp() 50 device.waitForDeviceAvailable(); in setUp() 53 private void doFormat(ITestDevice device) throws DeviceNotAvailableException, TargetSetupError { in doFormat() argument 55 CommandResult r = device.executeLongFastbootCommand("-w"); in doFormat() [all …]
|
D | SystemUpdaterDeviceFlasher.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 67 public void flash(ITestDevice device, IDeviceBuildInfo deviceBuild) in flash() argument 69 CLog.i("Flashing device %s with build %s", device.getSerialNumber(), in flash() 76 if (installUpdate(device, deviceBuild)) { in flash() 78 mTestsZipInstaller.pushTestsZipOntoData(device, deviceBuild); in flash() 80 device.reboot(); in flash() 85 private boolean installUpdate(ITestDevice device, IDeviceBuildInfo deviceBuild) in installUpdate() argument 89 if (!mForceSystemFlash && deviceBuild.getDeviceBuildId().equals(device.getBuildId())) { in installUpdate() 90 CLog.i("System is already version %s, skipping install" , device.getBuildId()); in installUpdate() [all …]
|
D | RestartSystemServerTargetPreparer.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 37 private void restartSystemServer(ITestDevice device) throws DeviceNotAvailableException { in restartSystemServer() argument 38 device.enableAdbRoot(); in restartSystemServer() 39 device.executeShellCommand("setprop dev.bootcomplete 0"); in restartSystemServer() 40 device.executeShellCommand(KILL_SERVER_COMMAND); in restartSystemServer() 41 device.waitForDeviceAvailable(); in restartSystemServer() 45 public void setUp(ITestDevice device, IBuildInfo buildInfo) in setUp() argument 50 restartSystemServer(device); in setUp() 54 public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e) in tearDown() argument [all …]
|
D | DeviceSetup.java | 23 import com.android.tradefed.device.DeviceNotAvailableException; 24 import com.android.tradefed.device.ITestDevice; 25 import com.android.tradefed.device.StubDevice; 415 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws DeviceNotAvailableException, in setUp() argument 421 CLog.i("Performing setup on %s", device.getSerialNumber()); in setUp() 423 if (device.getOptions().isEnableAdbRoot() && !device.enableAdbRoot()) { in setUp() 425 device.getSerialNumber()), device.getDeviceDescriptor()); in setUp() 429 processDeprecatedOptions(device); in setUp() 431 processOptions(device); in setUp() 433 changeSystemProps(device); in setUp() [all …]
|
D | AdditionalFilesInstaller.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 45 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 47 removeFiles(device); in setUp() 53 if (!device.pushFile(file, remotePath)) { in setUp() 55 file.getName(), remotePath), device.getDeviceDescriptor()); in setUp() 64 public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable t) in tearDown() argument 67 removeFiles(device); in tearDown() 81 private void removeFiles(ITestDevice device) throws DeviceNotAvailableException, in removeFiles() argument 85 device.executeShellCommand(String.format("rm -r %s*", DEST_PATH)); in removeFiles() [all …]
|
D | InstallAllTestZipAppsSetup.java | 22 import com.android.tradefed.device.DeviceNotAvailableException; 23 import com.android.tradefed.device.ITestDevice; 86 public void setUp(ITestDevice device, IBuildInfo buildInfo) in setUp() argument 92 File testsZip = getZipFile(device, buildInfo); in setUp() 96 "Failed to find a valid test zip directory.", device.getDeviceDescriptor()); in setUp() 103 "Failed to extract test zip.", e, device.getDeviceDescriptor()); in setUp() 107 installApksRecursively(testsDir, device); in setUp() 119 File getZipFile(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError { in getZipFile() argument 121 throw new TargetSetupError("test-zip-name is null.", device.getDeviceDescriptor()); in getZipFile() 134 void installApksRecursively(File directory, ITestDevice device) in installApksRecursively() argument [all …]
|
D | DeviceStringPusher.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 42 public void setUp(ITestDevice device, IBuildInfo buildInfo) in setUp() argument 44 if (device.doesFileExist(mFileName)) { in setUp() 45 mOldContents = device.pullFile(mFileName); in setUp() 47 if (!device.pushString(mFileContent, mFileName)) { in setUp() 49 "Failed to push string to file", device.getDeviceDescriptor()); in setUp() 54 public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e) in tearDown() argument 57 device.executeShellCommand(String.format("rm -f %s", mFileName)); in tearDown() 59 device.pushFile(mOldContents, mFileName); in tearDown()
|
D | AllTestAppsInstallSetup.java | 24 import com.android.tradefed.device.DeviceNotAvailableException; 25 import com.android.tradefed.device.ITestDevice; 73 public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError, in setUp() argument 77 device.getDeviceDescriptor()); in setUp() 83 device.getDeviceDescriptor()); in setUp() 85 resolveAbi(device); in setUp() 86 installApksRecursively(testsDir, device); in setUp() 97 void installApksRecursively(File directory, ITestDevice device) in installApksRecursively() argument 100 throw new TargetSetupError("Invalid test zip directory!", device.getDeviceDescriptor()); in installApksRecursively() 106 installApksRecursively(f, device); in installApksRecursively() [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/util/ |
D | BluetoothUtils.java | 19 import com.android.tradefed.device.CollectingOutputReceiver; 20 import com.android.tradefed.device.DeviceNotAvailableException; 21 import com.android.tradefed.device.ITestDevice; 71 public static String runBluetoothInstrumentation(ITestDevice device, String command) in runBluetoothInstrumentation() argument 74 device.executeShellCommand(String.format(BT_INSTR_CMD, command), receiver); in runBluetoothInstrumentation() 81 public static boolean runBluetoothInstrumentationWithRetry(ITestDevice device, String command) in runBluetoothInstrumentationWithRetry() argument 84 String output = runBluetoothInstrumentation(device, command); in runBluetoothInstrumentationWithRetry() 98 public static boolean unpairWithRetry(ITestDevice device) in unpairWithRetry() argument 100 return runBluetoothInstrumentationWithRetry(device, "unpairAll"); in unpairWithRetry() 110 public static String getBluetoothMac(ITestDevice device) throws DeviceNotAvailableException { in getBluetoothMac() argument [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/targetprep/companion/ |
D | CompanionDeviceTracker.java | 21 import com.android.tradefed.device.DeviceSelectionOptions; 22 import com.android.tradefed.device.FreeDeviceState; 23 import com.android.tradefed.device.IDeviceManager; 24 import com.android.tradefed.device.ITestDevice; 25 import com.android.tradefed.device.TestDeviceState; 61 public ITestDevice allocateCompanionDevice(ITestDevice device, DeviceSelectionOptions opt) { in allocateCompanionDevice() argument 64 if (mDeviceMapping.containsKey(device)) { in allocateCompanionDevice() 66 device.getSerialNumber(), mDeviceMapping.get(companion).getSerialNumber()); in allocateCompanionDevice() 69 companion.getSerialNumber(), device.getSerialNumber()); in allocateCompanionDevice() 70 mDeviceMapping.put(device, companion); in allocateCompanionDevice() [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/build/ |
D | DeviceBuildDescriptor.java | 18 import com.android.tradefed.device.DeviceNotAvailableException; 19 import com.android.tradefed.device.ITestDevice; 98 public static void injectDeviceAttributes(ITestDevice device, IBuildInfo b) in injectDeviceAttributes() argument 100 b.addBuildAttribute(DEVICE_BUILD_ID, device.getBuildId()); in injectDeviceAttributes() 101 b.addBuildAttribute(DEVICE_BUILD_ALIAS, device.getBuildAlias()); in injectDeviceAttributes() 102 String buildFlavor = String.format("%s-%s", device.getProperty("ro.product.name"), in injectDeviceAttributes() 103 device.getProperty("ro.build.type")); in injectDeviceAttributes() 105 b.addBuildAttribute(DEVICE_DESC, generateDeviceDesc(device)); in injectDeviceAttributes() 106 b.addBuildAttribute(DEVICE_PRODUCT, generateDeviceProduct(device)); in injectDeviceAttributes() 119 public static String generateDeviceDesc(ITestDevice device) in generateDeviceDesc() argument [all …]
|
D | BootstrapBuildProvider.java | 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 23 import com.android.tradefed.device.StubDevice; 98 public IBuildInfo getBuild(ITestDevice device) throws BuildRetrievalError, in getBuild() argument 103 buildId = device.getBuildId(); in getBuild() 106 if (!(device.getIDevice() instanceof StubDevice)) { in getBuild() 107 if (!device.waitForDeviceShell(mShellAvailableTimeout * 1000)) { in getBuild() 112 device.getSerialNumber()); in getBuild() 118 device.getProperty("ro.product.brand"), in getBuild() 119 device.getProperty("ro.product.name"), in getBuild() [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/device/metric/ |
D | TemperatureCollector.java | 16 package com.android.tradefed.device.metric; 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 85 void collect(ITestDevice device, DeviceMetricData runData) throws InterruptedException { in collect() argument 90 if (!device.isAdbRoot()) { in collect() 93 Double temp = getTemperature(device); in collect() 97 if (mValues.get(device) == null) { in collect() 98 mValues.put(device, DoubleValues.newBuilder()); in collect() 100 mValues.get(device).addDoubleValue(temp); in collect() 101 mMaxDeviceTemps.putIfAbsent(device, temp); in collect() [all …]
|
D | ProcessMaxMemoryCollector.java | 16 package com.android.tradefed.device.metric; 21 import com.android.tradefed.device.DeviceNotAvailableException; 22 import com.android.tradefed.device.ITestDevice; 67 for (ITestDevice device : getDevices()) { in onStart() 68 mMemoryData.put(device, new DeviceMemoryData()); in onStart() 69 mPssMemoryPerProcess.put(device, new HashMap<>()); in onStart() 70 mUssMemoryPerProcess.put(device, new HashMap<>()); in onStart() 75 void collect(ITestDevice device, DeviceMetricData runData) throws InterruptedException { in collect() argument 77 Map<String, Long> procPss = mMemoryData.get(device).mProcPss; in collect() 78 Map<String, Long> procUss = mMemoryData.get(device).mProcUss; in collect() [all …]
|
/tools/test/connectivity/acts/framework/tests/libs/ota/ota_runners/ |
D | ota_runner_factory_test.py | 32 self.device = mock.MagicMock() 33 self.device.serial = 'fake_serial' 39 acts_config, 'ota_tool', self.device) 45 acts_config, 'ota_tool', self.device) 56 acts_config, 'ota_tool', self.device) 65 ota_runner_factory.create_from_configs(acts_config, self.device) 80 ota_runner_factory.create_from_configs(acts_config, self.device) 81 mocked_function.assert_called_with('jkl;', 'qaz', self.device, 96 ota_runner_factory.create_from_configs(acts_config, self.device) 97 mocked_function.assert_called_with('jkl;', 'qaz', self.device, [all …]
|
D | ota_runner_test.py | 67 device = mock.MagicMock() 69 runner = OtaRunnerImpl(tool, device) 72 device.stop_services.assert_called() 73 device.wait_for_boot_completion.assert_called() 74 device.start_services.assert_called() 75 device.adb.install.assert_called() 79 device = mock.MagicMock() 81 runner = OtaRunnerImpl(tool, device) 90 device = mock.MagicMock() 92 runner = ota_runner.OtaRunner(tool, device) [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/device/ |
D | DeviceSelectionOptions.java | 16 package com.android.tradefed.device; 20 import com.android.tradefed.device.DeviceManager.FastbootDevice; 169 public Collection<String> getSerials(IDevice device) { in getSerials() argument 173 if (env_serial != null && !(device instanceof StubDevice)) { in getSerials() 360 public boolean matches(IDevice device) { in matches() argument 361 Collection<String> serials = getSerials(device); in matches() 368 !serials.contains(device.getSerialNumber())) { in matches() 371 if (excludeSerials.contains(device.getSerialNumber())) { in matches() 375 String productType = getDeviceProductType(device); in matches() 378 String productVariant = getDeviceProductVariant(device); in matches() [all …]
|
/tools/test/connectivity/acts/framework/tests/libs/ota/ |
D | ota_updater_test.py | 63 device = MockAndroidDevice('serial') 65 device: ota_runner.OtaRunner('tool', device) 68 ota_updater._check_initialization(device) 73 device = MockAndroidDevice('serial') 76 ota_updater._check_initialization(device) 79 device = MockAndroidDevice('serial') 82 ota_updater.ota_runners = {device: runner} 84 ota_updater.update(device) 87 device = MockAndroidDevice('serial') 90 ota_updater.ota_runners = {device: runner} [all …]
|