Commit graph

273 commits

Author SHA1 Message Date
Casey Bodley
0955f49c95 s3: disable checksum calculation for test_object_create_bad_contentlength_negative
if tls is enabled, boto will switch to STREAMING-UNSIGNED-PAYLOAD-TRAILER
and omit the provided content-length header. this leads to test failure:

> ________________ test_object_create_bad_contentlength_negative _________________
>       e = assert_raises(ClientError, client.put_object, Bucket=bucket_name, Key=key_name, ContentLength=-1)
> AssertionError: ClientError not raised

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a40c28fcc3)
2025-02-19 12:37:10 -05:00
Casey Bodley
572ba79705 iam: remove invalid Bucket param from list_buckets()
> botocore.exceptions.ParamValidationError: Parameter validation failed:
> Unknown parameter in input: "Bucket", must be one of: MaxBuckets, ContinuationToken, Prefix, BucketRegion

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 41b7297e7a)
2025-02-19 12:37:10 -05:00
Casey Bodley
b92df7290f s3: disable multipart/ranged tests with checksum failures
boto update exposed some bugs in our checksum feature around multipart
copy and ranged requests. disabling them with fails_on_rgw until
https://tracker.ceph.com/issues/69936 is resolved

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit cc56036255)
2025-02-19 12:37:10 -05:00
Casey Bodley
2ee4f2424d s3: disable request_checksum_calculation for test_multipart_checksum_upload_fallback
the test sends create_multipart_upload() with a requested checksum
algorithm, and upload_part() requests without. newer boto automatically
adds `x-amz-sdk-checksum-algorithm: CRC32` when nothing is specified,
so we have to explicitly disable that behavior via botocore config

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit dfb8fc5b16)
2025-02-19 12:37:10 -05:00
Casey Bodley
dd14c0d1fd s3: clean up use of tenanted bucket names
the botocore.handlers.validate_bucket_name validation is enabled by
default, but we can disable it with unregister(). this avoids having to
mess with the signature or url

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5aff597245)
2025-02-19 12:37:10 -05:00
Casey Bodley
55c58ac877 s3: sse-kms policy tests use v4 client
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 25a502872b)
2025-02-19 12:37:10 -05:00
Casey Bodley
1791e5acc9 s3: mark sigv2 tests with fails_on_rgw
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit e786aa4f42)
2025-02-19 12:37:10 -05:00
Ali Masarwa
afb290596a rgw|BN: fix test to expect authorization failure
Signed-off-by: Ali Masarwa <ali.saed.masarwa@gmail.com>
(cherry picked from commit 6ea711433e)
2025-02-07 12:12:35 -05:00
Matt Benjamin
5e5fbde743 mark attribute tests as failing on dbstore (for now)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit a30f6e0010)
2025-01-22 08:51:28 -05:00
Casey Bodley
d7682975ad more tests for GetObjectAttributes
* multipart upload without checksums
* multipart upload with a single part
* pagination of multipart parts
* non-multipart upload with/without checksum
* versioned object, current and non-current
* sse-c encrypted object

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 8f10b2e532)
2025-01-22 08:51:28 -05:00
Matt Benjamin
f2f517be1b multipart fallback to create-multipart checksum algorithm
there seem to be workloads which assume checksum algorithm can be
omitted from upload-part

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 5f94278e22)
2025-01-22 08:51:28 -05:00
Matt Benjamin
0c640599c0 test get_object_attributes
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit f4ce789ca1)
2025-01-22 08:51:28 -05:00
Seena Fallah
f723879d10 HeadBucket: add read-stats query string for usage test
Refs: https://github.com/ceph/ceph/pull/56756

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 3145b1b0c3)
2024-12-17 16:17:12 -05:00
Yuval Lifshitz
d23cb37d70 rgw/logging: basic set of tests for bucket logging
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
(cherry picked from commit 10d46f4e33)
2024-12-10 11:08:14 -05:00
Raja Sharma
43768c4910 rgw:modify testcase rgw header when bucket quota or user is disabled
By default quota is disable at user/bucket level.
if quota is disable then these value will not return so need to modify test_head_bucket_usages

'X-RGW-Quota-User-Size'
'X-RGW-Quota-User-Objects'
'X-RGW-Quota-Bucket-Size'
'X-RGW-Quota-Bucket-Objects'
to Fix: https://tracker.ceph.com/issues/68211

