am a8a4d76b: am 74a67191: Merge "Support running vm-tests-tf CTS package on Windows environment"
* commit 'a8a4d76b778f4a346e03a5cfccdef3fc94d525f2':
Support running vm-tests-tf CTS package on Windows environment
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/VMHostTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/VMHostTest.java
index e972640..0ebdeea 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/VMHostTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/VMHostTest.java
@@ -33,6 +33,7 @@
public class VMHostTest extends JarHostTest {
private static final String VM_TEST_TEMP_DIR = "/data/local/tmp/vm-tests";
+ private static final String EMULATOR_TEMP_DIR = "/data/local/tmp";
/**
* {@inheritDoc}
@@ -66,7 +67,7 @@
CLog.d("Creating device temp directory, including dalvik-cache.");
createRemoteDir(device, VM_TEST_TEMP_DIR + "/dalvik-cache" );
try {
- File localTmpDir = FileUtil.createTempDir("cts-vm", new File("/tmp/"));
+ File localTmpDir = FileUtil.createTempDir("cts-vm", new File(System.getProperty("java.io.tmpdir")));
CLog.d("Creating host temp dir %s", localTmpDir.getPath());
File jarFile = new File(ctsBuild.getTestCasesDir(), getJarFileName());
if (!jarFile.exists()) {
@@ -119,11 +120,10 @@
if (device.doesFileExist(remoteFilePath)) {
return;
}
- File f = new File(remoteFilePath);
- String parentPath = f.getParent();
- if (parentPath != null) {
- createRemoteDir(device, parentPath);
+ if (!(device.doesFileExist(EMULATOR_TEMP_DIR))) {
+ CLog.e("Error: Can not found the /data/local/tmp directory!!!");
}
+ device.executeShellCommand(String.format("mkdir %s", VM_TEST_TEMP_DIR));
device.executeShellCommand(String.format("mkdir %s", remoteFilePath));
}
}