bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject git commit: BIGTOP-1321. TestCLI: check assumptions before the test run
Date Fri, 30 May 2014 06:14:20 GMT
Repository: bigtop
Updated Branches:
  refs/heads/master 28999618e -> f08ec62cb


BIGTOP-1321. TestCLI: check assumptions before the test run


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

Branch: refs/heads/master
Commit: f08ec62cb0cb3eb968db511eedae75b35c3365c4
Parents: 2899961
Author: Martin Bukatovic <mbukatov@redhat.com>
Authored: Thu May 29 23:13:22 2014 -0700
Committer: Konstantin Boudnik <cos@apache.org>
Committed: Thu May 29 23:13:22 2014 -0700

----------------------------------------------------------------------
 .../apache/bigtop/itest/hadoop/hdfs/TestCLI.java    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/f08ec62c/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestCLI.java
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestCLI.java
b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestCLI.java
index 46c11f8..7cdbf74 100644
--- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestCLI.java
+++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestCLI.java
@@ -32,6 +32,9 @@ import org.apache.bigtop.itest.shell.Shell;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.Assert;
+
+import org.apache.commons.lang.StringUtils;
 
 /**
  * Tests for the Command Line Interface (CLI)
@@ -61,6 +64,19 @@ public class TestCLI extends CLITestHelper {
     String[] createTestcliDirCmds = {"hadoop fs -mkdir -p " + TEST_DIR_ABSOLUTE,
       "hadoop fs -chmod 777 " + TEST_DIR_ABSOLUTE};
     shHDFS.exec(createTestcliDirCmds);
+
+    // Check assumptions which would make some cases fail if not met
+    Assert.assertEquals("Creation of testcli dir should succeed and return 0"
+        + " (but it failed with the following error message: "
+        + StringUtils.join(shHDFS.getErr().toArray(), "\\n") + ")",
+        0, shHDFS.getRet());
+    // We can't just use conf.setInt(fs.trash.interval",0) because if trash is
+    // enabled on the server, client configuration value is ignored.
+    Assert.assertEquals("HDFS trash should be disabled via fs.trash.interval",
+        0, conf.getInt("fs.trash.interval",0));
+    Assert.assertEquals("This test needs to be run under root user of hcfs",
+        System.getProperty("hcfs.root.username", "hdfs"),
+        System.getProperty("user.name"));
   }
 
   @After


Mime
View raw message