hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HDFS-9855. Modify TestAuditLoggerWithCommands to workaround the absence of HDFS-8332. Contributed by Kuhu Shukla.
Date Fri, 26 Feb 2016 16:23:23 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b0091338f -> 03afcdd39


HDFS-9855. Modify TestAuditLoggerWithCommands to workaround the absence of HDFS-8332. Contributed
by Kuhu Shukla.


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

Branch: refs/heads/branch-2
Commit: 03afcdd39d61ccebd4e7b7903115213cee1bf92d
Parents: b009133
Author: Kihwal Lee <kihwal@apache.org>
Authored: Fri Feb 26 10:02:19 2016 -0600
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Fri Feb 26 10:22:27 2016 -0600

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt            |  3 +++
 .../server/namenode/TestAuditLoggerWithCommands.java   | 13 +++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/03afcdd3/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 4f6c2f9..3705680 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1900,6 +1900,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9549. TestCacheDirectives#testExceedsCapacity is flaky (Xiao Chen via
     cmccabe)
 
+    HDFS-9855. Modify TestAuditLoggerWithCommands to workaround the absence
+    of HDFS-8332 (Kuhu Shukla via kihwal)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/03afcdd3/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java
index 8b06b0b..1449690 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLoggerWithCommands.java
@@ -121,7 +121,6 @@ public class TestAuditLoggerWithCommands {
   public void testSetQuota() throws Exception {
     Path path = new Path("/testdir/testdir1");
     fs.mkdirs(path);
-    fileSys = DFSTestUtil.getFileSystemAs(user1, conf);
     try {
       ((DistributedFileSystem)fileSys).setQuota(path, 10l, 10l);
       fail("The operation should have failed with AccessControlException");
@@ -129,15 +128,17 @@ public class TestAuditLoggerWithCommands {
     }
     String acePattern =
         ".*allowed=false.*ugi=theDoctor.*cmd=setQuota.*";
-    int length = verifyAuditLogs(acePattern);
-    fileSys.close();
+    verifyAuditLogs(acePattern);
+    String ioePattern =
+        ".*allowed=true.*ugi=" + fs.getFileStatus(path).getOwner().toString() +
+            ".*cmd=delete.*";
+    fs.delete(path, true);
     try {
-      ((DistributedFileSystem)fileSys).setQuota(path, 10l, 10l);
+      ((DistributedFileSystem)fs).setQuota(path, 10l, 10l);
       fail("The operation should have failed with IOException");
     } catch (IOException ace) {
     }
-    assertTrue("Unexpected log from getContentSummary",
-        length == auditlog.getOutput().split("\n").length);
+    verifyAuditLogs(ioePattern);
   }
 
   @Test


Mime
View raw message