def testCreateListDeleteSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset zfsbackup.create_snapshot(dataset, 'zfsbackup-unittest') desired_snap = self.base_dataset + '/' + self.source_dataset + '@zfsbackup-unittest' snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(desired_snap in snaps) zfsbackup.delete_snapshot(desired_snap) snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(desired_snap not in snaps)
def testSendFullLocal(self): dataset = self.base_dataset + '/' + self.source_dataset dest = self.base_dataset + '/' + self.dest_dataset snap = zfsbackup.create_timestamp_snap(dataset) zfsbackup.send_full(dataset + snap, dest) snaps = zfsbackup.get_snapshots(dest) self.assertTrue(dest + snap in snaps)
def testRenameDataset(self): dataset = self.base_dataset + '/' + self.source_dataset rename = self.base_dataset + '/something' zfsbackup.rename_dataset(dataset, rename) desired_snap = self.base_dataset + '/something@zfsbackup-expected' snaps = zfsbackup.get_snapshots(rename) self.assertTrue(desired_snap in snaps)
def testRenameSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset to_rename = dataset + '@zfsbackup-rename' rename_to = dataset + '@zfsbackup-butts' zfsbackup.rename_snapshot(to_rename, rename_to) snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(rename_to in snaps)
def testSendSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset snapshot = dataset + '@zfsbackup-sendtest' destination = self.base_dataset + '/' + self.dest_dataset zfsbackup.create_snapshot(dataset, 'zfsbackup-sendtest') zfsbackup.send_snapshot(snapshot, destination) snaps = zfsbackup.get_snapshots(destination) self.assertTrue(destination + '@zfsbackup-sendtest' in snaps)
def testSendFullSSHAlt(self): dataset = self.base_dataset + '/' + self.source_dataset dest = self.base_dataset + '/' + self.dest_dataset snap = zfsbackup.create_timestamp_snap(dataset) zfsbackup.send_full(dataset + snap, dest, transport="ssh:root@localhost:44") snaps = zfsbackup.get_snapshots(dest) self.assertTrue(dest + snap in snaps)
def testSendSnapshotSSHAlt(self): dataset = self.base_dataset + '/' + self.source_dataset snapshot = dataset + '@zfsbackup-sendtest' destination = self.base_dataset + '/' + self.dest_dataset zfsbackup.create_snapshot(dataset, 'zfsbackup-sendtest') zfsbackup.send_snapshot(snapshot, destination, transport="ssh:root@localhost:44") snaps = zfsbackup.get_snapshots(destination) self.assertTrue(destination + '@zfsbackup-sendtest' in snaps)
def testSendSnapshotFail(self): dataset = self.base_dataset + '/' + self.source_dataset snapshot = dataset + '@zfsbackup-sendtest-fail' destination = self.base_dataset + '/' + self.other_dataset try: zfsbackup.create_snapshot(dataset, 'zfsbackup-sendtest-fail') zfsbackup.send_snapshot(snapshot, destination) except ZFSBackupError as e: snaps = zfsbackup.get_snapshots(destination) self.assertFalse(snapshot in snaps) return self.assertTrue(False)
def testListSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset desired_snap = self.base_dataset + '/' + self.source_dataset + '@zfsbackup-expected' snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(desired_snap in snaps)
def testCreateTimestampSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset snap = zfsbackup.create_timestamp_snap(dataset) snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(dataset + snap in snaps)
def testCreateSnapshot(self): dataset = self.base_dataset + '/' + self.source_dataset snap = dataset + "@zfsbackup-unittest" zfsbackup.create_snapshot(dataset, 'zfsbackup-unittest') snaps = zfsbackup.get_snapshots(dataset) self.assertTrue(snap in snaps)