TaiJuWu commented on code in PR #5982:
URL: https://github.com/apache/ozone/pull/5982#discussion_r1469910469


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java:
##########
@@ -480,10 +488,99 @@ public void testShallowListKeys() throws Exception {
     startKey = "a1/b1/c12/c3.tx";
     // a1/b1/c1222.tx
     expectedKeys =
-        getExpectedKeyShallowList(keyPrefix, startKey, legacyOzoneBucket);
+            getExpectedKeyShallowList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyShallowList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    keyPrefix = "a1/b1/";
+    startKey = "";
+    // a1/b1/c1222.tx
+    expectedKeys =
+            getExpectedKeyShallowList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyShallowList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    keyPrefix = "a1/b1/";
+    startKey = "a1";
+    // a1/b1/c1222.tx
+    expectedKeys =
+            getExpectedKeyShallowList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyShallowList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    keyPrefix = "a1/b1/";
+    startKey = "a1/b1";
+    // a1/b1/c1222.tx
+    expectedKeys =
+            getExpectedKeyShallowList(keyPrefix, startKey, legacyOzoneBucket);
     checkKeyShallowList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
   }
 
+  @Test
+  public void testDeepListKeysWithTrailingSlash() throws Exception {
+    List<String> expectedKeys;
+
+    // Case-1: StartKey is less than prefixKey, return emptyList.
+    String keyPrefix = "a1/b2/";
+    String startKey = "a1";
+    expectedKeys =
+            getExpectedKeyDeepList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyDeepList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    // Case-2: StartKey is empty, return all node.
+    keyPrefix = "a1/b2/";
+    startKey = "";
+    expectedKeys =
+            getExpectedKeyDeepList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyDeepList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    // Case-3: StartKey is same as prefixKey, return all nodes.
+    keyPrefix = "a1/b2/";
+    startKey = "a1/b2";
+    expectedKeys =
+            getExpectedKeyDeepList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyDeepList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    // Case-4: StartKey is greater than prefixKey
+    keyPrefix = "a1/b2/";
+    startKey = "a1/b2/d2/d21.tx";
+    expectedKeys =
+            getExpectedKeyDeepList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyDeepList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+    // Case-5: StartKey reaches last element, return emptyList
+    keyPrefix = "a1/b2/";
+    startKey = "a1/b2/d3/d31.tx";
+    expectedKeys =
+            getExpectedKeyDeepList(keyPrefix, startKey, legacyOzoneBucket);
+    checkKeyDeepList(keyPrefix, startKey, expectedKeys, fsoOzoneBucket);
+
+//    // Case-6: StartKey is invalid (less than last element)

Review Comment:
   These test cases result is not same with legacy mode.
   Im not sure it's expected.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to