Signed-off-by: Raja Sharma raja@ibm.com
(cherry picked from commit 2aea98e604)
2024-11-25 10:28:22 -05:00
Casey Bodley
c32dd9fea0 sts: remove test_get_session_token_permanent_creds_denied
Fixes: https://tracker.ceph.com/issues/69001

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 66e8f000c9)
2024-11-22 10:25:49 -05:00
Pritha Srivastava
811db45733 rgw/s3tests: making the tests generic to check only
for 403 error code (and not specific errors) so that
the tests pass for any order of auth engines.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 14f5672d09)
2024-11-22 10:25:49 -05:00
Soumya Koduri
1effe15a40 Updating lifecycle_noncur* tests to include objects with instance empty
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit 7362e522cc)
2024-10-23 17:27:02 +05:30
Casey Bodley
a139a18b27 s3: add v2 signature presigned put_object tests
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 999d39d4db)
2024-10-07 09:21:16 -04:00
Tobias Urdin
11e3b77811 Add v2 signature presigned get_object tests
This adds tests for get_object presigned URLs
using signature v2.

Also code formatting.

Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
(cherry picked from commit ac71900ffb)
2024-10-07 09:21:16 -04:00
Casey Bodley
87c7a8a67b s3: test GetObject with PartNumber and SSE-C encryption
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit acc8ef43c9)
2024-10-07 09:21:16 -04:00
galsalomon66
d5facc6e63 fix comments
Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
(cherry picked from commit 6a775cb445)
2024-09-09 12:50:48 +00:00
Gal Salomon
0802a6f1f8 fix the assert per empty results
Signed-off-by: Gal Salomon <gal.salomon@gmail.com>
(cherry picked from commit 9444c29674)
2024-09-09 12:50:15 +00:00
Ali Maredia
d776898f61 Merge pull request #513 from galsalomon66/using_get_bucket_name
Using get bucket name

(cherry picked from commit 28009bf7d3)
2024-09-09 12:42:56 +00:00
Pritha Srivastava
6953aadf06 rgw: adding tests for add_client_id_to_oidc_provider
and update_thumbprint_for oidc_provider.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit bc8c14ac12)
2024-08-29 10:51:16 -04:00
Casey Bodley
cf0103e3f3 s3: reenable tenanted bucket policy test
the before-call hook url-encodes the ':' part of tenanted bucket names
to resolve SignatureDoesNotMatch errors

removed the list-v2 version of the test since it isn't relevant to
bucket policy test coverage

add a new test case that creates the bucket under the tenanted user,
then uses the main client to access it

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 2e41494293)
2024-08-23 12:35:22 -04:00
Seena Fallah
06a5851a92 s3select: align error codes with the new AWS format
ref. https://github.com/ceph/ceph/pull/56864

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 2e395d78ea)
2024-07-30 13:33:12 -04:00
Seena Fallah
be181ba455 BucketPolicy: decouple encryption tests from invalid algo and unencrypted
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit c9aded48e5)
2024-07-26 09:19:03 -04:00
Seena Fallah
0887ec43fd BucketPolicy: add test for sse-c in conditions
Ref. https://github.com/ceph/ceph/pull/58689

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 87b496f25f)
2024-07-26 09:19:03 -04:00
Seena Fallah
abd28c3aef BlockPublicPolicy: add test when policy has principal
Ref. https://tracker.ceph.com/issues/67048

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit a83396cda7)
2024-07-25 10:42:43 -04:00
Seena Fallah
3601557e45 PolicyStatus: add test for policy with Principal
Ref. https://github.com/ceph/ceph/pull/58686

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 93a3b6c704)
2024-07-25 10:42:43 -04:00
Seena Fallah
94b02d5cbf BucketPolicy: donot allow NotPrincipal with Allow Effect
Ref. https://github.com/ceph/ceph/pull/58686

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 474c1404e2)
2024-07-25 10:42:43 -04:00
Casey Bodley
88efafe863 test Get/HeadObject with partNumber for single-multipart upload
test_multipart_get_part() tests 'normal' multipart uploads. add a new
test case for a multipart upload with a single part to tests the fix
for https://tracker.ceph.com/issues/66705

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bebdfd1ba7)
2024-07-05 10:51:45 -04:00
Gal Salomon
565e5c8b9b add handling for EventStreamError exception
Signed-off-by: Gal Salomon <gal.salomon@gmail.com>
(cherry picked from commit 77f1334571)
2024-07-05 10:11:44 -04:00
Gal Salomon
f4e362dc3c a change is the RGW error-response require changes in s3-tests
Signed-off-by: Gal Salomon <gal.salomon@gmail.com>
(cherry picked from commit c4c5a247eb)
2024-07-05 10:11:44 -04:00
Matt Benjamin
8f988c10b9 mark two tests that fail on dbstore
also add @pytest.mark.checksum for new checksum
tests

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 8277a9fb9a)
2024-07-05 10:11:04 -04:00
Matt Benjamin
93f0753174 remove duplicate size assigment [rkhudov review]
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit c0f0b679db)
2024-07-05 10:11:04 -04:00
Matt Benjamin
98c0931419 add test_post_object_upload_checksum
this tests a two-megabyte binary upload with validated
(awscli-computed) SHA256 checksum, and also verifies failure when
a bad checksum is provided

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 95df503ced)
2024-07-05 10:11:04 -04:00
Matt Benjamin
7d91b2507f add test_multipart_checksum_3parts
tests a full multipart upload cycle with 3 unique parts, which
verifies composite checksum computation and the logic to propagate
parts_count to ComleteMultipart

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 9577cde013)
2024-07-05 10:11:04 -04:00
Matt Benjamin
9de20e91f2 test_multipart_upload_sha256: work around failures re-trying complete-multipart
As described in https://tracker.ceph.com/issues/65746, retrying complete-multipart
after having attempted to complete the same upload with a bad checksum argument
fails with an internal error.

