Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 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)
Beispiel #6
0
 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)
Beispiel #7
0
 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)
Beispiel #8
0
 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)
Beispiel #9
0
 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)
Beispiel #10
0
 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)
Beispiel #11
0
 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)