Commit graph

921 commits

Author SHA1 Message Date
Seena Fallah
43dff5992f PublicAccessBlock: test 404 on no block configuration
Make sure NoSuchPublicAccessBlockConfiguration is returned when no public block is configured on bucket:

Refs: https://github.com/ceph/ceph/pull/55652
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 3056e6d039)
2024-03-08 14:13:11 -05:00
Tobias Urdin
f3c2b9a744 Add more testing for presigned URLs
This improves the testing for presigned URLs for
both get_object and put_object when using
generate_presigned_url().

It covers the case where you pass for example
a x-amz-acl (ACL in params for generated_presigned_url)
header that should be signed.

Tests the regression in [1].

[1] https://tracker.ceph.com/issues/64308

Signed-off-by: Tobias Urdin <tobias.urdin@binero.se>
(cherry picked from commit 055451f666)
2024-03-07 16:02:34 -05:00
Jane Zhu
021ada2165 tag test_versioning_obj_suspended_copy with fails_on_dbstore
Signed-off-by: Juan Zhu <jzhu4@dev-10-34-20-139.pw1.bcc.bloomberg.com>
(cherry picked from commit 1866f04d81)
2024-03-07 16:02:34 -05:00
Jane Zhu
603679a414 add test case for object copy in versioning suspended bucket
Signed-off-by: Juan Zhu <jzhu4@dev-10-34-20-139.pw1.bcc.bloomberg.com>
(cherry picked from commit a2acdbfdda)
2024-03-07 16:02:34 -05:00
Ali Maredia
10fcfbea4c replace datetime.now with datetime.utcnow()
when the local timezone is not UTC and if it is a day behind,
lifecycle_header tests fails with 2 days not equal to 1
so replacing datetime.now() with datetime.utcnow()

Signed-off-by: Ali Maredia <amaredia@redhat.com>
(cherry picked from commit 4744808eda)
2024-02-21 12:29:58 -05:00
Casey Bodley
e0503c9fcd 304 Not Modified tests still expect etag header
test case for https://tracker.ceph.com/issues/45736

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 19c17fa49a)
2024-01-11 14:00:50 -05:00
Casey Bodley
d50ea9f485 object lock: test very large RetainUntilDate
https://tracker.ceph.com/issues/63537 reported that large dates (with
year after 2107) got truncated when written. test with a later date, and
check that get_object_retention() gives back the date we put

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 40182ce26f)
2023-11-28 15:54:35 -05:00
Casey Bodley
85c7fb3dd6 test Head/GetObject on completed multipart parts
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d552124680)
2023-11-28 13:56:59 -05:00
Casey Bodley
c4a711ff28 add test_post_object_wrong_bucket()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 95677d85bc)
2023-10-09 14:57:12 -04:00
Casey Bodley
651ecd20dd 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 <cbodley@redhat.com>
2023-09-22 11:15:09 -04:00
Casey Bodley
3023080509 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 <cbodley@redhat.com>
2023-09-22 11:15:09 -04:00
Casey Bodley
69f867ff23 lc: test transition of plain null version
for validating the fix of https://tracker.ceph.com/issues/62013

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2023-09-22 11:15:09 -04:00
Tobias Urdin
ff44ce9364 Add test to verify HTTP OPTIONS on presigned URL
Related: https://tracker.ceph.com/issues/62033

Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
(cherry picked from commit c0a1880d4c)
2023-08-21 15:53:11 -04:00
Soumya Koduri
cc13ed4984 Add testcase to verify obj mtime post setattrs
Object mtime should not change for any attr changes unless
its a copy operation. Verify the same using PutObjectACL op.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit 10f3f7620d)
2023-07-03 10:26:48 +05:30
Casey Bodley
44bc52b426 remove reliance on x-rgw-object-count and x-rgw-bytes-used headers
stop using head_bucket() to fetch these response headers, and use
list_objects_v2() instead to count objects and sizes

