mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 09:47:58 +00:00
archiver: add test for debug refcount-obj
This commit is contained in:
parent
d0c1ea5935
commit
38d601619e
1 changed files with 14 additions and 0 deletions
|
@ -2607,6 +2607,20 @@ def test_debug_dump_archive(self):
|
|||
assert '_meta' in result
|
||||
assert '_items' in result
|
||||
|
||||
def test_debug_refcount_obj(self):
|
||||
self.cmd('init', '--encryption=repokey', self.repository_location)
|
||||
output = self.cmd('debug', 'refcount-obj', self.repository_location, '0' * 64).strip()
|
||||
assert output == 'object 0000000000000000000000000000000000000000000000000000000000000000 not found [info from chunks cache].'
|
||||
|
||||
create_json = json.loads(self.cmd('create', '--json', self.repository_location + '::test', 'input'))
|
||||
archive_id = create_json['archive']['id']
|
||||
output = self.cmd('debug', 'refcount-obj', self.repository_location, archive_id).strip()
|
||||
assert output == 'object ' + archive_id + ' has 1 referrers [info from chunks cache].'
|
||||
|
||||
# Invalid IDs do not abort or return an error
|
||||
output = self.cmd('debug', 'refcount-obj', self.repository_location, '124', 'xyza').strip()
|
||||
assert output == 'object id 124 is invalid.\nobject id xyza is invalid.'
|
||||
|
||||
requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason='GNU tar must be installed for this test.')
|
||||
requires_gzip = pytest.mark.skipif(not shutil.which('gzip'), reason='gzip must be installed for this test.')
|
||||
|
||||
|
|
Loading…
Reference in a new issue