def test_cheapInitialIncremental(self): testbackend.createNamespace("foo") backupWithMonitoring(self, self.source, testbackend.theBackend()("foo"), startSnapshot="D", endSnapshot="D")
def test_ScrubbingAndSnapshotMgmtTarget(self): testbackend.createNamespace("toscrub") target = testbackend.theBackend()("toscrub") # def check(allss, toscrubss): # self.assertEqual(B.getVolumeSnapshots(target), allss) # self.assertEqual(B.getScrubSnapshots(target), toscrubss) for ss in B.getVolumeSnapshots(self.source): backupWithMonitoring(self, self.source, target, endSnapshot=ss)
def test_Monitoring(self): B.testConfiguration() ns = "monitortest" testbackend.createNamespace(ns) target = testbackend.theBackend()(ns) self.assertEqual(B.getProgressInfo(target), None) backupWithMonitoring(self, self.source, target) info = B.getProgressInfo(target) self.assertTrue(type(info), dict) self.assertEqual(info["total_size"], info["seen"]) self.assertEqual(info["still_to_be_examined"], 0) self.assertTrue(info["sent_to_backend"] <= info["total_size"])
def test_Basic(self): B.testConfiguration() testbackend.createNamespace("basebackup") target = testbackend.theBackend()("basebackup") backupWithMonitoring(self, self.source, target, endSnapshot="A") backupWithMonitoring(self, self.source, target, endSnapshot="C") backupWithMonitoring(self, self.source, target, endSnapshot="E") backupWithMonitoring(self, self.source, target)
def test_VolumeRoles(self): for ns in ["base", "inc"]: testbackend.createNamespace(ns) self.assertEqual( B.getVolumeInfo(self.source)["volume_role"], ToolCut.WanBackupVolumeRole.Normal) for s in ["B", "C", "D"]: backupWithMonitoring(self, self.source, testbackend.theBackend()("base"), endSnapshot=s) self.assertEqual( B.getVolumeInfo( testbackend.theBackend()("base"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupBase) self.assertEqual( B.getVolumeSnapshots(testbackend.theBackend()("base")), ["B", "C", "D"]) backupWithMonitoring(self, self.source, testbackend.theBackend()("inc"), startSnapshot="B", endSnapshot="C") self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("inc"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupIncremental) self.assertEqual(B.getVolumeSnapshots(testbackend.theBackend()("inc")), ["B", "C"]) backupWithMonitoring(self, self.source, testbackend.theBackend()("inc")) self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("inc"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupIncremental) self.assertEqual(B.getVolumeSnapshots(testbackend.theBackend()("inc")), ["B", "C", "F"]) self.assertRaises(Exception, B.promote, testbackend.theBackend()("inc")) B.promote(testbackend.theBackend()("base")) self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("base"))["volume_role"], ToolCut.WanBackupVolumeRole.Normal) self.makeDirs("copy") cpy = Backend.LocalBackend(self.getDir())("copy") B.copy(self.source, cpy) self.assertEqual( B.getVolumeInfo(cpy)["volume_role"], ToolCut.WanBackupVolumeRole.Normal)
def test_VolumeRoles(self): for ns in ["base", "inc"]: testbackend.createNamespace(ns) self.assertEqual(B.getVolumeInfo(self.source)["volume_role"], ToolCut.WanBackupVolumeRole.Normal) for s in ["B", "C", "D"]: backupWithMonitoring(self, self.source, testbackend.theBackend()("base"), endSnapshot=s) self.assertEqual( B.getVolumeInfo( testbackend.theBackend()("base"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupBase) self.assertEqual( B.getVolumeSnapshots(testbackend.theBackend()("base")), ["B", "C", "D"]) backupWithMonitoring(self, self.source, testbackend.theBackend()("inc"), startSnapshot="B", endSnapshot="C") self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("inc"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupIncremental) self.assertEqual(B.getVolumeSnapshots(testbackend.theBackend()("inc")), ["B", "C"]) backupWithMonitoring(self, self.source, testbackend.theBackend()("inc")) self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("inc"))["volume_role"], ToolCut.WanBackupVolumeRole.BackupIncremental) self.assertEqual(B.getVolumeSnapshots(testbackend.theBackend()("inc")), ["B", "C", "F"]) self.assertRaises(Exception, B.promote, testbackend.theBackend()("inc")) B.promote(testbackend.theBackend()("base")) self.assertEqual( B.getVolumeInfo(testbackend.theBackend()("base"))["volume_role"], ToolCut.WanBackupVolumeRole.Normal) self.makeDirs("copy") cpy = Backend.LocalBackend(self.getDir())("copy") B.copy(self.source, cpy) self.assertEqual(B.getVolumeInfo(cpy)["volume_role"], ToolCut.WanBackupVolumeRole.Normal)
def test_OutOfOrder(self): for ns in ["incremental", "final", "usb"]: testbackend.createNamespace(ns) backupWithMonitoring(self, self.source, testbackend.theBackend()("usb"), endSnapshot="C") backupWithMonitoring(self, self.source, testbackend.theBackend()("incremental"), startSnapshot="C") B.copy(testbackend.theBackend()("usb"), testbackend.theBackend()("final")) backupWithMonitoring(self, testbackend.theBackend()("incremental"), testbackend.theBackend()("final"))
def test_Idempotency(self): testbackend.createNamespace("foo") target = testbackend.theBackend()("foo") backupWithMonitoring(self, self.source, target) backupWithMonitoring(self, self.source, target)