Fixes: #315

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 188b392131)
2023-07-03 10:26:04 +05:30
Abhishek Lekshmanan
610192c033 boto3/test_s3: add ranges around part boundary for encryption tests
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 00cdcaf056)
2023-06-14 16:12:59 -04:00
Abhishek Lekshmanan
7682983704 boto3/test_s3: range encoding helper function takes a size argument
This is to avoid a get_object call for every range check as the object size will
not change during this duration and we'd most likely already know the object
sizes beforehand

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 741f2cbc9e)
2023-06-14 16:12:59 -04:00
Casey Bodley
dc7068b75b sse: add sse-c test with unaligned multipart parts
Fixes: http://tracker.ceph.com/issues/38700

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit b05a394738)
2023-06-14 16:12:59 -04:00
Cory Snyder
b81c9ba8d9 Add test_versioning_concurrent_multi_object_delete
Tests that concurrent multi-object delete requests which specify
the same versioned object instances return successful object
responses within response body.

relates to: https://tracker.ceph.com/issues/56646

Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit e18ea7fac4)
2023-05-17 14:33:34 -04:00
galsalomon66
6919f63324 adding tests per JSON input types, which includes various SQL operators.
alignment of some of the test routines upon removing the XML tags(<Payload><Records><Payload>) from the s3select results. (Json s3tests #506)

Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
2023-05-16 00:26:19 +03:00
Casey Bodley
264e371101 test_sse_s3_default_multipart_upload verifies encryption header
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit febbcc12c2)
2023-04-10 22:44:40 -04:00
Mark Kogan
6342b3d258 test object PUT with chunked transfer enconding
Before the RGW fix PR was responding with 411 instead of 200

RGW fix PR: https://github.com/ceph/ceph/pull/50235

Signed-off-by: Mark Kogan <mkogan@redhat.com>
(cherry picked from commit 13a9bfc00a)
2023-04-07 09:20:15 -04:00
Casey Bodley
67e6c5aecc boto3: multi-object-delete tests use client.delete_objects()
when the tests were converted from boto2, they were rewritten as loops
over client.delete_object(). switch back to multi-delete

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 787dc6bd43)
2023-03-31 14:43:34 -04:00
Casey Bodley
ac25acfddb s3website: collections.Container removed from python3.10
Fixes: https://tracker.ceph.com/issues/58960

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 97c0338adf)
2023-03-21 17:09:29 -04:00
Casey Bodley
a1139f5301 add test_get_object_torrent
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bb27e04c45)
2023-03-14 13:43:08 -04:00
Soumya Koduri
d6a9168220 lifecycle: Fix test_lifecycle_expiration_header_* testcases
Few checks were incorrectly mapped when switched to 'assert'. This
commit fixes the same.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit 29b0e27e49)
2023-03-08 08:58:56 -05:00
Soumya Koduri
02fdf70f0a dbstore: add back missing 'fails_on_dbstore' tag
Mark testcase "test_lifecycle_expiration_header_and_tags_head" as
fails_on_dbstore

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit d976f47d74)
2023-03-06 13:00:00 -05:00
Moritz Röhrich
7fadea7416 QoL: Fix tox.ini syntax and other minor things
- Fix tox.ini syntax

Modern tox versions require the expected environment variables to be
listed one by one on separate lines in tox.ini

- Add `venv` to list of ignored names for git

This is a common name for a local Python virtual environment. Less
typing than `virtualenv`

- Add `tox` to requirements.txt

