From: Kyr Shatskyy Date: Thu, 19 Feb 2026 17:01:44 +0000 (+0100) Subject: test/rgw/lua: ignore hours for zero mtime X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F67432%2Fhead;p=ceph.git test/rgw/lua: ignore hours for zero mtime Check mtime for zero timestamp only date part if corresponds to 1970-01-01 for UTC and ahead of UTC, and to 1969-12-31 for cases behind UTC. Fixes: https://tracker.ceph.com/issues/75039 Signed-off-by: Kyr Shatskyy --- diff --git a/src/test/rgw/lua/test_lua.py b/src/test/rgw/lua/test_lua.py index f8131956b30..bc489729324 100644 --- a/src/test/rgw/lua/test_lua.py +++ b/src/test/rgw/lua/test_lua.py @@ -284,7 +284,16 @@ end result = conn.get_object(Bucket=bucket_name, Key=key) message = result['ResponseMetadata']['HTTPHeaders']['x-amz-meta-test'] - assert message == bucket_name+","+key+","+key+",0,1970-01-01 00:00:00" + + # The MTime part is supposed to be a datetime "1970-01-01 00:00:00" + # however in different TZ environment the hours can be different, + # for example, for UTC+1, zero date turns into "1970-01-01 01:00:00", + # while for UTC-1, it is "1969-12-31 23:00:00", so we only check + # if the date corresponds to either of those two days. + assert ',' in message + (message_without_mtime, message_mtime) = message.rsplit(',', 1) + assert message_without_mtime == f"{bucket_name},{key},{key},0" + assert message_mtime[:10] in ['1969-12-31', '1970-01-01'] # cleanup conn.delete_object(Bucket=bucket_name, Key=key)