accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/7] accumulo git commit: ACCUMULO-3822 chmod 777 the import and export directory
Date Sun, 17 May 2015 14:37:41 GMT
ACCUMULO-3822 chmod 777 the import and export directory


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/88940000
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/88940000
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/88940000

Branch: refs/heads/master
Commit: 88940000f50636eca6ff45d740027806584d6119
Parents: 11c1600
Author: Josh Elser <elserj@apache.org>
Authored: Sat May 16 21:11:38 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sun May 17 10:15:10 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/test/ImportExportIT.java  | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/88940000/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
index 1472d9f..f30a970 100644
--- a/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ImportExportIT.java
@@ -16,6 +16,9 @@
  */
 package org.apache.accumulo.test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.util.Arrays;
@@ -37,6 +40,7 @@ import org.apache.accumulo.harness.AccumuloClusterIT;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.FsShell;
 import org.apache.hadoop.fs.Path;
 import org.junit.Assert;
 import org.junit.Test;
@@ -85,15 +89,23 @@ public class ImportExportIT extends AccumuloClusterIT {
     // Must exist on the filesystem the cluster is running.
     FileSystem fs = cluster.getFileSystem();
     Path tmp = cluster.getTemporaryPath();
+    log.info("Using FileSystem: " + fs);
     Path baseDir = new Path(tmp, getClass().getName());
-    fs.mkdirs(baseDir);
+    if (fs.exists(baseDir)) {
+      log.info("{} exists on filesystem, deleting", baseDir);
+      assertTrue("Failed to deleted " + baseDir, fs.delete(baseDir, true));
+    }
+    log.info("Creating {}", baseDir);
+    assertTrue("Failed to create " + baseDir, fs.mkdirs(baseDir));
     Path exportDir = new Path(baseDir, "export");
     Path importDir = new Path(baseDir, "import");
     for (Path p : new Path[] {exportDir, importDir}) {
-      fs.delete(p, true);
-      fs.mkdirs(p);
+      assertTrue("Failed to create " + baseDir, fs.mkdirs(p));
     }
 
+    FsShell fsShell = new FsShell(fs.getConf());
+    assertEquals("Failed to chmod " + baseDir, 0, fsShell.run(new String[] {"-chmod", "-R",
"777", baseDir.toString()}));
+
     log.info("Exporting table to {}", exportDir);
     log.info("Importing table from {}", importDir);
 


Mime
View raw message