Skip to content

HDDS-12869. Add some corner cases in create bucket - #11240

Open
rajeshkumarchandolu wants to merge 3 commits into
apache:masterfrom
rajeshkumarchandolu:HDDS-12869
Open

rajeshkumarchandolu wants to merge 3 commits into
apache:masterfrom
rajeshkumarchandolu:HDDS-12869

Conversation

@rajeshkumarchandolu

@rajeshkumarchandolu rajeshkumarchandolu commented Sep 15, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

This change extends the S3 gateway smoketest coverage for create-bucket behavior aligned with AWS naming rules and related error responses.

What and why

HDDS-12869 adds Robot tests for create-bucket corner cases: invalid bucket names (length, character set, uppercase, leading/trailing punctuation, IP-shaped names, adjacent periods, all-numeric names) and validation that duplicate create returns the expected error when the requester already owns the bucket. The S3 gateway already returns the appropriate error codes; this PR adds smoketest coverage so regressions are caught in compose/CI.

Changes

In hadoop-ozone/dist/src/main/smoketest/s3/bucketcreate.robot, the following test cases are added or updated:

  • Name too short (ab) → InvalidBucketName
  • Name too long (64 characters) → InvalidBucketName
  • All-uppercase bucket name → InvalidBucketName
  • Mixed-uppercase bucket name → InvalidBucketName
  • Invalid characters (test#12-$) → error message contains Invalid bucket name (AWS CLI client validation)
  • Trailing hyphen on otherwise valid name → InvalidBucketName
  • Two adjacent periods → InvalidBucketName
  • IP-address-shaped name → InvalidBucketName
  • Leading dash (--bucket=-test) → InvalidBucketName
  • Leading period → InvalidBucketName
  • Trailing period → InvalidBucketName
  • All-numeric name → InvalidBucketName
  • Maximum valid length (63 characters) → success

Duplicate create with the same name and the same credentials is unchanged; it remains covered by the existing Create bucket which already exists test, which expects BucketAlreadyOwnedByYou.

The 63-character success case uses a unique 63-character name (b plus 62 random lowercase characters) so repeated runs on the same compose cluster do not fail with BucketAlreadyOwnedByYou on a fixed bucket name.

Pre-existing cases in the same file (Create new bucket, default group ACL, web-endpoint-style bucket names, bucket ownership verification) are unchanged and still run as part of the suite.

No S3 gateway or OM code changes are included.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-12869

How was this patch tested?

Manual smoketest on the docker-compose ozone environment:

  1. Build dist smoketest artifacts:
    mvn clean install -DskipTests -f hadoop-ozone/dist/pom.xml

  2. From hadoop-ozone/dist/target/ozone-*-SNAPSHOT/compose/ozone, start compose (recreate containers after a dist rebuild if needed):
    docker compose up -d

  3. Run the robot suite:
    ../test-single.sh s3g s3/bucketcreate.robot

    Note: Test buckets named like web endpoints uses fixed bucket names (conf, jmx, …). On a cluster where those buckets already exist from a prior run, delete them or recreate the compose environment before re-running the suite.

Result: 19 tests, 19 passed, 0 failed.

Using Docker Compose v2
==============================================================================
Bucketcreate :: S3 gateway test with aws cli
==============================================================================
Create new bucket                                                     | PASS |
------------------------------------------------------------------------------
Create bucket with maximum valid name length                          | PASS |
------------------------------------------------------------------------------
Create bucket which already exists                                    | PASS |
------------------------------------------------------------------------------
Create bucket with invalid bucket name                                | PASS |
------------------------------------------------------------------------------
Create bucket with name too short                                     | PASS |
------------------------------------------------------------------------------
Create bucket with name too long                                      | PASS |
------------------------------------------------------------------------------
Create bucket with all uppercase characters in bucket name            | PASS |
------------------------------------------------------------------------------
Create bucket with mixed uppercase characters in bucket name          | PASS |
------------------------------------------------------------------------------
Create bucket validate names can consist only of lowercase letters... | PASS |
------------------------------------------------------------------------------
Create bucket validate names must begin and end with a letter or n... | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not contain two adjacent periods.   | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not be formatted as an IP addres... | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not contain leading dash            | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not contain leading period          | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not contain Trailing period         | PASS |
------------------------------------------------------------------------------
Create bucket validate names must not contain all numeric             | PASS |
------------------------------------------------------------------------------
Create new bucket and check default group ACL                         | PASS |
------------------------------------------------------------------------------
Test buckets named like web endpoints                                 | PASS |
------------------------------------------------------------------------------
Check bucket ownership verification                                   | PASS |
------------------------------------------------------------------------------
Bucketcreate :: S3 gateway test with aws cli                          | PASS |
19 tests, 19 passed, 0 failed
==============================================================================

No unit tests or product code changes in this PR. No UI changes.

@Gargi-jais11
Gargi-jais11 self-requested a review September 15, 2026 04:07

@sreejasahithi sreejasahithi Sep 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add some more cases like names with:

  • Leading dash
  • Leading period
  • Trailing period
  • All numeric

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sreejasahithi can you validate now . i had added all the scenarios mentioned

@Gargi-jais11 Gargi-jais11 changed the title HDDS-12869. Add S3 create-bucket naming corner cases to bucketcreate … HDDS-12869. Add S3 create-bucket naming corner cases to bucketcreate Sep 15, 2026

@Gargi-jais11 Gargi-jais11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajeshkumarchandolu for adding robot tests.
+1 to @sreejasahithi comment.
Please check this aws documentation for naming rules and add one robot test for each rules which are currently supported by ozone. This was we can verify each of the rules are satisfied.

@rajeshkumarchandolu rajeshkumarchandolu changed the title HDDS-12869. Add S3 create-bucket naming corner cases to bucketcreate HDDS-12869. Add some corner cases in create bucket Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants