From 39bfa6ccf6b46d8c4e25b7df51edb5d4e3837d92 Mon Sep 17 00:00:00 2001 From: overtrue <1472352+overtrue@users.noreply.github.com> Date: Wed, 2 Dec 2026 07:31:47 +0800 Subject: [PATCH] test(s3): compare tagged object expiry against UTC --- .../0007-lifecycle-tag-expiration-utc.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scripts/s3-tests/patches/0007-lifecycle-tag-expiration-utc.patch diff --git a/scripts/s3-tests/patches/0007-lifecycle-tag-expiration-utc.patch b/scripts/s3-tests/patches/0007-lifecycle-tag-expiration-utc.patch new file mode 100644 index 0000000000..76467d8ccc --- /dev/null +++ b/scripts/s3-tests/patches/0007-lifecycle-tag-expiration-utc.patch @@ -0,0 +1,29 @@ +--- a/s3tests/functional/test_s3.py ++++ b/s3tests/functional/test_s3.py +@@ -9230,7 +9230,7 @@ + # stat the object, check header + response = client.head_object(Bucket=bucket_name, Key=key1) + assert response['ResponseMetadata']['HTTPStatusCode'] == 200 +- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1) ++ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1) + + # test that header is not returning when it should not + lifecycle={ +@@ -9252,7 +9252,7 @@ + # stat the object, check header + response = client.head_object(Bucket=bucket_name, Key=key1) + assert response['ResponseMetadata']['HTTPStatusCode'] == 200 +- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1) == False ++ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1) == False + + @pytest.mark.lifecycle + @pytest.mark.lifecycle_expiration +@@ -9298,7 +9298,7 @@ + # stat the object, check header + response = client.head_object(Bucket=bucket_name, Key=key1) + assert response['ResponseMetadata']['HTTPStatusCode'] == 200 +- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1) == False ++ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1) == False + + @pytest.mark.lifecycle + def test_lifecycle_set_noncurrent():