mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-01 15:15:59 -04:00
add a borg create/extract timestamp test for y2261.
in y2262, nanoseconds as signed int64 will overflow.
This commit is contained in:
parent
eca66a0e3e
commit
7b69bed8c4
1 changed files with 16 additions and 0 deletions
|
|
@ -825,3 +825,19 @@ def test_extract_existing_directory(archivers, request):
|
|||
cmd(archiver, "extract", "test")
|
||||
st2 = os.stat("input/dir")
|
||||
assert st1.st_ino == st2.st_ino
|
||||
|
||||
|
||||
@pytest.mark.skipif(not is_utime_fully_supported(), reason="cannot properly setup and execute test without utime")
|
||||
def test_extract_y2261(archivers, request):
|
||||
# test if roundtripping of timestamps well beyond y2038 works
|
||||
archiver = request.getfixturevalue(archivers)
|
||||
create_regular_file(archiver.input_path, "file_y2261", contents=b"post y2038 test")
|
||||
# 2261-01-01 00:00:00 UTC as a Unix timestamp (seconds).
|
||||
time_y2261 = 9183110400
|
||||
os.utime("input/file_y2261", (time_y2261, time_y2261))
|
||||
cmd(archiver, "repo-create", RK_ENCRYPTION)
|
||||
cmd(archiver, "create", "test", "input")
|
||||
with changedir("output"):
|
||||
cmd(archiver, "extract", "test")
|
||||
sto = os.stat("output/input/file_y2261")
|
||||
assert same_ts_ns(sto.st_mtime_ns, time_y2261 * 10**9)
|
||||
|
|
|
|||
Loading…
Reference in a new issue