Browse Source

HADOOP-1717. Fix TestDFSUpgradeFromImage to work on Solaris. Contributed by Nigel.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@566326 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
0415e96d12
2 changed files with 8 additions and 5 deletions
  1. 3 0
      CHANGES.txt
  2. 5 5
      src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java

+ 3 - 0
CHANGES.txt

@@ -535,6 +535,9 @@ Branch 0.14 (unreleased changes)
 157. HADOOP-1712.  Fix an unhandled exception on datanode during block
      CRC upgrade. (Raghu Angadi via cutting)
 
+158. HADOOP-1717.  Fix TestDFSUpgradeFromImage to work on Solaris.
+     (nigel via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 5 - 5
src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java

@@ -68,11 +68,11 @@ public class TestDFSUpgradeFromImage extends TestCase {
     if ( dfsDir.exists() && !FileUtil.fullyDelete(dfsDir) ) {
       throw new IOException("Could not delete dfs directory '" + dfsDir + "'");
     }
-    
-    LOG.info("Unpacking the tar file " + tarFile);
-    String[] cmd = { "tar", "-zxf", FileUtil.makeShellPath(tarFile), 
-                     "-C", FileUtil.makeShellPath(dataDir) };
-    Command.execCommand(cmd);
+    String cmd = "bash -c \"gzip -dc '" + FileUtil.makeShellPath(tarFile) + "' | (cd '" +
+                 FileUtil.makeShellPath(dataDir) + "' ; tar -xf -)\"";
+    LOG.info("Unpacking the tar file. Cmd : " + cmd);
+    String[] shellCmd = { "sh", "-c", cmd };
+    Command.execCommand(shellCmd);
     
     //Now read the reference info