Jimmyweng006 commented on code in PR #8307:
URL: https://github.com/apache/ozone/pull/8307#discussion_r2061396963


##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/rest/TestS3RestNonSdkCases.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.s3.rest;
+
+import static org.apache.hadoop.ozone.OzoneConsts.LOCALHOST;
+import static 
org.apache.hadoop.ozone.s3.S3GatewayConfigKeys.OZONE_S3G_HTTP_ADDRESS_KEY;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.scm.ScmConfigKeys;
+import org.apache.hadoop.ozone.MiniOzoneCluster;
+import org.apache.hadoop.ozone.s3.S3GatewayService;
+import org.apache.ozone.test.OzoneTestBase;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Integration tests for S3 REST edge cases that cannot be triggered by AWS 
SDK clients.
+ * For example: negative/zero max-keys, or other invalid parameters that SDK 
would block client-side.
+ */
+public class TestS3RestNonSdkCases extends OzoneTestBase {
+
+  private static MiniOzoneCluster cluster = null;
+  private static S3GatewayService s3g = null;
+  private static final String ACCESS_KEY = "testuser";
+  private static final String SECRET_KEY = "testpass";
+
+  @BeforeAll
+  public static void startCluster() throws Exception {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, 1);
+    s3g = new S3GatewayService();
+
+    cluster = MiniOzoneCluster.newBuilder(conf)
+        .addService(s3g)
+        .setNumDatanodes(3)
+        .build();
+    cluster.waitForClusterToBeReady();
+    cluster.newClient().getObjectStore().createS3Bucket(getTestBucketName());
+  }
+
+  @AfterAll
+  public static void shutdownCluster() {
+    if (cluster != null) {
+      cluster.shutdown();
+    }
+  }
+
+  @Test
+  public void testListObjectsWithNegativeMaxKeys() throws Exception {
+    final String bucketName = getTestBucketName();
+    String s3Endpoint = getS3EndpointURL();
+    String queryString = "max-keys=-1";
+    String url = s3Endpoint + "/" + bucketName + "/?" + queryString;

Review Comment:
   Revert the whole integration test as smoke test might be more suitable for 
this case.



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to