The status code is 500, but I'm unsure if it can be retried again, or whether
the upload can be aborted later.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit a3dbac7115)
2024-07-05 10:11:04 -04:00
Sumedh A. Kulkarni
5162da85ec Fix wrong assertion of the test: test_buckets_list_ctime
TestName:
s3tests_boto3.functional.test_s3:test_buckets_list_ctime

Problem:
The test creates 5 buckets for a user but in an assertion check,
it asserts false if any bucket of the user has CreationTime less
than a day prior to current time.
Due to this reason the test fails if the user has pre-existing
buckets older than a day.

Solution:
Assert only on the CreationTime of buckets that were created with
test execution.

Signed-off-by: Sumedh A. Kulkarni <sumedh.a.kulkarni@seagate.com>
Co-developed-by: Bob Ham <bham12@bloomberg.net>
Signed-off-by: Bob Ham <bham12@bloomberg.net>
(cherry picked from commit e9c5cc29e9)
2024-05-14 11:49:25 -04:00
Casey Bodley
787242b007 sns: add test_sns.py for simple topic testing
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit dfabbf5a8d)
2024-04-16 11:42:13 -04:00
Casey Bodley
5de66792e5 iam: move iam_root, iam_alt_root fixtures to iam.py
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7bd4b0ee14)
2024-04-16 11:42:13 -04:00
Casey Bodley
ef5333112d s3: remove test_bucket_acl_no_grants()
aws doesn't consult acls for same-account access. rgw doesn't for
account users either

Fixes: https://github.com/ceph/s3-tests/issues/184

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 96d658444a)
2024-04-16 11:42:13 -04:00
Casey Bodley
281ab8796f iam: test cross-account policy with assumed role
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a3a16eb66a)
2024-04-16 11:42:13 -04:00
Casey Bodley
98fd3f55a0 iam: add account tests for GroupPolicy apis
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7ebc530e04)
2024-04-16 11:42:13 -04:00
Casey Bodley
79a0dab8d5 iam: add account tests for Group apis
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 4ca7967ae7)
2024-04-16 11:42:13 -04:00
Casey Bodley
0f13cb9326 iam: add account test for OpenIDConnectProvider apis
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d5791d8da6)
2024-04-16 11:42:13 -04:00
Casey Bodley
b514c9938b iam: test cross-account permissions
test the [iam alt root] user's access to buckets owned by [iam root]
using various policy principals and acl grantees

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit ba292fbf59)
2024-04-16 11:42:13 -04:00
Casey Bodley
4d83a45b0f config: add [iam alt root] for an alt account's root user
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit ed4a8e2244)
2024-04-16 11:42:13 -04:00