11121 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Zuul
da983fd4e9 Merge "Return 503 for POST request with mixed 202/404 responses" 2025年12月03日 20:29:23 +00:00
Alistair Coles
22605d21ee cli/test_info.py: cleanup Timestamp usage
Change-Id: I7bc1c60acbb0de9d999e6b33811f5e63e20bd4ac
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
ca9db701c5 account/test_reaper.py: cleanup Timestamp usage
Change-Id: I836cf1e1bdb48aab59b4f3d618f5e4f9320d80b5
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
e6f1b06c93 test/unit/container: cleanup Timestamp usage
Change-Id: Iafb39842731cc0f64db0f214d28262aae92150ec
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
a70e33e73a test_constraints.py: cleanup Timestamp usage
Change-Id: Ibd5ec2fe65cdc454c46ecb5a490e864763f503b7
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
91dd65d36b test_symlink.py: cleanup Timestamp usage
Change-Id: Id9b3c0c0d5d58ae1455847c8761b13c2a2993142
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
0190d81e4c test_diskfile.py: fix Timestamp usage
Change-Id: If484964458a8b090b9f0eb4ea37dd40476659529
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
254100ef1f tests: container/test_backend.py cleanup
Change-Id: I2152b14a116d2a3519d85e64879994337100dead
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 15:36:51 +00:00
Alistair Coles
5658355bf5 account/test_utils: cleanup Timestamp usage
Change-Id: I8b84fa258ae0071cb171c4b5dcdb86b01980c33a
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 11:52:24 +00:00
Alistair Coles
18b861bd6c obj test_expirer.py and test_auditor.py: fix timestamp usage
Change-Id: I3e121eee731c5e8d877786e5789903421f83bbc9
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 11:52:24 +00:00
Alistair Coles
800cf32114 test_reconstructor.py: make hashes assertions less brittle
Replace the hard-coded expected suffix hash values with values
calculated using the timestamp. That way, if the timestamp ever
changes then the test will continue to pass.
Change-Id: Id85e2f3decb386e5f865491357bc98750d287af9
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年12月01日 11:52:24 +00:00
Alistair Coles
d31b201d6b test_db.py: clean up usage of Timestamps
Also clarify some docstrings.
Change-Id: I14649edddd69de9f7f4fe7a9dcc45e9cf890962e
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月27日 15:13:33 +00:00
Matthew Oliver
760829a75a account: Use Timestamps better in test_backend unit tests
Change-Id: I0b0fadce9e1231a45b10177d7d3e2c6bcde06a3d
Signed-off-by: Matthew Oliver <matt@oliver.net.au>
2025年11月27日 10:18:23 +00:00
Matthew Oliver
48937cd183 TombstoneReclaimer: quote string timestamp in sql query
Reclaim age and sync "timestamp" args passed to
DatabaseBroker.reclaim() and TombstoneReclaimer.__init__() are
expected to be floats. This is adhered to in code, but many tests pass
a string representation of a Timestamp instance. The string has been
tolerated because it has so far always been identical to a
str(float).
However, if a Timestamp instance has an offset then its string
representation is not equivalent to str(float), and
TombstoneReclaimer.reclaim() would raise an error because the reclaim
age value in the SQL query is not quoted and does not appear to be any
recognised type.
This patch quotes the reclaim age in the TombstoneReclaimer SQL
query. This makes it tolerant of being passed string representations
of Timestamps with offsets. This is not yet expected, but,
nevertheless, text in SQL queries should be quoted.
Change-Id: Ic70689db1e4ddc6f526c283bf0cbb5862b16fd90
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
2025年11月26日 14:10:57 +00:00
Zuul
f324fb4ad3 Merge "tests: pass Timestamps to date_header_format" 2025年11月26日 05:11:01 +00:00
Zuul
3ba92226aa Merge "tests: clarify timestamp formats" 2025年11月26日 03:33:54 +00:00
Alistair Coles
c8da8676fd tests: clarify timestamp formats
Use Timestamp.internal and Timestamp.normal methods to better clarify
which timestamp format is used with which headers.
Use setUp provided Timestamp iters more.
Change-Id: I75b4d2fb946227fb461e8a7512f1d0f9bd3e6d9f
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月25日 11:23:29 +00:00
Alistair Coles
02bc7e4480 tests: pass Timestamps to date_header_format
Since the Related-Change, swob's date_header_format function will
accept Timestamp instances.
Drive-by: call out the use of Timestamp.ceil() in the
date_header_format docstring.
Change-Id: If45a8172d225eea70160f5034e337feb027bda2b
Related-Change: Ie7090e8dbc90e814f74fbcbd4fba2ca40ee1fcc7
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月25日 10:15:33 +00:00
Tim Burke
98005fad92 Allow Timestamps in swob's date-header helpers
... that way we don't need to keep remembering that they need to use
ceil().
Change-Id: Ie7090e8dbc90e814f74fbcbd4fba2ca40ee1fcc7
Signed-off-by: Tim Burke <tim.burke@gmail.com>
2025年11月25日 09:51:33 +11:00
Tim Burke
41376fca5d trivial: Use swob date-header helpers more
Related-Change: Ia7c619fe563ab89ff5b1beb03219e763a8798cc9
Change-Id: I91723b349df5cec409ef000f0a397e180a9de7a2
Signed-off-by: Tim Burke <tim.burke@gmail.com>
2025年11月25日 09:51:26 +11:00
Alistair Coles
96e7db0b3e swob: add a date_header_format helper function
There's many places where a Last-Modified header value is constructed
from a time value. This patch replaces the duplicate code with a
helper function that returns the correctly formatted header for a
given number of seconds.
Change-Id: Ia7c619fe563ab89ff5b1beb03219e763a8798cc9
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月24日 14:32:25 +00:00
Zuul
676e68fc0f Merge "trivial: tests: add failure context to flakey assertion" 2025年11月18日 12:12:12 +00:00
Zuul
bb7d097bf8 Merge "s3api: verify checksums on DeleteObjects POSTs" 2025年11月17日 20:23:45 +00:00
Alistair Coles
affdbf71aa trivial: tests: add failure context to flakey assertion
An object server unit test was seen to fail returning a 409 when a 204
was expected. I cannot see the bug, so this patch adds some failure
context to add illumination if/when it fails again.
Change-Id: I45327cb5a56a87b8f6b9e971232fdce3b3f4bcb8
Related-Bug: #2131684
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月17日 16:58:06 +00:00
Alistair Coles
cbc3b42d7d s3api: verify checksums on DeleteObjects POSTs
If a checksum header is sent with an S3 API DeleteObjects POST request
then it will be verified (unlike a CompleteMultipartUpload POST) [0].
If a checksum header is not sent with an S3 API DeleteObjects POST
request then a Content-MD5 header is required. Even when not
*required* [1], a Content-MD5 value will be verified if sent.
Previously we could return 200 when we should have sent 400 (eg, when
the client sent a sha256 but no md5 or additional checksum), or return
400 when we should have sent 200 (eg, when an additional checksum was
sent with no sha256 and the auth protocol didn't require a sha256).
[0] Related-Change: Id39fd71bc59875a5b88d1d012542136acf880019
[1] Related-Change: Ifbcde9820bee72d80cab0fe3e67ea0f5817df949
Related-Bug: #2131671
Change-Id: If25a8f0a3079558544ab15c874eda666a9f69933
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
Co-authored-by: Tim Burke <tim.burke@gmail.com>
2025年11月17日 15:04:25 +00:00
Tim Burke
5f89d14ebb s3token: Enable secret caching by default
Now that we need to pass the service creds to keystone, we might as well
default secret caching by default now that they need to be provided.
This patch also adds the required s3token configuration to CI so we can use the
swift service creds to fetch s3api secrets.
As well as also configuring keystone users for cross-compatibility tests.
Change-Id: Ief0a29c4300edf2e0d52c041960d756ecc8a2677
Signed-off-by: Tim Burke <tburke@nvidia.com>
2025年11月06日 13:23:00 +11:00
Zuul
b147eae95d Merge "trivial: tests: clarify exception handling" 2025年11月04日 17:27:22 +00:00
Zuul
3c7a2b4f02 Merge "s3token: Pass service auth token to Keystone" 2025年11月04日 16:56:40 +00:00
Zuul
e76223797b Merge "tests: belts and braces idiomatic patching" 2025年11月04日 11:34:57 +00:00
Zuul
a6790fcb9c Merge "tests: idiomatic ring patching" 2025年11月04日 11:11:06 +00:00
Alistair Coles
ee6f4c6a0d trivial: tests: clarify exception handling
Clarify that the caught exception message is not used to construct the
resulting log message.
Change-Id: I5cdaa27d25f43865eab2f8b12cc68a5d086ef0c7
Related-Change: Ib54172131f1e3abd9b0419aa0370930c6fc82ba9
Signed-off-by: Alistair Coles <alistairncoles@gmail.com>
2025年11月04日 10:44:19 +00:00
Clay Gerrard
ef8b2a5f32 Return 503 for POST request with mixed 202/404 responses
We can't reliably return 404 for POST if there's a any missing primary
response, but we'll DO it ... with a quorum of 404s ... but ONLY if we
don't have proof of the object existing (i.e. a single 202 will spoil
the 404).
To offset the obvious increased server errors somewhat, and deal with
special cases when one PUT lands on a handoff - we'll *also* in this
same change add extra backend POST requests to handoffs when we observed
mixed primary 202/404 response on POST. The reasoning being if we can
just get > quorum 202 responses from *somewhere* we can actually call
the POST successful and durable despite some 404s.
A future change to the object server could in theory make the proxy more
confident about a 404 in the face of an *out-of-date* rouge 202 - IF the
object-server POST responses started included a timestamp - but this
code would still be as-correct-as-possible for the upgrade path and
there's really nothing to be done if the *only* non-202 storage server
responses are "no useful information"/missing (so again, a single 202
should STILL spoil a quorum of *missing* 404; b/c who's posting to
non-existent objects - we know it WAS there?)
Closes-Bug: #2119675
Change-Id: I43644f242d1cca416844dbd556d40f4e8cd869f9
Co-Authored-By: Jianjian Huo <jhuo@nvidia.com>
Signed-off-by: Clay Gerrard <clay.gerrard@gmail.com>
2025年11月03日 22:05:40 -08:00
Zuul
52730e1037 Merge "tests: remove some global patching" 2025年11月03日 15:41:59 +00:00
Zuul
3809085f89 Merge "proxy-logging: Add real-time transfer bytes counters" 2025年11月03日 05:43:36 +00:00
Zuul
0d884dcce8 Merge "Provide some s3 helper methods for other middlewares to use." 2025年11月03日 05:37:41 +00:00
Tim Burke
e7bb2a3855 s3token: Pass service auth token to Keystone
Recent versions of Keystone require auth tokens when accessing the
/v3/s3tokens endpoint to prevent exposure of a lot of information that
a user who just has a presigned URL should not be able to see.
UpgradeImpact
=============
The s3token middleware now requires Keystone auth credentials to be
configured. If secret_cache_duration is enabled, these credentials
should already be configured. Without these credentials, Keystone users
will no longer be able to make S3 API requests.
Closes-Bug: #2119646
Change-Id: Ie80bc33d0d9de17ca6eaad3b43628724538001f6
Signed-off-by: Tim Burke <tim.burke@gmail.com>
2025年11月03日 14:04:20 +11:00
Zuul
d87ebd7d05 Merge "reno: Update master for unmaintained/2024.1" 2025年10月31日 21:04:53 +00:00
Zuul
8f36f18f46 Merge "Move Pete Zaitcev to Core Emeritus" 2025年10月31日 16:31:08 +00:00
a785025b26 reno: Update master for unmaintained/2024.1
Update the 2024.1 release notes configuration to build from
unmaintained/2024.1.
Change-Id: I69da0bb132bf0b8e5f065a79a22c037835d097de
Signed-off-by: OpenStack Release Bot <infra-root@openstack.org>
Generated-By: openstack/project-config:roles/copy-release-tools-scripts/files/release-tools/change_reno_branch_to_unmaintained.sh
2025年10月31日 11:46:57 +00:00
Yan Xiao
dcd5a265f6 proxy-logging: Add real-time transfer bytes counters
Currently we can get one proxy-logging transfer stat emission over the
duration of the upload/download. We want another stat coming out of
proxy-logging: something that gets emitted periodically as bytes are
actually sent/received so we can get reasonably accurate point-in-time
breakdowns of bandwidth usage.
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Shreeya Deshpande <shreeyad@nvidia.com>
Change-Id: Ideecd0aa58ddf091c9f25f15022a9066088f532b
Signed-off-by: Yan Xiao <yanxiao@nvidia.com>
2025年10月30日 15:30:37 -04:00
Clay Gerrard
e450b8c670 tests: belts and braces idiomatic patching
AFAIK this is un-needed once we ensure test_db_replicator un-patches the
object with a cleanup, but in isolation a test patching a global and
relying on someting else to clean it up looks messy/lazy - or at best
just not a pattern/style that can easily be copied elsewhere.
Related-Change: I66d4df1e2dba058b7c719a4a932234b3fc10b554
Change-Id: Ib54172131f1e3abd9b0419aa0370930c6fc82ba9
Signed-off-by: Clay Gerrard <clay.gerrard@gmail.com>
2025年10月27日 13:22:03 -05:00
Clay Gerrard
89e9ced9e5 tests: idiomatic ring patching
AFAIK this isn't causing any problems, but looks weird once we fix the
db_replicator.ReplConnection patching in Related-Change.
Related-Change: I66d4df1e2dba058b7c719a4a932234b3fc10b554
Change-Id: I45b10c71bab6933dd32c042e386f59e37279787b
Signed-off-by: Clay Gerrard <clay.gerrard@gmail.com>
2025年10月27日 13:22:03 -05:00
Clay Gerrard
f256bc7eb3 tests: remove some global patching
replace a questionable reload_module with idiomatic addCleanup
Change-Id: I66d4df1e2dba058b7c719a4a932234b3fc10b554
Signed-off-by: Clay Gerrard <clay.gerrard@gmail.com>
2025年10月27日 13:13:14 -05:00
Shreeya Deshpande
8cbe10552a Update resource type in labels.html
Change-Id: I1a6f85feea1e7a77966d5a5f35df12d8325c8464
Signed-off-by: Shreeya Deshpande <shreeyad@nvidia.com>
2025年10月22日 15:33:05 -07:00
Tim Burke
7744e4a43a Move Pete Zaitcev to Core Emeritus
He offered his core resignation earlier this week.
Change-Id: I552ae6ae2aee29be94683e9e01b3ab7b10a4f42e
Signed-off-by: Tim Burke <tim.burke@gmail.com>
2025年10月18日 13:07:57 -07:00
Zuul
9232350af0 Merge "Fix swift_dir setting in WSGI servers" 2025年10月14日 23:48:18 +00:00
Yan Xiao
9d7e7e27a5 Provide some s3 helper methods for other middlewares to use.
get_s3_access_key_id returns the S3 access_key_id user for the request
is_s3_req checks whether a request looks like it ought to be an S3 request
parse_path returns a wsgi string
extract_bucket_and_key extracts bucket and object from the request's PATH_INFO
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Shreeya Deshpande <shreeyad@nvidia.com>
Change-Id: Iaf86a07238cca6700dee736f55d4c0672cccf1b1
Signed-off-by: Shreeya Deshpande <shreeyad@nvidia.com>
2025年10月14日 13:58:00 +00:00
Zuul
48a5d5e42f Merge "test-db-replicator (trivial): just one tmpdir" 2025年10月14日 11:21:08 +00:00
Zuul
4b7543b2e1 Merge "trivial test_[db_]replicator cleanup" 2025年10月14日 11:21:03 +00:00
Clay Gerrard
fac55ced3c test-db-replicator (trivial): just one tmpdir
Change-Id: I1e53d171faff02e2dbcbcc779ad3a47506b26853
Signed-off-by: Clay Gerrard <clay.gerrard@gmail.com>
2025年10月13日 12:46:28 -05:00