def setUp(self): super(TestTakeSnapshotSSH, self).setUp() self.include = TemporaryDirectory() generic.create_test_files(self.include.name) #mount self.cfg.setCurrentHashId(mount.Mount(cfg = self.cfg).mount())
def setUp(self): super(TestRestoreSSH, self).setUp() self.include = TemporaryDirectory() generic.create_test_files(os.path.join(self.remoteSIDBackupPath, self.include.name[1:])) #mount self.cfg.setCurrentHashId(mount.Mount(cfg = self.cfg).mount())
def setUp(self): super(TestTakeSnapshotSSH, self).setUp() self.include = TemporaryDirectory() generic.create_test_files(self.include.name) #mount self.cfg.setCurrentHashId(mount.Mount(cfg=self.cfg).mount())
def test_takeSnapshot_with_spaces_in_exclude(self): now = datetime.today() sid1 = snapshots.SID(now, self.cfg) exclude = os.path.join(self.include.name, 'test path with spaces') generic.create_test_files(exclude) self.cfg.setExclude([exclude]) self.assertListEqual([True, False], self.sn.takeSnapshot(sid1, now, [ (self.include.name, 0), ])) self.assertTrue(sid1.exists()) self.assertTrue( sid1.canOpenPath( os.path.join(self.include.name, 'foo', 'bar', 'baz'))) self.assertTrue( sid1.canOpenPath(os.path.join(self.include.name, 'test'))) self.assertFalse(sid1.canOpenPath(exclude)) for f in ('config', 'fileinfo.bz2', 'info', 'takesnapshot.log.bz2'): self.assertTrue(os.path.exists(sid1.path(f)), msg='file = {}'.format(f)) for f in ('failed', 'save_to_continue'): self.assertFalse(os.path.exists(sid1.path(f)), msg='file = {}'.format(f))
def test_takeSnapshot_with_spaces_in_include(self, sleep): now = datetime.today() sid1 = snapshots.SID(now, self.cfg) include = os.path.join(self.include.name, 'test path with spaces') generic.create_test_files(include) self.assertListEqual([True, False], self.sn.takeSnapshot(sid1, now, [(include, 0),])) self.assertTrue(sid1.exists()) self.assertTrue(sid1.canOpenPath(os.path.join(include, 'foo', 'bar', 'baz'))) self.assertTrue(sid1.canOpenPath(os.path.join(include, 'test'))) for f in ('config', 'fileinfo.bz2', 'info', 'takesnapshot.log.bz2'): self.assertExists(sid1.path(f)) for f in ('failed', 'save_to_continue'): self.assertNotExists(sid1.path(f))
def setUp(self): super(TestRestore, self).setUp() self.include = TemporaryDirectory() generic.create_test_files(self.sid.pathBackup(self.include.name))
def setUp(self): super(TestTakeSnapshot, self).setUp() self.include = TemporaryDirectory() generic.create_test_files(self.include.name)