Recover disk space safely and complete metadata-only backup updates
This commit is contained in:
1 parent
04283a607c
commit
a5a7e38853
17 files changed
+827
-209
No files matched your search
@@ -149,6 +149,27 @@ MAIL_SENDMAIL_BIN="{self.sendmail}"
|
||||
self.assertIn('stale',self.state()['error'])
|
||||
self.clean()
|
||||
|
||||
def test_same_size_corruption_is_detected_by_monthly_restore(self):
|
||||
path=self.folder/'wordpress.tar.gz'
|
||||
data=bytearray(path.read_bytes())
|
||||
data[len(data)//2]^=1
|
||||
path.write_bytes(data)
|
||||
self.upload()
|
||||
result=self.execute(ok=False)
|
||||
self.assertIn('Archive checksum/size mismatch',result)
|
||||
self.assertFalse((self.root/'last-success.json').exists())
|
||||
self.assertFalse((self.root/'scratch').exists())
|
||||
|
||||
def test_extra_ai_rem_files_are_downloaded_and_extracted(self):
|
||||
self.make_archive('extra-0','files/extra-0',b'ai-rem database snapshot')
|
||||
self.make_archive('extra-1','files/extra-1',b'ai-rem configuration')
|
||||
self.manifest()
|
||||
self.upload()
|
||||
self.execute()
|
||||
state=json.loads((self.root/'state.json').read_text())
|
||||
for label in ('extra-0','extra-1'):
|
||||
self.assertTrue(any(c['label']==label and c['status']=='SUCCESS' for c in state['components']))
|
||||
|
||||
def test_corrupt_archive_is_not_success_and_cleans(self):
|
||||
(self.folder/'wordpress.tar.gz').write_bytes(b'corrupt')
|
||||
self.upload()
|
||||
|
||||
Reference in new issue
Block a user