]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/rgw/lua: ignore hours for zero mtime
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Thu, 19 Feb 2026 17:01:44 +0000 (18:01 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Sat, 21 Feb 2026 17:17:57 +0000 (18:17 +0100)
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 <kyrylo.shatskyy@clyso.com>
src/test/rgw/lua/test_lua.py

index f8131956b30f103cc1ad1d6a682822171e56c1e0..bc489729324f31b471b427d733dacc32122c8c43 100644 (file)
@@ -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)