check-net: set check-net process working directory
authorminkee.lee <minkee.lee@samsung.com>
Thu, 5 Nov 2015 01:47:47 +0000 (10:47 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Thu, 5 Nov 2015 05:07:39 +0000 (14:07 +0900)
- If it is not set, check-net could be run at unauthorized
  directory and it would fail when try creating new file.
  And this causes network failure in VM with host-proxy.

Change-Id: Ie98ecdbcc143693fb3082f6fda9fbceb8ac6968b
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
src/org/tizen/emulator/manager/vms/helper/HelperClass.java
src/org/tizen/emulator/manager/vms/option/NetProxyOption.java

index b4f7043..9c22856 100644 (file)
@@ -240,11 +240,17 @@ public class HelperClass {
                int exitValue = 0;
                Process process = null;
 
-               if (directory != null) {
+               String workingDirPath = null;
+               if (directory == null) {
+                       workingDirPath = System.getProperty("user.dir");
+
+               } else {
+                       workingDirPath = directory.getAbsolutePath();
                        pb.directory(directory);
                }
 
                EMLogger.getLogger().log(Level.INFO, "Try to run external process: " + cmd.get(0)); //$NON-NLS-1$
+               EMLogger.getLogger().log(Level.INFO, " -- Working dir : " + workingDirPath);
 
                try {
                        process = pb.start();
index 482e023..b55898c 100644 (file)
@@ -122,7 +122,8 @@ public class NetProxyOption extends Option {
 
                List<String> cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath()
                                + File.separator + proxyCommand, "--proxy"); //$NON-NLS-1$
-               ProcessResult res = HelperClass.runProcess(cmd);
+               File workingDir = new File(FilePathResources.getToolEmulatorBinPath());
+               ProcessResult res = HelperClass.runProcess(cmd, workingDir);
                EMLogger.getLogger().info(
                                "check-net result : " + res.getResultMessage()); //$NON-NLS-1$