Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for transition of Encrypted and Compressed objects #611

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions rgw/v2/tests/s3_swift/configs/test_cloud_transition_encrypted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# script: test_cloud_transition.py
# Polarion ID : CEPH-83575497
config:
user_count: 1
bucket_count: 1
objects_count: 20
encryption_keys: s3
etag_verification: true
objects_size_range:
min: 5
max: 15
test_ops:
create_bucket: true
create_object: true
lc_id: cloud_transit
retain_head_object: false
enable_encryption: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# script: test_cloud_transitions.py
# script:test_cloud_transition.py
# Polarion ID : CEPH-83575278
config:
user_count: 1
Expand All @@ -13,3 +13,4 @@ config:
create_object: true
lc_id: cloud_transit
anrao19 marked this conversation as resolved.
Show resolved Hide resolved
retain_head_object: false
enable_encryption: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# script: test_cloud_transitions.py
# script:test_cloud_transition.py
# Polarion ID : CEPH-83575278
config:
user_count: 1
Expand All @@ -13,3 +13,4 @@ config:
create_object: true
lc_id: cloud_transit
retain_head_object: true
enable_encryption: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# script: test_cloud_transitions.py
# script:test_cloud_transition.py
# Polarion ID : CEPH-83575283
config:
user_count: 1
Expand All @@ -14,3 +14,4 @@ config:
upload_type: multipart
lc_id: cloud_transit
retain_head_object: false
enable_encryption: false
24 changes: 22 additions & 2 deletions rgw/v2/tests/s3_swift/test_cloud_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

<input_yaml>:
configs/test_cloud_transitions.yaml
configs/test_cloud_transition_encrypted.yaml
anrao19 marked this conversation as resolved.
Show resolved Hide resolved
configs/test_cloud_transition_headobject_false.yaml
configs/test_cloud_transition_headobject_true.yaml
configs/test_cloud_transition_multipart.yaml
"""
import os
import sys
Expand All @@ -27,6 +31,7 @@
from v2.lib.s3.write_io_info import BasicIOInfoStructure, IOInfoInitialize
from v2.tests.s3_swift import reusable
from v2.tests.s3_swift.reusables import lc_policy
from v2.tests.s3_swift.reusables import server_side_encryption_s3 as sse_s3
from v2.utils.log import configure_logging
from v2.utils.test_desc import AddTestInfo
from v2.utils.utils import HttpResponseParser, RGWService
Expand All @@ -46,6 +51,7 @@ def test_exec(config, ssh_con):
# authenticate
auth = Auth(user_info, ssh_con, ssl=config.ssl)
rgw_conn = auth.do_auth()
s3_client1 = auth.do_auth_using_client()

log.info("Create buckets and objects in source cluster")
if config.test_ops["create_bucket"] is True:
Expand All @@ -54,11 +60,25 @@ def test_exec(config, ssh_con):
bucket_name_to_create = utils.gen_bucket_name_from_userid(
user_info["user_id"], rand_no=bc
)
log.info("creating bucket with name: %s" % bucket_name_to_create)
log.info(f"creating bucket with name: {bucket_name_to_create}")
bucket = reusable.create_bucket(bucket_name_to_create, rgw_conn, user_info)

if config.test_ops["enable_encryption"]:
# enable per bucket encryption on the bucket
log.info(
f"Encryption type is per-bucket, enable it on bucket : {bucket_name_to_create}"
)
encryption_method = config.encryption_keys
sse_s3.put_bucket_encryption(
s3_client1, bucket_name_to_create, encryption_method
)
# get bucket encryption
log.info(f"get bucket encryption for bucket : {bucket_name_to_create}")
sse_s3.get_bucket_encryption(s3_client1, bucket_name_to_create)

if config.test_ops["create_object"] is True:
# uploading data
log.info("s3 objects to create: %s" % config.objects_count)
log.info(f"s3 objects to create: {config.objects_count}")
config.mapped_sizes = utils.make_mapped_sizes(config)
for oc, size in list(config.mapped_sizes.items()):
config.obj_size = size
Expand Down
Loading