mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix: a test alert button; damage shown and warned of on restore
Audit of the alerts and backup verification: an operator could learn that the alert mail or webhook works only from a real failure. Settings > Alerts gets "Send a test alert", sent at once to the channels saved, each channel's result shown. A damaged backup's reasons were only in a tooltip, so not on a touch screen: they show under the badge. A restore of a backup that a verification found damaged, or of an incremental on a damaged base (shown as Ready), said nothing: the restore pages warn.
This commit is contained in:
parent
dcd7e32df7
commit
2c8493ba8c
15 changed files with 254 additions and 70 deletions
|
|
@ -289,3 +289,18 @@ class VerifyBackupTests(TransactionTestCase):
|
|||
page = self.client.get(reverse("vmbackups:index"))
|
||||
self.assertContains(page, "Damaged")
|
||||
self.assertContains(page, "The backup's file f is missing from the target")
|
||||
|
||||
def test_a_restore_page_tells_of_damage_in_the_chain(self):
|
||||
self.client.force_login(self.admin)
|
||||
damage = [{"text": "The backup's file %(name)s is missing from the target", "values": {"name": "base-vda.qcow2"}}]
|
||||
page = self.client.get(reverse("vmbackups:restore_disk", args=[self.incremental.uuid]))
|
||||
self.assertNotContains(page, "found damaged")
|
||||
Backup.objects.filter(pk=self.full.pk).update(damage=damage)
|
||||
self.assertEqual(Backup.objects.get(pk=self.incremental.pk).damaged_in_chain(), Backup.objects.get(pk=self.full.pk))
|
||||
page = self.client.get(reverse("vmbackups:restore_disk", args=[self.incremental.uuid]))
|
||||
self.assertContains(page, "which a verification found damaged")
|
||||
self.assertContains(page, "base-vda.qcow2 is missing from the target")
|
||||
page = self.client.get(reverse("vmbackups:index"))
|
||||
self.assertContains(page, "base-vda.qcow2 is missing from the target") # under the badge, not only a tooltip
|
||||
Backup.objects.filter(pk=self.full.pk).update(damage=[], parent=self.incremental) # a chain that loops
|
||||
self.assertIsNone(Backup.objects.get(pk=self.incremental.pk).damaged_in_chain())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue