(archivers, request)
| 165 | @pytest.mark.skipif(not is_utime_fully_supported(), reason="cannot setup and execute test without utime") |
| 166 | @pytest.mark.skipif(not is_birthtime_fully_supported(), reason="cannot setup and execute test without birthtime") |
| 167 | def test_birthtime(archivers, request): |
| 168 | archiver = request.getfixturevalue(archivers) |
| 169 | create_test_files(archiver.input_path) |
| 170 | birthtime, mtime, atime = 946598400, 946684800, 946771200 |
| 171 | os.utime("input/file1", (atime, birthtime)) |
| 172 | os.utime("input/file1", (atime, mtime)) |
| 173 | cmd(archiver, "repo-create", RK_ENCRYPTION) |
| 174 | cmd(archiver, "create", "test", "input") |
| 175 | with changedir("output"): |
| 176 | cmd(archiver, "extract", "test") |
| 177 | sti = os.stat("input/file1") |
| 178 | sto = os.stat("output/input/file1") |
| 179 | assert same_ts_ns(sti.st_birthtime * 1e9, sto.st_birthtime * 1e9) |
| 180 | assert same_ts_ns(sto.st_birthtime * 1e9, birthtime * 1e9) |
| 181 | assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) |
| 182 | assert same_ts_ns(sto.st_mtime_ns, mtime * 10**9) |
| 183 | |
| 184 | |
| 185 | def test_sparse_file(archivers, request): |
nothing calls this directly
no test coverage detected