コード例 #1
0
    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())
コード例 #2
0
    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())
コード例 #3
0
    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())
コード例 #4
0
    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))
コード例 #5
0
ファイル: test_restore.py プロジェクト: kortschak/backintime
    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())
コード例 #6
0
    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))
コード例 #7
0
 def setUp(self):
     super(TestRestore, self).setUp()
     self.include = TemporaryDirectory()
     generic.create_test_files(self.sid.pathBackup(self.include.name))
コード例 #8
0
 def setUp(self):
     super(TestRestore, self).setUp()
     self.include = TemporaryDirectory()
     generic.create_test_files(self.sid.pathBackup(self.include.name))
コード例 #9
0
 def setUp(self):
     super(TestTakeSnapshot, self).setUp()
     self.include = TemporaryDirectory()
     generic.create_test_files(self.include.name)
コード例 #10
0
 def setUp(self):
     super(TestTakeSnapshot, self).setUp()
     self.include = TemporaryDirectory()
     generic.create_test_files(self.include.name)