/tools/tradefederation/core/tests/src/com/android/tradefed/util/ |
D | FileUtilTest.java | 344 File tmpDir = FileUtil.createTempDir("find_files_test"); in testFindFilesSuccess() local 346 File matchFile1 = FileUtil.createTempFile("test", ".config", tmpDir); in testFindFilesSuccess() 347 File subDir = new File(tmpDir, "subfolder"); in testFindFilesSuccess() 351 Set<String> matchFiles = FileUtil.findFiles(tmpDir, ".*.config"); in testFindFilesSuccess() 356 FileUtil.recursiveDelete(tmpDir); in testFindFilesSuccess() 366 File tmpDir = FileUtil.createTempDir("find_files_test"); in testFindFilesSuccess_symlink() local 369 File matchFile1 = FileUtil.createTempFile("test", ".config", tmpDir); in testFindFilesSuccess_symlink() 371 File destLink = new File(tmpDir, "subFolder"); in testFindFilesSuccess_symlink() 374 Set<String> matchFiles = FileUtil.findFiles(tmpDir, ".*.config"); in testFindFilesSuccess_symlink() 382 FileUtil.recursiveDelete(tmpDir); in testFindFilesSuccess_symlink() [all …]
|
D | ZipUtilTest.java | 207 File tmpDir = null; in testPartipUnzip() local 225 tmpDir = FileUtil.createTempDir("partial_unzip"); in testPartipUnzip() 234 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 254 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 285 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 304 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 323 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 342 targetFile = new File(Paths.get(tmpDir.toString(), zipEntry.getFileName()).toString()); in testPartipUnzip() 355 FileUtil.recursiveDelete(tmpDir); in testPartipUnzip() 366 File tmpDir = null; in testPartialUnzipWithUseZip64() local [all …]
|
D | FileUtilFuncTest.java | 129 File tmpDir = createTempDir("foo"); in testCreateTempDir() local 130 assertTrue(tmpDir.exists()); in testCreateTempDir() 131 assertTrue(tmpDir.isDirectory()); in testCreateTempDir()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/ |
D | BaseTestSuiteTest.java | 106 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_noMatch() local 107 File moduleConfig = new File(tmpDir, "module_name.config"); in testSetupFilters_noMatch() 112 mRunner.setupFilters(tmpDir); in testSetupFilters_noMatch() 117 FileUtil.recursiveDelete(tmpDir); in testSetupFilters_noMatch() 124 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_match_parameterized() local 125 createConfig(tmpDir, "CtsGestureTestCases.config"); in testSetupFilters_match_parameterized() 132 mRunner.setupFilters(tmpDir); in testSetupFilters_match_parameterized() 146 FileUtil.recursiveDelete(tmpDir); in testSetupFilters_match_parameterized() 156 File tmpDir = FileUtil.createTempDir(TEST_MODULE); in testSetupFilters_parameterized_filter() local 157 createConfig(tmpDir, "CtsGestureTestCases.config"); in testSetupFilters_parameterized_filter() [all …]
|
D | AtestRunnerTest.java | 146 File tmpDir = FileUtil.createTempDir("some-dir"); in testLoadTests_WithModuleAndTFConfigSpecified() local 147 String filePath = createModuleConfig(tmpDir, "TestModule"); in testLoadTests_WithModuleAndTFConfigSpecified() 149 mSpyRunner.setupFilters(tmpDir); in testLoadTests_WithModuleAndTFConfigSpecified() 161 FileUtil.recursiveDelete(tmpDir); in testLoadTests_WithModuleAndTFConfigSpecified() 167 File tmpDir = FileUtil.createTempDir("some-dir"); in testLoadTests_WithModuleConfigSpecified() local 168 String filePath = createModuleConfig(tmpDir, "TestModule"); in testLoadTests_WithModuleConfigSpecified() 170 mSpyRunner.setupFilters(tmpDir); in testLoadTests_WithModuleConfigSpecified() 178 FileUtil.recursiveDelete(tmpDir); in testLoadTests_WithModuleConfigSpecified()
|
D | TfSuiteRunnerTest.java | 265 File tmpDir = null; in testLoadTests_additionalTestsZip() local 269 tmpDir = FileUtil.createTempDir("test"); in testLoadTests_additionalTestsZip() 273 File zipDir = FileUtil.getFileForPath(tmpDir, "suite"); in testLoadTests_additionalTestsZip() 309 FileUtil.recursiveDelete(tmpDir); in testLoadTests_additionalTestsZip()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/config/ |
D | ConfigurationUtilTest.java | 146 File tmpDir = null; in testGetConfigNamesFromDirs() local 148 tmpDir = FileUtil.createTempDir("test_configs_dir"); in testGetConfigNamesFromDirs() 150 File config1 = FileUtil.createTempFile("config", ".config", tmpDir); in testGetConfigNamesFromDirs() 153 File subDir = FileUtil.getFileForPath(tmpDir, "sub"); in testGetConfigNamesFromDirs() 160 ConfigurationUtil.getConfigNamesFromDirs("sub", Arrays.asList(tmpDir)); in testGetConfigNamesFromDirs() 165 configs = ConfigurationUtil.getConfigNamesFromDirs("", Arrays.asList(tmpDir)); in testGetConfigNamesFromDirs() 170 FileUtil.recursiveDelete(tmpDir); in testGetConfigNamesFromDirs() 180 File tmpDir = null; in testGetConfigNamesFromDirs_patterns() local 182 tmpDir = FileUtil.createTempDir("test_configs_dir"); in testGetConfigNamesFromDirs_patterns() 184 FileUtil.createTempFile("whatevername", ".whateverextension", tmpDir); in testGetConfigNamesFromDirs_patterns() [all …]
|
D | ConfigurationFactoryTest.java | 1526 File tmpDir = externalConfig.getParentFile(); in testSearchConfigFromEnvVar() local 1529 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testSearchConfigFromEnvVar() 1544 File tmpDir = FileUtil.createTempDir("config-check-var"); in testSearchConfigFromEnvVarFailed() local 1547 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testSearchConfigFromEnvVarFailed() 1552 FileUtil.recursiveDelete(tmpDir); in testSearchConfigFromEnvVarFailed() 1561 File tmpDir = FileUtil.createTempDir("test-config-dir"); in testGetConfigNamesFromTestCases_subpath() local 1563 File config1 = FileUtil.createTempFile("testconfig1", ".config", tmpDir); in testGetConfigNamesFromTestCases_subpath() 1565 File subDir = FileUtil.createTempDir("subdir", tmpDir); in testGetConfigNamesFromTestCases_subpath() 1569 Mockito.doReturn(Arrays.asList(tmpDir)).when(spyFactory).getExternalTestCasesDirs(); in testGetConfigNamesFromTestCases_subpath() 1577 FileUtil.recursiveDelete(tmpDir); in testGetConfigNamesFromTestCases_subpath()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/device/ |
D | TestDeviceStressTest.java | 59 File tmpDir = null; in createTempTestFiles() local 62 tmpDir = FileUtil.createTempDir("testDir"); in createTempTestFiles() 66 tmpFile = FileUtil.createTempFile(String.format("tmp_%d", i), ".txt", tmpDir); in createTempTestFiles() 69 return tmpDir; in createTempTestFiles() 111 File tmpDir = null; in testPushFolderWithManyFiles() local 121 tmpDir = createTempTestFiles(); in testPushFolderWithManyFiles() 126 assertTrue(mTestDevice.pushDir(tmpDir, deviceFilePath)); in testPushFolderWithManyFiles() 130 if (tmpDir != null) { in testPushFolderWithManyFiles() 131 FileUtil.recursiveDelete(tmpDir); in testPushFolderWithManyFiles() 143 File tmpDir = null; in testSyncDataWithManyFiles() local [all …]
|
D | TestDeviceFuncTest.java | 438 File tmpDir = FileUtil.createTempDir("tmp"); in doTestSyncFiles() local 440 File tmpFile = createTempTestFile(tmpDir); in doTestSyncFiles() 445 tmpDir.getName(), tmpFile.getName()); in doTestSyncFiles() 447 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles() 454 File tmpFile2 = createTempTestFile(tmpDir); in doTestSyncFiles() 456 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles() 458 tmpDir.getName(), tmpFile2.getName()); in doTestSyncFiles() 472 assertTrue(mTestDevice.syncFiles(tmpDir, externalStorePath)); in doTestSyncFiles() 481 FileUtil.recursiveDelete(tmpDir); in doTestSyncFiles() 493 File tmpDir = FileUtil.createTempDir("tmp", rootDir); in testPushDir() local [all …]
|
D | DeviceManagerTest.java | 396 File tmpDir = FileUtil.createTempDir("fake-fastbootdir"); in testUnpackZippedFastboot() local 397 File fastboot = new File(tmpDir, "fastboot"); in testUnpackZippedFastboot() 399 File zipDir = ZipUtil.createZip(tmpDir); in testUnpackZippedFastboot() 410 FileUtil.recursiveDelete(tmpDir); in testUnpackZippedFastboot()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/suite/ |
D | SuiteApkInstallerTest.java | 97 File tmpDir = FileUtil.createTempDir("suite-apk-installer"); in testGetTestsDir_notDir() local 98 mTestInfo.executionFiles().put(FilesKey.TESTS_DIRECTORY, tmpDir); in testGetTestsDir_notDir() 99 File apkFile = FileUtil.createTempFile("apk-test", ".apk", tmpDir); in testGetTestsDir_notDir() 106 FileUtil.recursiveDelete(tmpDir); in testGetTestsDir_notDir() 150 File tmpDir = null; in testGetLocalPathForFileName_testsDir() local 152 tmpDir = FileUtil.createTempDir("test"); in testGetLocalPathForFileName_testsDir() 153 mTestInfo.executionFiles().put(FilesKey.TESTS_DIRECTORY, tmpDir); in testGetLocalPathForFileName_testsDir() 154 File tmpApk = FileUtil.createTempFile("suite-apk-installer", ".apk", tmpDir); in testGetLocalPathForFileName_testsDir() 161 FileUtil.recursiveDelete(tmpDir); in testGetLocalPathForFileName_testsDir() 185 File tmpDir = null; in testGetLocalPathForFileName_remoteZip() local [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/targetprep/ |
D | GkiDeviceFlashPreparer.java | 85 File tmpDir = null; in setUp() local 87 tmpDir = FileUtil.createTempDir("gki_preparer"); in setUp() 88 validateGkiBootImg(device, buildInfo, tmpDir); in setUp() 93 FileUtil.recursiveDelete(tmpDir); in setUp() 202 protected void validateGkiBootImg(ITestDevice device, IDeviceBuildInfo buildInfo, File tmpDir) in validateGkiBootImg() argument 207 device, mBootImageFileName, buildInfo.getFile(GKI_BOOT_IMG), tmpDir); in validateGkiBootImg() 227 getRequestedFile(device, MKBOOTIMG, buildInfo.getFile(OTATOOLS_ZIP), tmpDir); in validateGkiBootImg() 228 mBootImg = FileUtil.createTempFile("boot", ".img", tmpDir); in validateGkiBootImg() 299 ITestDevice device, String requestedFileName, File sourceFile, File tmpDir) in getRequestedFile() argument 305 FileUtil.createTempDir(FileUtil.getBaseName(sourceFile.getName()), tmpDir); in getRequestedFile()
|
D | GsiDeviceFlashPreparer.java | 104 File tmpDir = null; in setUp() local 106 tmpDir = FileUtil.createTempDir("gsi_preparer"); in setUp() 107 validateGsiImg(device, buildInfo, tmpDir); in setUp() 112 FileUtil.recursiveDelete(tmpDir); in setUp() 231 private void validateGsiImg(ITestDevice device, IDeviceBuildInfo buildInfo, File tmpDir) in validateGsiImg() argument 245 device, mSystemImageFileName, buildInfo.getFile(GSI_SYSTEM_IMG), tmpDir); in validateGsiImg() 248 device, mVbmetaImageFileName, buildInfo.getFile(GSI_VBMETA_IMG), tmpDir); in validateGsiImg() 253 device, mBootImageFileName, buildInfo.getFile(GKI_BOOT_IMG), tmpDir); in validateGsiImg() 293 ITestDevice device, String requestedFileName, File sourceFile, File tmpDir) in getRequestedFile() argument 299 FileUtil.createTempDir(FileUtil.getBaseName(sourceFile.getName()), tmpDir); in getRequestedFile()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/ |
D | TfTestLauncherTest.java | 180 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_success() local 181 Mockito.when(tmpDir.list()) in testTestTmpDirClean_success() 185 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_success() 205 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_failExtraFile() local 206 Mockito.when(tmpDir.list()).thenReturn(new String[] {"extra_file"}); in testTestTmpDirClean_failExtraFile() 208 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_failExtraFile() 228 File tmpDir = Mockito.mock(File.class); in testTestTmpDirClean_failMultipleFiles() local 229 Mockito.when(tmpDir.list()).thenReturn(new String[] {"inv_1", "inv_2"}); in testTestTmpDirClean_failMultipleFiles() 231 mTfTestLauncher.testTmpDirClean(tmpDir, mMockListener); in testTestTmpDirClean_failMultipleFiles()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/sandbox/ |
D | TradefedSandboxTest.java | 262 File tmpDir = FileUtil.createTempDir("tmp-sandbox-dir"); in testSandboxOptions() local 268 setter.setOptionValue("sandbox:tf-location", tmpDir.getAbsolutePath()); in testSandboxOptions() 276 assertEquals(tmpDir, res); in testSandboxOptions() 278 FileUtil.recursiveDelete(tmpDir); in testSandboxOptions() 288 File tmpDir = FileUtil.createTempDir("tmp-sandbox-dir"); in testSandboxOptions_exclusion() local 294 setter.setOptionValue("sandbox:tf-location", tmpDir.getAbsolutePath()); in testSandboxOptions_exclusion() 311 FileUtil.recursiveDelete(tmpDir); in testSandboxOptions_exclusion()
|
/tools/tradefederation/core/common_util/com/android/tradefed/util/ |
D | FileUtil.java | 300 File tmpDir = File.createTempFile(prefix, "", parentDir); in createTempDir() local 301 return deleteFileAndCreateDirWithSameName(tmpDir); in createTempDir() 304 private static File deleteFileAndCreateDirWithSameName(File tmpDir) throws IOException { in deleteFileAndCreateDirWithSameName() argument 305 tmpDir.delete(); in deleteFileAndCreateDirWithSameName() 306 return createDir(tmpDir); in deleteFileAndCreateDirWithSameName() 309 private static File createDir(File tmpDir) throws IOException { in createDir() argument 310 if (!tmpDir.mkdirs()) { in createDir() 313 return tmpDir; in createDir()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/adb/ |
D | AdbStopServerPreparerTest.java | 188 File tmpDir = FileUtil.createTempDir("adb-preparer-tests"); in testAdbFromEnv() local 190 FileUtil.mkdirsRWX(new File(tmpDir, "bin")); in testAdbFromEnv() 191 File fakeAdb = new File(tmpDir, "bin/adb"); in testAdbFromEnv() 193 mEnvironment = tmpDir.getAbsolutePath(); in testAdbFromEnv() 216 FileUtil.recursiveDelete(tmpDir); in testAdbFromEnv()
|
/tools/tradefederation/contrib/src/com/android/media/tests/ |
D | Camera2StressTest.java | 109 File tmpDir = null; in postScreenshotOnFailure() local 113 tmpDir = FileUtil.createTempDir("screenshot"); in postScreenshotOnFailure() 123 File screenshot = new File(tmpDir, remoteFile.getName()); in postScreenshotOnFailure() 139 FileUtil.recursiveDelete(tmpDir); in postScreenshotOnFailure()
|
/tools/tradefederation/core/tests/src/com/android/tradefed/build/ |
D | BootstrapBuildProviderTest.java | 89 File tmpDir = FileUtil.createTempDir("tmp"); in testGetBuild_add_extra_file() local 90 File file_1 = new File(tmpDir, "sys.img"); in testGetBuild_add_extra_file() 102 FileUtil.recursiveDelete(tmpDir); in testGetBuild_add_extra_file()
|
/tools/tradefederation/core/src/com/android/tradefed/invoker/ |
D | InvocationExecution.java | 889 String tmpDir = "/tmp"; 891 tmpDir = System.getenv("TMPDIR"); 901 File adbLog = new File(tmpDir, String.format("adb.%s.log", uid));
|
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/ |
D | TestFilePushSetupTest.java | 80 File tmpDir = mAltDirFile1.getParentFile(); in tearDown() local 83 FileUtil.recursiveDelete(tmpDir); in tearDown()
|
/tools/tradefederation/core/src/com/android/tradefed/testtype/ |
D | TfTestLauncher.java | 351 protected void testTmpDirClean(File tmpDir, ITestInvocationListener listener) { in testTmpDirClean() argument 355 String[] listFiles = tmpDir.list(); in testTmpDirClean()
|