This is an automated email from the ASF dual-hosted git repository.

hexiaoqiao pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.4 by this push:
     new a005c432b26 HADOOP-19218. Addendum. Update TestFSNamesystemLockReport 
to exclude hostname resolution from regex. (#6951). Contributed by Viraj Jasani.
a005c432b26 is described below

commit a005c432b268f1ee0349bdade7c7dbab58cd9b9e
Author: Viraj Jasani <vjas...@apache.org>
AuthorDate: Tue Jul 23 04:47:36 2024 -0800

    HADOOP-19218. Addendum. Update TestFSNamesystemLockReport to exclude 
hostname resolution from regex. (#6951). Contributed by Viraj Jasani.
    
    Signed-off-by: He Xiaoqiao <hexiaoq...@apache.org>
    (cherry picked from commit e000cbf27718f467b5d16002ac57f87b9ca39266)
---
 .../server/namenode/TestFSNamesystemLockReport.java    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemLockReport.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemLockReport.java
index 9c77f9d92b8..ef1ed9b7835 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemLockReport.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSNamesystemLockReport.java
@@ -103,7 +103,7 @@ public class TestFSNamesystemLockReport {
     FSDataOutputStream os = testLockReport(() ->
         userfs.create(new Path("/file")),
         ".* by create \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null," +
         "perm=bob:hadoop:rw-r--r--\\) .*");
     os.close();
 
@@ -111,7 +111,7 @@ public class TestFSNamesystemLockReport {
     // ip=/127.0.0.1,src=/file,dst=null,perm=null)"
     FSDataInputStream is = testLockReport(() -> userfs.open(new Path("/file")),
         ".* by open \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null," +
         "perm=null\\) .*");
     is.close();
 
@@ -120,49 +120,49 @@ public class TestFSNamesystemLockReport {
     testLockReport(() ->
         userfs.setPermission(new Path("/file"), new FsPermission(644)),
         ".* by setPermission \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null," +
         "perm=bob:hadoop:-w----r-T\\) .*");
 
     // The log output should contain "by setOwner (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/file,dst=null,perm=alice:group1:-w----r-T)"
     testLockReport(() -> userfs.setOwner(new Path("/file"), "alice", "group1"),
         ".* by setOwner \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null," +
         "perm=alice:group1:-w----r-T\\) .*");
 
     // The log output should contain "by listStatus (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/,dst=null,perm=null)"
     testLockReport(() -> userfs.listStatus(new Path("/")),
         ".* by listStatus \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/,dst=null," +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/,dst=null," +
         "perm=null\\) .*");
 
     // The log output should contain "by getfileinfo (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/file,dst=null,perm=null)"
     testLockReport(() -> userfs.getFileStatus(new Path("/file")),
         ".* by getfileinfo \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=null," +
         "perm=null\\) .*");
 
     // The log output should contain "by mkdirs (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/dir,dst=null,perm=bob:hadoop:rwxr-xr-x)"
     testLockReport(() -> userfs.mkdirs(new Path("/dir")),
         ".* by mkdirs \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/dir,dst=null," 
+
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/dir,dst=null," +
         "perm=bob:hadoop:rwxr-xr-x\\) .*");
 
     // The log output should contain "by delete (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/file2,dst=null,perm=null)"
     testLockReport(() -> userfs.rename(new Path("/file"), new Path("/file2")),
         ".* by rename \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=/file2,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file,dst=/file2," +
         "perm=alice:group1:-w----r-T\\) .*");
 
     // The log output should contain "by rename (ugi=bob (auth:SIMPLE),
     // ip=/127.0.0.1,src=/file,dst=/file2,perm=alice:group1:-w----r-T)"
     testLockReport(() -> userfs.delete(new Path("/file2"), false),
         ".* by delete \\(ugi=bob \\(auth:SIMPLE\\)," +
-        
"ip=[a-zA-Z0-9.]+/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file2,dst=null,"
 +
+        "ip=/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3},src=/file2,dst=null," +
         "perm=null\\) .*");
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to