def testSeries(self): """Test hardlink system by backing up and restoring a few dirs""" dirlist = [ self.hlinks_dir1, self.hlinks_dir2, self.hlinks_dir3, os.path.join(old_test_dir, b'various_file_types') ] BackupRestoreSeries(None, None, dirlist, compare_hardlinks=1) BackupRestoreSeries(1, 1, dirlist, compare_hardlinks=1)
def testSeriesRemote(self): """Test backing up, restoring directories with EA remotely""" self.make_backup_dirs() dirlist = [ self.acl_test1_dir, self.acl_test2_dir, self.acl_empty_dir, self.acl_test1_dir ] BackupRestoreSeries(None, None, dirlist, compare_acls=1)
def testSeriesRemote(self): """Test backing up and restoring EAs/ACLs locally""" self.make_backup_dirs() dirlist = [ self.combo_test1_dir, self.combo_empty_dir, self.combo_test2_dir, self.combo_test1_dir ] BackupRestoreSeries(None, None, dirlist, compare_eas=1, compare_acls=1)
def testSeriesLocal(self): """Test backing up and restoring directories with ACLs locally""" self.make_backup_dirs() dirlist = [ self.acl_test1_dir, self.acl_empty_dir, self.acl_test2_dir, self.acl_test1_dir ] BackupRestoreSeries(1, 1, dirlist, compare_acls=1)
def testSeriesRemote(self): """Test backing up and restoring directories with ACLs locally""" Globals.read_resource_forks = Globals.write_resource_forks = 1 self.make_backup_dirs() dirlist = [ 'testfiles/resource_fork_test1', 'testfiles/resource_fork_test2', 'testfiles/empty', 'testfiles/resource_fork_test1' ] # BackupRestoreSeries(1, 1, dirlist, compare_resource_forks = 1) BackupRestoreSeries(1, 1, dirlist)
def test_ownership(self): """Test backing up and restoring directory with different uids This checks for a bug in 0.13.4 where uids and gids would not be restored correctly. Also test to make sure symlinks get the right ownership. (Earlier symlink ownership was not preserved.) """ dirrp = rpath.RPath(Globals.local_connection, os.path.join(abs_test_dir, b"root_owner")) def make_dir(): re_init_rpath_dir(dirrp) rp1 = dirrp.append('file1') rp2 = dirrp.append('file2') rp3 = dirrp.append('file3') rp4 = dirrp.append('file4') rp5 = dirrp.append('symlink') rp1.touch() rp2.touch() rp3.touch() rp4.touch() rp5.symlink(b'foobar') rp1.chown(2000, 2000) rp2.chown(2001, 2001) rp3.chown(2002, 2002) rp4.chown(2003, 2003) rp5.chown(2004, 2004) make_dir() dirlist = [ os.path.join(abs_test_dir, b"root_owner"), os.path.join(old_test_dir, b"empty"), os.path.join(abs_test_dir, b"root_owner") ] BackupRestoreSeries(1, 1, dirlist, compare_ownership=1) symrp = rpath.RPath(Globals.local_connection, os.path.join(abs_output_dir, b'symlink')) self.assertTrue(symrp.issym()) self.assertEqual(symrp.getuidgid(), (2004, 2004))
def testRemote(self): BackupRestoreSeries(None, None, self.dirlist1, compare_ownership=1)
def testLocal2(self): BackupRestoreSeries(1, 1, self.dirlist2, compare_ownership=1)