Installing `tox` via `pip` has the advantage of including it in the
virtual environment, thus avoiding trouble on operating systems shipping
by default with python3.6 or older. It's also nice that `pip install -r
requirements.txt` is now sufficient to set up the testing environment,
after initializing the virtual environment with a moder-enough python
version.

Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
(cherry picked from commit 3a0f1f0ead)
2023-03-06 09:20:49 -05:00
Casey Bodley
e5dabbe45d boto3: list_versions() omits empty KeyMarker/VersionIdMarker
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a536dd0e88)
2023-03-06 09:20:49 -05:00
Casey Bodley
f060572730 iam: add back missing fails_on_dbstore tags
Fixes: https://tracker.ceph.com/issues/58762

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5219b86db9)
2023-02-27 08:43:51 -05:00
Yuval Lifshitz
99690b71c5 better error handling in the STS tests
also, give more accurate instruction on how to run the tests

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit 3437cda73d)
2023-02-20 11:49:34 -05:00
Robin H. Johnson
a8fd8d430e test_post_object_upload_size_rgw_chunk_size_bug: new testcase
`ERR_TOO_SMALL` is wrongly returned if all of the following are true,
- the get_data returns multiple items (chunks)
- the length of the last item is smaller than the POST Policy's min
  value for content-length-range.

The check should be `(ofs < min_len)` instead of `(len < min_len)`

This is further confirmed by the next line of `s->obj_size = ofs`

Move the `int len` scope inside loop to try and prevent the bug in
future.

The bug was refactored in 2016, but was introduced in Oct 2012, when
this functionality was first added to RGW in commit 7bb3504d3f0974e9863f536e9af0ce8889d6888f.

Reference: 933a42f9af/src/rgw/rgw_op.cc (L4474-L4513)
Reference: 7bb3504d3f
Signed-off-by: Robin H. Johnson <rjohnson@digitalocean.com>
(cherry picked from commit 5914eb2005)
2023-02-20 09:30:30 -05:00
Casey Bodley
968d0841da test_s3: remove test_user_policy()
this has been failing consistently in local testing. test_sts.py has
lots of user policy test coverage, so this test case in test_s3.py is
superfluous

Fixes: https://tracker.ceph.com/issues/58365

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 18a41ab63f)
2023-02-09 10:34:45 -05:00
Casey Bodley
acec6abe78 test_headers: add custom marks for auth_common/aws2/aws4
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7993dd02a5)
2023-01-25 18:04:31 -05:00
Casey Bodley
8a51654721 remove boostrap
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5e9f6e5ffb)
2023-01-25 18:04:23 -05:00
Casey Bodley
bb4158dec6 cleanup duplicate lines
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d13ed28a5c)
2023-01-25 18:04:15 -05:00
Casey Bodley
3d8fa8179d remove nose dependency from requirements.txt
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 494379c2ff)
2023-01-25 18:04:06 -05:00
Casey Bodley
b4bb9afb52 nose: remove nose attrs and imports
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 4c75fba0de)
2023-01-25 18:03:58 -05:00
Casey Bodley
8186dd7561 pytest: replace nose eq() with assert ==
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit f5d0bc9be3)
2023-01-25 18:03:50 -05:00
Casey Bodley
5396b04f1b pytest: replace nose SkipTest with pytest.skip()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7e7e8d5a42)
2023-01-25 18:03:42 -05:00
Casey Bodley
e8d56603a3 pytest: replace @nose.with_setup with fixtures
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c80e9d2118)
2023-01-25 18:01:16 -05:00
Casey Bodley
b6dcf111fa pytest: add custom marks for each nose @attr
and register them in pytest.ini

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 4864dbc340)
2023-01-25 18:00:37 -05:00
Casey Bodley
60cc478d70 remove tests tagged fails_strict_rfc2616
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 3652cfe2ec)
2023-01-25 18:00:28 -05:00
Casey Bodley
c749452fd0 pytest: add global configfile and autouse teardown fixtures
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 672a123348)
2023-01-25 18:00:17 -05:00
Casey Bodley
d528efdda9 pytest: add tox.ini to run pytest, update README
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9319a41b24)
2023-01-25 18:00:03 -05:00
Casey Bodley
c12216d0cc pin botocore to resolve v2 signature failures
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-11-23 13:05:10 -05:00
galsalomon66
def95c2968 remove comment
Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
(cherry picked from commit 60b26f210e)
2022-10-19 15:46:02 -04:00
galsalomon66
5eadd6d08c the use of std::to_string change the double presentation(not accuracy)
Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
(cherry picked from commit b200013565)
2022-10-19 15:46:02 -04:00
galsalomon66
89b10274dd the upgraded CSV parser has some impact on engine result. (redundant comma, quote behavior)
Signed-off-by: galsalomon66 <gal.salomon@gmail.com>
(cherry picked from commit 89f97ed35c)
2022-10-19 15:46:02 -04:00
Casey Bodley
02ee15041a add test_object_copy_16m to test refcounting of tail objects
i don't think any of our CopyObj test cases were large enough to have
tail objects, so weren't exercising our tail object ref counting
strategy

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit defb8eb977)
2022-10-06 16:59:30 -04:00