From b1efd0477a0357996e6fa8d75baf33b005237d5c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 21 Sep 2023 10:00:37 -0400 Subject: [PATCH 1/2] boto2: fix byte vs. string comparison in verify_object the storage class tests were failing on comparisons between the input data and output data: AssertionError: assert 'oFbdZvtRj' == b'oFbdZvtRj' convert the byte representation back to string for comparison Signed-off-by: Casey Bodley --- s3tests/functional/test_s3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index cc70c24..0496f3a 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -290,7 +290,7 @@ def verify_object(bucket, k, data=None, storage_class=None): if data: read_data = k.get_contents_as_string() - equal = data == read_data # avoid spamming log if data not equal + equal = data == read_data.decode() # avoid spamming log if data not equal assert equal == True def copy_object_storage_class(src_bucket, src_key, dest_bucket, dest_key, storage_class): From e54f0a4508f45d122d53b528f4015f310bbebf9c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 21 Sep 2023 17:42:58 -0400 Subject: [PATCH 2/2] boto2: copy configured_storage_classes() fix from boto3 some boto2 storage class tests are failing because the list returned by configured_storage_classes() included an empty string the boto3 version had an extra line that removes empty values; copy that for boto2 Signed-off-by: Casey Bodley --- s3tests/functional/test_s3.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 0496f3a..9072c80 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -362,6 +362,9 @@ def configured_storage_classes(): if item != 'STANDARD': sc.append(item) + sc = [i for i in sc if i] + print("storage classes configured: " + str(sc)) + return sc def lc_transition(days=None, date=None, storage_class=None):