Improve fsck test coverage to 85%

This commit is contained in:
Jim Paris 2020-08-07 01:26:30 -04:00
parent 99ac47cf0d
commit a1dee0e6f2
45 changed files with 25 additions and 4 deletions
tests
fsck-data
test2e
test2f
test2g
test2h
test2i
data.sql
data/a/b/0000
test2j
test2k
test2l
test2m
test2n
test2o
test2p
test2p1
data.sql
data/a/b
test2p2
test2q
test_fsck.py

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
world

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
world

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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")