Browse Source

Improve fsck test coverage to 85%

tags/nilmdb-2.1.0
Jim Paris 9 months ago
parent
commit
a1dee0e6f2
45 changed files with 25 additions and 4 deletions
  1. BIN
      tests/fsck-data/test2e/data.sql
  2. BIN
      tests/fsck-data/test2e/data/a/b/0000/0000
  3. BIN
      tests/fsck-data/test2e/data/a/b/_format
  4. BIN
      tests/fsck-data/test2f/data.sql
  5. BIN
      tests/fsck-data/test2f/data/a/b/0000/0000
  6. BIN
      tests/fsck-data/test2f/data/a/b/_format
  7. BIN
      tests/fsck-data/test2g/data.sql
  8. BIN
      tests/fsck-data/test2g/data/a/b/0000/0000
  9. BIN
      tests/fsck-data/test2g/data/a/b/_format
  10. BIN
      tests/fsck-data/test2h/data.sql
  11. BIN
      tests/fsck-data/test2i/data.sql
  12. BIN
      tests/fsck-data/test2i/data/a/b/0000/0000
  13. BIN
      tests/fsck-data/test2j/data.sql
  14. BIN
      tests/fsck-data/test2j/data/a/b/0000/0000
  15. BIN
      tests/fsck-data/test2j/data/a/b/_format
  16. BIN
      tests/fsck-data/test2k/data.sql
  17. BIN
      tests/fsck-data/test2k/data/a/b/0000/0000
  18. BIN
      tests/fsck-data/test2k/data/a/b/_format
  19. BIN
      tests/fsck-data/test2l/data.sql
  20. BIN
      tests/fsck-data/test2l/data/a/b/0000/0000
  21. BIN
      tests/fsck-data/test2l/data/a/b/_format
  22. BIN
      tests/fsck-data/test2m/data.sql
  23. BIN
      tests/fsck-data/test2m/data/a/b/0000/0000
  24. BIN
      tests/fsck-data/test2m/data/a/b/_format
  25. BIN
      tests/fsck-data/test2n/data.sql
  26. BIN
      tests/fsck-data/test2n/data/a/b/0000/0000
  27. BIN
      tests/fsck-data/test2n/data/a/b/_format
  28. BIN
      tests/fsck-data/test2o/data.sql
  29. BIN
      tests/fsck-data/test2o/data/a/b/0000/0000
  30. BIN
      tests/fsck-data/test2o/data/a/b/_format
  31. BIN
      tests/fsck-data/test2p/data.sql
  32. BIN
      tests/fsck-data/test2p/data/a/b/0000/0000
  33. BIN
      tests/fsck-data/test2p/data/a/b/_format
  34. BIN
      tests/fsck-data/test2p1/data.sql
  35. BIN
      tests/fsck-data/test2p1/data/a/b/0000/0000
  36. +1
    -0
      tests/fsck-data/test2p1/data/a/b/0001/hello
  37. BIN
      tests/fsck-data/test2p1/data/a/b/_format
  38. BIN
      tests/fsck-data/test2p2/data.sql
  39. BIN
      tests/fsck-data/test2p2/data/a/b/0000/0000
  40. +1
    -0
      tests/fsck-data/test2p2/data/a/b/0001/hello.removed
  41. BIN
      tests/fsck-data/test2p2/data/a/b/_format
  42. BIN
      tests/fsck-data/test2q/data.sql
  43. BIN
      tests/fsck-data/test2q/data/a/b/0000/0000
  44. BIN
      tests/fsck-data/test2q/data/a/b/_format
  45. +23
    -4
      tests/test_fsck.py

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


+ 1
- 0
tests/fsck-data/test2p1/data/a/b/0001/hello View File

@@ -0,0 +1 @@
world

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


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


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


+ 1
- 0
tests/fsck-data/test2p2/data/a/b/0001/hello.removed View File

@@ -0,0 +1 @@
world

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


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


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


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


+ 23
- 4
tests/test_fsck.py View File

@@ -63,8 +63,8 @@ class TestFsck(object):
self.dump()
eq_(self.exitcode, 0)

def okmsg(self, db, expect):
self.ok(db)
def okmsg(self, db, expect, **kwargs):
self.ok(db, **kwargs)
self.contain(expect)

def fail(self, *args, exitcode=None, **kwargs):
@@ -78,8 +78,8 @@ class TestFsck(object):
self.dump()
ne_(self.exitcode, 0)

def failmsg(self, db, expect):
self.fail(db)
def failmsg(self, db, expect, **kwargs):
self.fail(db, **kwargs)
self.contain(expect)

def contain(self, checkstring, contain=True):
@@ -115,4 +115,23 @@ class TestFsck(object):
self.failmsg("test2b", "interval ID 2 not in streams")
self.failmsg("test2c", "metadata ID 2 not in streams")
self.failmsg("test2d", "duplicate metadata key")
self.failmsg("test2e", "duplicated path")
self.failmsg("test2f", "bad layout")
self.failmsg("test2g", "bad count")
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("test2l", "unsupported bulkdata version")
self.failmsg("test2m", "bad rows_per_file")
self.failmsg("test2n", "bad files_per_dir")
self.failmsg("test2o", "layout mismatch")
self.failmsg("test2p", "missing data files", fix=False)
self.contain("This may be fixable")
self.okmsg("test2p", "Removing empty subpath")
self.failmsg("test2p1", "please manually remove the file")
self.okmsg("test2p2", "Removing empty subpath")
self.failmsg("test2q", "extra bytes present", fix=False)
self.okmsg("test2q", "Truncating file")



Loading…
Cancel
Save