Skip to content

Commit

Permalink
Check for transition of Encrypted and Compressed objects
Browse files Browse the repository at this point in the history
Signed-off-by: Tejas Chandramouli <[email protected]>
  • Loading branch information
TejasC88 committed Jul 5, 2024
1 parent d5311b3 commit 528b279
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
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
Expand Up @@ -13,3 +13,4 @@ config:
create_object: true
lc_id: cloud_transit
retain_head_object: false
enable_encryption: false
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -14,3 +14,4 @@ config:
upload_type: multipart
lc_id: cloud_transit
retain_head_object: false
enable_encryption: false
17 changes: 17 additions & 0 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,7 @@
<input_yaml>:
configs/test_cloud_transitions.yaml
configs/test_cloud_transition_encrypted.yaml
"""
import os
import sys
Expand All @@ -27,6 +28,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 +48,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 @@ -56,6 +59,20 @@ def test_exec(config, ssh_con):
)
log.info("creating bucket with name: %s" % 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)
Expand Down

0 comments on commit 528b279

Please sign in to comment.