Browse Source

tests: new fsck tests for interval overlap

tags/nilmdb-2.2.0
Jim Paris 1 year ago
parent
commit
7538c6201b
17 changed files with 8 additions and 2 deletions
  1. +1
    -1
      nilmdb/fsck/fsck.py
  2. BIN
      tests/fsck-data/test2x1/data.sql
  3. BIN
      tests/fsck-data/test2x1/data.sql-shm
  4. BIN
      tests/fsck-data/test2x1/data.sql-wal
  5. BIN
      tests/fsck-data/test2x1/data/a/b/0000/0000
  6. BIN
      tests/fsck-data/test2x1/data/a/b/_format
  7. BIN
      tests/fsck-data/test2x2/data.sql
  8. BIN
      tests/fsck-data/test2x2/data.sql-shm
  9. BIN
      tests/fsck-data/test2x2/data.sql-wal
  10. BIN
      tests/fsck-data/test2x2/data/a/b/0000/0000
  11. BIN
      tests/fsck-data/test2x2/data/a/b/_format
  12. BIN
      tests/fsck-data/test2x3/data.sql
  13. BIN
      tests/fsck-data/test2x3/data.sql-shm
  14. BIN
      tests/fsck-data/test2x3/data.sql-wal
  15. BIN
      tests/fsck-data/test2x3/data/a/b/0000/0000
  16. BIN
      tests/fsck-data/test2x3/data/a/b/_format
  17. +7
    -1
      tests/test_fsck.py

+ 1
- 1
nilmdb/fsck/fsck.py View File

@@ -274,7 +274,7 @@ class Fsck(object):
# B -------- D
# Then we can try changing the first interval to go from
# A to B instead.
msg = (f"{path}: overlap in file offests:\n"
msg = (f"{path}: overlap in file offsets:\n"
f"existing ranges: {existing}\n"
f"overlapping interval: {new}")
if not self.fix:


BIN
tests/fsck-data/test2x1/data.sql View File


BIN
tests/fsck-data/test2x1/data.sql-shm View File


BIN
tests/fsck-data/test2x1/data.sql-wal View File


BIN
tests/fsck-data/test2x1/data/a/b/0000/0000 View File


BIN
tests/fsck-data/test2x1/data/a/b/_format View File


BIN
tests/fsck-data/test2x2/data.sql View File


BIN
tests/fsck-data/test2x2/data.sql-shm View File


BIN
tests/fsck-data/test2x2/data.sql-wal View File


BIN
tests/fsck-data/test2x2/data/a/b/0000/0000 View File


BIN
tests/fsck-data/test2x2/data/a/b/_format View File


BIN
tests/fsck-data/test2x3/data.sql View File


BIN
tests/fsck-data/test2x3/data.sql-shm View File


BIN
tests/fsck-data/test2x3/data.sql-wal View File


BIN
tests/fsck-data/test2x3/data/a/b/0000/0000 View File


BIN
tests/fsck-data/test2x3/data/a/b/_format View File


+ 7
- 1
tests/test_fsck.py View File

@@ -123,7 +123,7 @@ class TestFsck(object):
self.failmsg("test2h", "missing bulkdata dir")
self.failmsg("test2i", "bad bulkdata table")
self.failmsg("test2j", "overlap in intervals")
self.failmsg("test2k", "overlap in file offsets")
self.failmsg("test2k", "overlap in file offsets", fix=False)
self.ok("test2k1")
self.failmsg("test2l", "unsupported bulkdata version")
self.failmsg("test2m", "bad rows_per_file")
@@ -176,3 +176,9 @@ class TestFsck(object):
self.failmsg("test2w2", "non-monotonic, and zero", fix=False)
self.okmsg("test2w2", "Will try truncating table")
self.contain("new end: time 237000001, pos 238")

self.failmsg("test2x1", "overlap in file offsets", fix=False)
self.okmsg("test2x1", "truncating")

self.failmsg("test2x2", "unfixable overlap")
self.failmsg("test2x3", "unfixable overlap")

Loading…
Cancel
Save