Skip to content

Conversation

@sarvekshayr
Copy link
Contributor

@sarvekshayr sarvekshayr commented May 21, 2024

What changes were proposed in this pull request?

S3 robot tests cover only OBJECT_STORE buckets as of now. Modified the tests to cover FILE_SYSTEM_OPTMIZED buckets as well.

What is the link to the Apache JIRA

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

How was this patch tested?

Tested the patch manually on a docker cluster.
Green CI run - https://github.com/sarvekshayr/ozone/actions/runs/9169163732

@sarvekshayr sarvekshayr marked this pull request as draft May 21, 2024 05:17
@ivandika3 ivandika3 added test s3 S3 Gateway labels May 21, 2024
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @sarvekshayr for working on this.

We need to be able to run the same Robot tests against Amazon S3, to verify the correctness of the tests.

# This script helps to execute S3 robot test against real AWS s3 endpoint
# To make sure that all of our defined tests cases copies the behavior of AWS

Since OBS and FSO are Ozone-specific features, there is no point in running the tests twice against Amazon S3.

It also introduces unnecessary code duplication.

Acceptance tests cover different kinds of buckets (encrypted bucket, link to other bucket, bucket with EC replication). FSO bucket is already covered the same way:

for layout in OBJECT_STORE LEGACY FILE_SYSTEM_OPTIMIZED; do
execute_robot_test ${SCM} -v BUCKET:${bucket} -v BUCKET_LAYOUT:${layout} -N s3-${layout}-${bucket} ${exclude} s3
# some tests are independent of the bucket type, only need to be run once
exclude="--exclude virtual-host --exclude no-bucket-type"
done

Copy link
Contributor

@Tejaskriya Tejaskriya left a comment

Choose a reason for hiding this comment

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

Thanks for the patch @sarvekshayr. I have a few suggestions, you can find them below in the inline comments.
Also, post these changes, could you please share the link to a green CI run on your fork? It can be considered as a way of testing the patch apart from locally testing with docker.
You could perhaps update the description of the PR in the "How was this patch tested" section.

*** Variables ***
${ENDPOINT_URL} http://s3g:9878
${BUCKET} generated
${BUCKET1} generated
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we improve the naming of variables here? BUCKET1 is very ambiguous, it can be changed to BUCKET_FSO or anything similar.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

*** Variables ***
${ENDPOINT_URL} http://s3g:9878
${BUCKET} generated
${BUCKET1} generated
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this variable as well, And all other files having BUCKET1 can be changed to something more sensible

Comment on lines +160 to +169
Create generated bucket with OBS
[Arguments] ${layout}=OBJECT_STORE
${BUCKET} = Create bucket with layout ${layout}
Set Global Variable ${BUCKET}

Create generated bucket with FSO
[Arguments] ${layout}=FILE_SYSTEM_OPTIMIZED
${BUCKET1} = Create bucket with layout ${layout}
Set Global Variable ${BUCKET1}

Copy link
Contributor

Choose a reason for hiding this comment

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

As we have 2 different key words for creating FSO and OBS buckets, there is no need to pass an argument to these keywords. [Arguments] ${layout}=FILE_SYSTEM_OPTIMIZED can be ommitted.
Instead of passing ${layout} to Create bucket with layout, we can directly mention the layouts ${BUCKET_LAYOUT_OBS} and ${BUCKET_LAYOUT_FSO} respectively.

Comment on lines +26 to +28
${BUCKET1} generated
${BUCKET_LAYOUT} OBJECT_STORE
${BUCKET_LAYOUT1} FILE_SYSTEM_OPTIMIZED
Copy link
Contributor

Choose a reason for hiding this comment

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

The naming of ${BUCKET_LAYOUT} and ${BUCKET_LAYOUT1} can also be changed to ${BUCKET_LAYOUT_OBS} and ${BUCKET_LAYOUT_FSO} respectively.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Comment on lines +146 to +147
Run Keyword if '${BUCKET}' == 'generated' Create generated bucket with OBS ${BUCKET_LAYOUT}
Run Keyword if '${BUCKET1}' == 'generated' Create generated bucket with FSO ${BUCKET_LAYOUT1}
Copy link
Contributor

Choose a reason for hiding this comment

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

Referring to the below comment, the BUCKET_LAYOUT variables wouldn't need to be passed here.

Copy link
Contributor

@tanvipenumudy tanvipenumudy left a comment

Choose a reason for hiding this comment

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

Thank you @sarvekshayr for working on the patch.

${ENDPOINT_URL} http://s3g:9878
${OZONE_TEST} true
${BUCKET} generated
${BUCKET1} generated
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, we can rename the instances of ${BUCKET} and ${BUCKET1} to also include the layout type.

Execute rm -rf /tmp/file1
Execute rm -rf /tmp/file2

*** Test Cases ***
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can loop (FOR - END) over the buckets ${BUCKET}, ${BUCKET1} and type: OBS/FSO for reducing the redundancy under the individual test cases.

@sarvekshayr
Copy link
Contributor Author

Closing this PR because the acceptance test already covers all 3 bucket layouts in #6452.
Thank you @adoroszlai for pointing this out and @Tejaskriya and @tanvipenumudy for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3 S3 Gateway test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants